@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --ink: #0f2a23;
    --ink-soft: #1c4038;
    --paper: #eef1ec;
    --card-bg: #ffffff;
    --border: #dbe1da;
    --text: #16241f;
    --text-muted: #647169;
    --accent: #c8912f;
    --accent-dark: #a8781f;
    --teal: #1f7a63;
    --danger: #b6472f;
    --success: #1f7a52;
    --radius: 10px;
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
svg { max-width: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--text);
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }
a { color: inherit; }

.site-header {
    background: var(--ink);
    color: #fff;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-decoration: none; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 18px; height: 18px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.search-form { display: flex; }
.search-form input { border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); padding: 9px 14px; font-family: var(--font-body); font-size: 14px; width: 220px; }
.search-form button { border: none; background: var(--accent); color: var(--ink); border-radius: 0 var(--radius) var(--radius) 0; padding: 0 14px; cursor: pointer; }
.cart-link { position: relative; display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font-weight: 600; font-size: 14px; }
.cart-badge { background: var(--accent); color: var(--ink); font-family: var(--font-mono); font-size: 12px; font-weight: 700; border-radius: 20px; padding: 2px 8px; }

.container { max-width: 1180px; margin: 0 auto; padding: 32px; }

.category-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.category-chip { border: 1px solid var(--border); background: var(--card-bg); padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text-muted); }
.category-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,42,35,0.1); }
.product-thumb { aspect-ratio: 1; background: var(--paper); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb-fallback { color: var(--text-muted); font-size: 12px; }
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.product-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.product-price { margin-top: auto; font-family: var(--font-mono); font-weight: 600; font-size: 16px; color: var(--ink); }

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

/* ---------- Storefront home ---------- */
.hero {
    background:
        radial-gradient(circle at 12% 15%, rgba(200,145,47,0.24), transparent 42%),
        radial-gradient(circle at 88% 85%, rgba(31,122,99,0.32), transparent 48%),
        linear-gradient(160deg, var(--ink) 0%, var(--ink-soft) 100%);
    color: #fff;
    padding: 64px 32px 88px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.5;
}
.hero-inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: rgba(200,145,47,0.14); border: 1px solid rgba(200,145,47,0.35); padding: 6px 14px; border-radius: 20px; margin-bottom: 22px; }
.hero-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: 44px; line-height: 1.12; max-width: 620px; margin-bottom: 16px; }
.hero p { font-size: 16px; color: rgba(255,255,255,0.72); max-width: 460px; line-height: 1.6; margin-bottom: 32px; }
.hero-search { display: flex; max-width: 480px; background: #fff; border-radius: 30px; padding: 5px; box-shadow: 0 16px 40px rgba(0,0,0,0.25); }
.hero-search input { flex: 1; border: none; background: none; padding: 12px 18px; font-family: var(--font-body); font-size: 14px; color: var(--text); outline: none; }
.hero-search button { border: none; background: var(--accent); color: var(--ink); border-radius: 24px; padding: 0 24px; font-weight: 700; font-size: 14px; cursor: pointer; }
.hero-search button:hover { background: var(--accent-dark); }

.shelf-wrap { max-width: 1180px; margin: -40px auto 0; padding: 0 32px; position: relative; z-index: 2; }
.shelf { display: flex; gap: 10px; flex-wrap: wrap; background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: 0 12px 30px rgba(15,42,35,0.08); }
.shelf-tag { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--paper); color: var(--text-muted); padding: 9px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.shelf-tag.active { background: var(--ink); color: #fff; }
.shelf-tag:hover:not(.active) { background: #e2e7e0; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 48px 0 22px; }
.section-heading h2 { font-size: 22px; }
.section-heading span { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.product-card { position: relative; animation: cardIn 0.5s ease both; }
.product-card:nth-child(n+13) { animation: none; }
.product-card:nth-child(1) { animation-delay: 0.02s; } .product-card:nth-child(2) { animation-delay: 0.06s; }
.product-card:nth-child(3) { animation-delay: 0.10s; } .product-card:nth-child(4) { animation-delay: 0.14s; }
.product-card:nth-child(5) { animation-delay: 0.18s; } .product-card:nth-child(6) { animation-delay: 0.22s; }
.product-card:nth-child(7) { animation-delay: 0.26s; } .product-card:nth-child(8) { animation-delay: 0.30s; }
.product-card:nth-child(9) { animation-delay: 0.34s; } .product-card:nth-child(10) { animation-delay: 0.38s; }
.product-card:nth-child(11) { animation-delay: 0.42s; } .product-card:nth-child(12) { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) { .product-card { animation: none; } }

.price-tag { position: absolute; top: 12px; right: -2px; background: var(--accent); color: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 13px; padding: 6px 12px 6px 14px; border-radius: 6px 0 0 6px; box-shadow: 0 6px 14px rgba(0,0,0,0.18); z-index: 2; }
.price-tag::after { content: ""; position: absolute; right: -8px; top: 0; border-style: solid; border-width: 0 0 100% 8px; border-color: transparent transparent transparent var(--accent); }
.price-tag::before { content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 4px; height: 4px; border-radius: 50%; background: rgba(15,42,35,0.35); }
.product-thumb { position: relative; overflow: hidden; }
.product-thumb img { transition: transform 0.4s ease; }
.product-card:hover .product-thumb img { transform: scale(1.06); }
.product-price { display: none; }


.detail-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-image { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-price { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--ink); margin: 14px 0; }
.detail-stock { font-size: 13px; color: var(--success); font-weight: 600; margin-bottom: 20px; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.qty-row input { width: 70px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-mono); text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius); padding: 12px 20px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-soft); }
.btn-secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }

.cart-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cart-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cart-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-qty-input { width: 60px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; font-family: var(--font-mono); text-align: center; }
.cart-remove { color: var(--danger); font-size: 13px; font-weight: 600; text-decoration: none; }
.cart-summary { display: flex; justify-content: flex-end; margin-top: 20px; }
.cart-summary-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; min-width: 280px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.cart-summary-total { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

.checkout-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 14px; }
.payment-note { background: var(--paper); border-radius: 8px; padding: 14px 16px; font-size: 13px; color: var(--text-muted); margin-top: 16px; line-height: 1.6; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: #f8e7e2; color: var(--danger); }
.alert-success { background: #e5f3ea; color: var(--success); }

.order-ref { font-family: var(--font-mono); font-weight: 700; font-size: 22px; color: var(--ink); background: var(--paper); display: inline-block; padding: 10px 18px; border-radius: 8px; letter-spacing: 0.04em; }

.site-footer { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
    .site-header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; row-gap: 10px; }
    .brand { font-size: 16px; }
    .brand-mark { width: 30px; height: 30px; }
    .header-actions { width: 100%; order: 3; justify-content: space-between; gap: 12px; }
    .search-form { flex: 1; }
    .search-form input { width: auto; flex: 1; min-width: 0; }
    .cart-link { flex-shrink: 0; }

    .hero { padding: 36px 16px 64px; }
    .hero h1 { font-size: 28px; max-width: 100%; }
    .hero p { font-size: 14px; max-width: 100%; }
    .hero-search { max-width: 100%; }
    .hero-eyebrow { font-size: 11px; padding: 5px 12px; }

    .shelf-wrap { padding: 0 16px; margin-top: -32px; }
    .shelf { padding: 10px; gap: 8px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .shelf::-webkit-scrollbar { display: none; }
    .shelf-tag { padding: 8px 14px; font-size: 12.5px; }

    .container { padding: 24px 16px; }
    .section-heading { margin: 32px 0 16px; }
    .section-heading h2 { font-size: 18px; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-body { padding: 10px 12px 12px; gap: 4px; }
    .product-name { font-size: 13px; }
    .price-tag { font-size: 11px; padding: 5px 10px 5px 12px; top: 8px; }

    .detail-wrap { gap: 24px; }
    .detail-price { font-size: 22px; margin: 10px 0; }
    .qty-row input { width: 60px; }
    .btn { width: 100%; }

    .cart-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
    .cart-table { min-width: 560px; border: none; }
    .cart-summary { justify-content: stretch; }
    .cart-summary-box { width: 100%; min-width: 0; }

    .checkout-grid { gap: 20px; }
    .card { padding: 18px; }
    .order-ref { font-size: 18px; padding: 8px 14px; }
}

@media (max-width: 380px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .hero h1 { font-size: 24px; }
}

