* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; color: #111; background: #fff; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 18px; }

/* HEADER */
.site-header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 50; }
.header-row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 14px;
    align-items: center;
}
.brand-logo {
    width: 70px; height: 34px;
    border: 2px solid #111;
    border-radius: 8px;
    display: grid; place-items: center;
    font-weight: 900; letter-spacing: 1px;
}

.search { display: flex; gap: 0; }
.search input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 10px 0 0 10px;
    outline: none;
}
.search button {
    width: 54px;
    border: 1px solid #1f5b3b;
    background: #1f5b3b;
    color: #fff;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
}

.header-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.icon-link { font-size: 14px; color: #222; }
.icon-link:hover { text-decoration: underline; }

.cart-pill {
    display: inline-flex; gap: 8px; align-items: center;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 999px;
    background: #fff;
}
.cart-sum { color: #333; font-weight: 700; }
.cart-text { color: #444; }

/* NAV */
.nav-row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 18px 12px;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.nav-link { color: #333; font-size: 14px; }
.nav-link:hover { text-decoration: underline; }

/* HERO */
.hero { position: relative; height: 420px; }
.hero-bg {
    position: absolute; inset: 0;
    background:
            linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.55)),
            url("/static/hero.jpg");
    background-size: cover;
    background-position: center;
}
.hero-card {
    position: absolute;
    left: 18px;
    bottom: 18px;
    max-width: 520px;
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 18px 18px;
}
.hero-title { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.hero-subtitle { font-size: 14px; color: #333; line-height: 1.4; }

/* SECTION */
.section { padding: 18px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 10px 0 14px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-hint { color: #777; font-size: 13px; }

.empty { padding: 18px; border: 1px dashed #ddd; border-radius: 12px; color: #666; }

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .header-row { grid-template-columns: 90px 1fr; grid-template-rows: auto auto; }
    .header-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px)  { .grid { grid-template-columns: 1fr; } }

/* CARD */
.card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.04);
    transform: translateY(8px);
    opacity: 0;
    transition: transform .45s ease, opacity .45s ease;
}
.card.show { transform: translateY(0); opacity: 1; }

.card-img { display: block; position: relative; background: #fafafa; }
.card-img img { width: 100%; height: 260px; object-fit: contain; display: block; }

.badge-new {
    position: absolute; left: 12px; top: 12px;
    background: #1f5b3b; color: #fff;
    font-size: 12px; font-weight: 800;
    padding: 6px 10px; border-radius: 999px;
}

.card-body { padding: 12px 14px 14px; }
.card-brand { font-size: 12px; color: #777; margin-bottom: 6px; }
.card-title { display: block; font-size: 16px; font-weight: 800; line-height: 1.2; min-height: 38px; }
.card-title:hover { text-decoration: underline; }

.card-price { margin-top: 8px; }
.price-main { font-size: 18px; font-weight: 900; }

.card-meta {
    margin-top: 10px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
    font-size: 13px;
}
.stock { font-weight: 700; }
.stock.ok { color: #1f5b3b; }
.stock.no { color: #b00020; }

.colors { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 999px; border: 1px solid #ddd; background: #000; }
.muted { color: #777; font-size: 12px; }

/* BUY BUTTON */
.buy { margin-top: 12px; }
.btn-buy {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #1f5b3b;
    background: #1f5b3b;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
.btn-buy:hover { filter: brightness(0.95); }

/* ===== ADMIN UI ===== */
.page { background: #f6f6f6; }

.admin-top { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid #e8e8e8; }
.admin-top-inner {
    max-width: 1200px; margin: 0 auto; padding: 12px 18px;
    display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.admin-title { display: flex; gap: 12px; align-items: center; }
.h1 { font-weight: 900; font-size: 18px; }

.admin-actions { display: flex; gap: 10px; align-items: center; }

.admin-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 16px;
}
@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
    overflow: hidden;
}
.panel-head {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.panel-head h2 { margin: 0; font-size: 18px; }

.admin-form { padding: 14px 16px 16px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 13px; }
.field span { color: #444; font-weight: 700; }
.field input, .field textarea {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    outline: none;
    background: #fff;
}
.field input:focus, .field textarea:focus { border-color: #1f5b3b; box-shadow: 0 0 0 3px rgba(31,91,59,.12); }
.field textarea { min-height: 110px; resize: vertical; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 820px) {
    .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
}

.check { display: inline-flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: 18px; height: 18px; }

.hint-box {
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px dashed #ddd;
    background: #fafafa;
    color: #555;
    font-size: 13px;
}

.btn { display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 12px; border-radius: 12px; border: 1px solid #111;
    background: #111; color: #fff; font-weight: 800; cursor: pointer;
}
.btn:hover { filter: brightness(0.95); }
.btn.ghost { background: #fff; color: #111; border: 1px solid #ddd; }
.btn-wide { width: 100%; padding: 12px 12px; border-radius: 14px; background: #1f5b3b; border-color: #1f5b3b; }

.admin-list { padding: 10px; display: grid; gap: 10px; }
.admin-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fff;
}
.admin-item:hover { box-shadow: 0 10px 24px rgba(0,0,0,.08); transform: translateY(-1px); }
.admin-item img { width: 64px; height: 54px; object-fit: contain; border-radius: 10px; background: #fafafa; border: 1px solid #eee; }

.admin-item-title { font-weight: 900; line-height: 1.2; }
.admin-item-sub { font-size: 13px; color: #444; }
.muted { color: #777; }

.preview { margin-top: 8px; padding-top: 12px; border-top: 1px solid #f1f1f1; }
.preview-card {
    display: grid; grid-template-columns: 120px 1fr; gap: 12px;
    border: 1px solid #eee; border-radius: 14px; overflow: hidden;
}
.preview-img { background: #fafafa; display: grid; place-items: center; }
.preview-img img { width: 100%; height: 100px; object-fit: contain; }
.preview-body { padding: 10px; }
.preview-brand { font-size: 12px; color: #777; }
.preview-title { font-weight: 900; margin-top: 4px; }
.preview-price { margin-top: 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.p-old { text-decoration: line-through; color: #888; font-weight: 800; }
.p-sale { color: #b00020; font-weight: 900; }
.p-main { font-weight: 900; }
.preview-meta { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.stock.ok { color: #1f5b3b; font-weight: 800; }
.stock.no { color: #b00020; font-weight: 800; }
