:root {
    --navy: #071833;
    --blue: #0c4da2;
    --bright: #1a73e8;
    --ink: #122033;
    --muted: #5c6b80;
    --line: #e3eaf3;
    --bg: #f4f7fb;
    --sale: #e11d48;
    --ok: #0f766e;
    --card: #fff;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
button, input, textarea { font: inherit; }
main { width: min(1180px, calc(100% - 32px)); margin: 24px auto 48px; }

.topbar {
    display: flex;
    gap: 18px;
    justify-content: flex-end;
    padding: 8px 24px;
    background: var(--navy);
    color: #dbe7ff;
    font-size: 13px;
}
.head {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand img { height: 72px; width: auto; display: block; }
.search { display: flex; }
.search input {
    flex: 1;
    border: 1px solid #c9d6e8;
    border-right: 0;
    border-radius: 999px 0 0 999px;
    padding: 12px 16px;
}
.search button, .btn, .card button, .qty button {
    border: 0;
    background: var(--blue);
    color: #fff;
    border-radius: 0 999px 999px 0;
    padding: 12px 18px;
    cursor: pointer;
}
.btn { border-radius: 999px; display: inline-block; }
.card button { width: 100%; border-radius: 8px; margin-top: 8px; }
.head-actions { display: flex; gap: 14px; align-items: center; }
.head-actions form { margin: 0; }
.linkish { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; }
.cart-link {
    background: #e8f1ff;
    color: var(--navy);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}
.count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 99px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
}
.catnav {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 10px 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.catnav a {
    color: var(--navy);
    padding: 8px 12px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
}
.catnav a:hover { background: #e8f1ff; }

.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    background: linear-gradient(120deg, #071833, #0c4da2 70%);
    color: #fff;
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 4px;
}
.hero h1 { font-size: 24px; line-height: 1.2; margin: 2px 0 6px; }
.hero p { color: #d6e6ff; margin: 0 0 8px; font-size: 14px; }
.hero img { width: 108px; margin-left: auto; background: #fff; border-radius: 12px; padding: 4px; }
.eyebrow { letter-spacing: .08em; text-transform: uppercase; font-size: 12px; margin: 0; }
h2 { margin: 14px 0 8px; }
.cats { display: flex; flex-wrap: wrap; gap: 10px; }
.cats a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--navy);
    font-weight: 700;
}
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.card, .sheet, .summary, .line {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.card { overflow: hidden; display: flex; flex-direction: column; }
.thumb { position: relative; background: #fff; display: block; overflow: hidden; }
.thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.thumb:hover img { transform: scale(1.1); }
.off {
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 10px;
    background: var(--sale);
    color: #fff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { font-size: 16px; margin: 0; }
.card-body h3 a { color: var(--ink); }
.price { display: flex; gap: 8px; align-items: center; }
.price strong { color: var(--blue); }
.price.big strong { font-size: 28px; }
s { color: var(--muted); }
.muted { color: var(--muted); margin: 0; }
.card button:disabled, .btn:disabled, button:disabled { background: #cbd5e1; cursor: not-allowed; }

.product { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; background: #fff; border-radius: 16px; padding: 18px; }
.product > img { width: 100%; border-radius: 12px; background: #f8fbff; }
.buy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-block { width: 100%; }
.size-block p { margin: 0 0 8px; font-weight: 700; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size { position: relative; }
.size input { position: absolute; opacity: 0; pointer-events: none; }
.size span {
    display: inline-grid;
    place-items: center;
    min-width: 48px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #c9d6e8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.size input:checked + span { border-color: var(--blue); background: #e8f1ff; color: var(--blue); font-weight: 700; }
.size.gone span { color: #94a3b8; text-decoration: line-through; cursor: not-allowed; background: #f8fafc; }
.card .pick {
    display: block;
    margin-top: 8px;
    text-align: center;
    background: var(--blue);
    color: #fff;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 700;
}
.buy input, .qty input, .sheet input, .sheet textarea {
    border: 1px solid #c9d6e8;
    border-radius: 10px;
    padding: 10px 12px;
    width: 100%;
}
.buy input { width: 80px; }
.buy .btn { border-radius: 10px; }

.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 18px; align-items: start; }
.line { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; padding: 12px; margin-bottom: 10px; }
.line img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }
.line h3 { margin: 0 0 6px; font-size: 16px; }
.line-end { text-align: right; }
.summary, .sheet { padding: 16px; }
.summary p, .sheet p { display: flex; justify-content: space-between; gap: 12px; }
.total { font-weight: 800; font-size: 18px; }
.sheet label, .sheet.narrow { display: grid; gap: 6px; }
.sheet.narrow { max-width: 460px; margin: 0 auto; }
.sheet label { margin-bottom: 10px; }
.pay { display: block !important; }
.pager { display: flex; gap: 8px; margin-top: 16px; }
.pager a { background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; }
.pager a.on { background: var(--blue); color: #fff; }
.flash { padding: 10px 12px; border-radius: 10px; }
.flash.ok { background: #ccfbf1; color: var(--ok); }
.flash.err { background: #ffe4e6; color: #9f1239; }
.empty { background: #fff; padding: 24px; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow: auto; border-radius: 12px; }
.done ul { padding-left: 18px; }
footer { background: var(--navy); color: #d6e4ff; padding: 28px 24px; }
.foot-grid { width: min(1180px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 18px; }
.foot-logo { height: 72px; background: #fff; border-radius: 10px; padding: 4px; }
footer a { display: block; color: #d6e4ff; margin: 6px 0; }
.copy { width: min(1180px, 100%); margin: 18px auto 0; color: #93a8cc; }

.admin-body { background: #f4f7fb; }
.admin-top {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 20px;
    background: #071833;
    color: #fff;
}
.admin-top img { height: 48px; background: #fff; border-radius: 8px; }
.admin-top nav { display: flex; gap: 14px; flex-wrap: wrap; }
.admin-top a, .admin-top .linkish { color: #d6e4ff; }
.admin-main { width: min(1100px, calc(100% - 32px)); margin: 24px auto 48px; }
.admin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-cards a, .admin-cards article {
    background: #fff;
    border: 1px solid #e3eaf3;
    border-radius: 14px;
    padding: 16px;
    color: #122033;
}
.admin-cards strong { display: block; font-size: 28px; color: #0c4da2; }
.admin-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.admin-row label { flex: 1; }
.sheet select, .admin-main select {
    width: 100%;
    border: 1px solid #c9d6e8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.admin-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.check { display: flex !important; align-items: center; gap: 8px; }
.check input { width: auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-search {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 16px;
}
.admin-search input {
    flex: 1;
    border: 1px solid #c9d6e8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.admin-search button {
    border: 0;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
}
.admin-search a { color: var(--blue); }
.status-track, .status-history { list-style: none; margin: 8px 0 16px; padding: 0; }
.status-track { display: flex; gap: 8px; }
.status-track li {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 999px;
    background: #e8eef6;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}
.status-track li.done { background: #d9f5e8; color: var(--ok); }
.status-track li.current { background: var(--blue); color: #fff; }
.status-history li {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 10px;
    position: relative;
    padding-bottom: 12px;
}
.status-history li::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #c9d6e8;
    margin-top: 4px;
}
.status-history li.current::before { background: var(--blue); }
.status-history li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: #e3eaf3;
}
.status-history strong { display: block; }
.status-history span { color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
    .thumb img { transition: none; }
    .thumb:hover img { transform: none; }
}

@media (max-width: 900px) {
    .head, .hero, .product, .split, .foot-grid { grid-template-columns: 1fr; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .topbar { justify-content: flex-start; flex-wrap: wrap; }
    .brand img, .foot-logo { height: 56px; }
    .hero h1 { font-size: 22px; }
    .hero img { width: 88px; }
}
