:root {
    --ink: #232821;
    --ink-soft: #6b7166;
    --paper: #f3f4ee;
    --card: #ffffff;
    --line: #e1e3da;
    --sage: #5b7553;
    --sage-soft: #e6ede3;
    --amber: #d99a2b;
    --amber-soft: #fbf0dd;
    --serif: 'Newsreader', serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(243,244,238,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sage);
    margin: 0;
}

.cart-icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.cart-icon-btn:hover { border-color: var(--sage); }
.cart-icon-btn.landed { animation: cartLand 0.42s cubic-bezier(.36,1.9,.4,1); }
@keyframes cartLand {
    0% { transform: scale(1); }
    35% { transform: scale(1.22) rotate(-6deg); }
    65% { transform: scale(0.92) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--amber);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    transition: transform 0.2s ease;
}
.cart-badge.bump { animation: badgeBump 0.4s ease; }
@keyframes badgeBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* ---------- Page ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 40px 24px 100px; }
h1 {
    font-family: var(--serif);
    font-size: 2.1rem;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.subhead {
    color: var(--ink-soft);
    max-width: 60ch;
    line-height: 1.6;
    margin: 0 0 32px;
    font-size: 0.95rem;
}

/* ---------- Product Grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(35,40,33,0.08); transform: translateY(-2px); }

.product-media {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 14px;
    user-select: none;
}

.product-name { font-weight: 600; font-size: 0.98rem; margin: 0 0 4px; }
.product-cat { color: var(--ink-soft); font-size: 0.8rem; margin: 0 0 12px; }

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-price {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 1rem;
}

.btn-add {
    position: relative;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}
.btn-add:hover { background: var(--sage); }
.btn-add:active { transform: scale(0.96); }
.btn-add.added { background: var(--sage); }

/* ---------- Flying ghost clone ---------- */
.flying-ghost {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, filter, opacity;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .check {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--sage);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-media { font-size: 2.2rem; }
}
