:root {
    --primary: #1c1917;
    --on-primary: #ffffff;
    --accent: #a16207;
    --accent-hover: #854d0e;
    --on-accent: #ffffff;
    --text: #0c0a09;
    --muted: #6b6560;
    --border: #e7e2da;
    --bg: #ffffff;
    --bg-soft: #f7f4ef;
    --danger: #b42318;
    --success: #027a48;
    --radius: 3px;
    --radius-lg: 4px;
    --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.06);
    --shadow-card-hover: 0 12px 24px -8px rgba(28, 25, 23, 0.16);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg-soft);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

header.site-header {
    background: var(--primary);
    color: var(--on-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 16px;
}

.logo {
    font-family: "Rubik", "Nunito Sans", sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: var(--on-primary);
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--on-primary);
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 180ms var(--ease);
}

.cart-link:hover { background: rgba(255, 255, 255, 0.18); }

.cart-badge {
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.categories-nav {
    display: flex;
    gap: 24px;
    padding: 12px 0;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.categories-nav a {
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 180ms var(--ease);
}

.categories-nav a:hover, .categories-nav a.active {
    color: var(--on-primary);
}

main { padding: 40px 0 72px; }

.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.messages li {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: #f0f9f4;
    color: var(--success);
    font-size: 0.92rem;
    border: 1px solid #cbecda;
}
.messages li.warning { background: #fef8ec; color: #93650a; border-color: #f6e3b7; }
.messages li.error { background: #fdf1f0; color: var(--danger); border-color: #f5cfcb; }

h1, h2, h3 {
    font-family: "Rubik", "Nunito Sans", sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.7rem; margin: 0 0 24px; }
h2 { font-size: 1.2rem; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}

.product-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.product-card img, .no-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg-soft);
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.product-card .body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-card .name { font-weight: 600; font-size: 0.98rem; }

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.price {
    font-family: "Rubik", "Nunito Sans", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.old-price { color: var(--muted); text-decoration: line-through; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.stock-note { font-size: 0.82rem; color: var(--muted); }
.stock-note.out { color: var(--danger); }

.btn {
    display: inline-block;
    border: none;
    background: var(--primary);
    color: var(--on-primary);
    padding: 11px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: center;
    transition: background 180ms var(--ease), transform 120ms var(--ease);
}

.btn:hover { background: var(--accent); }
.btn:active { transform: scale(0.98); }

.btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; transform: none; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-soft); color: var(--primary); }

.btn-secondary { background: var(--muted); }
.btn-secondary:hover { background: var(--text); }

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 40px;
}

@media (max-width: 720px) {
    .product-detail { grid-template-columns: 1fr; }
}

.product-detail .gallery img, .product-detail .no-image {
    border-radius: var(--radius-lg);
}

.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--bg);
    font-family: inherit;
    transition: border-color 160ms var(--ease);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
.form-errors { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

table.cart-table { width: 100%; border-collapse: collapse; background: var(--bg); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
table.cart-table th, table.cart-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.92rem;
}
table.cart-table th {
    background: var(--bg-soft);
    font-weight: 600;
    font-family: "Rubik", "Nunito Sans", sans-serif;
}

.qty-input { width: 60px; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius); }

.cart-total {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: baseline;
    padding: 18px 0;
    font-family: "Rubik", "Nunito Sans", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 720px) {
    .checkout-layout { grid-template-columns: 1fr; }
}

.summary-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.summary-box .line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.92rem;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-soft);
}

.status-badge.paid, .status-badge.processing, .status-badge.shipped, .status-badge.done {
    background: #f0f9f4; color: var(--success);
}
.status-badge.canceled { background: #fdf1f0; color: var(--danger); }

.radio-row { display: flex; gap: 20px; margin-bottom: 4px; }
.radio-row label { font-weight: 400; display: flex; align-items: center; gap: 6px; }

footer.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        transform: none !important;
    }
}
