:root {
    /* brand: the logo's sun-yellow → orange gradient */
    --sun: #f9d65e;
    --orange: #f56c1c;
    --brand-grad: linear-gradient(180deg, var(--sun) 0%, #f8a23d 50%, var(--orange) 100%);
    --paper: #fff8ec;
    --paper-2: #fdebd0;
    --ink: #2b1a0c;
    --ink-soft: #6e5640;
    --line: #f0d8b6;
    --accent: #d9480f;
    --accent-ink: #fff;
    --ok: #2f7a4b;
    --radius: 10px;
    --display: 'Josefin Sans', 'Futura', 'Century Gothic', sans-serif;
    --body: 'Instrument Sans', 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    opacity: .35;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 28px; }

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- hero (logo band) ---------- */
.hero {
    position: relative; z-index: 1;
    background: var(--brand-grad);
    color: #fff;
    overflow: hidden;
}
/* soft glow + cart-stripe motif echoing the logo */
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(60% 120% at 85% 0%, rgba(255,255,255,.35), transparent 60%),
        repeating-linear-gradient(180deg, transparent 0 22px, rgba(255,255,255,.05) 22px 30px);
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    padding-top: 44px; padding-bottom: 40px;
}
.logo { display: inline-flex; align-items: center; gap: clamp(16px, 2.5vw, 28px); text-decoration: none; }
.logo-cart {
    width: clamp(64px, 11vw, 140px); height: auto;
    filter: drop-shadow(0 6px 14px rgba(160, 60, 0, .25));
    animation: roll .9s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes roll { from { opacity: 0; transform: translateX(-40px); } }
.logo-text { display: flex; flex-direction: column; gap: 10px; }
.brand small { font-size: .4em; font-weight: 700; letter-spacing: .08em; opacity: .9; }
.brand {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(26px, 7.2vw, 104px);
    line-height: .9;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-shadow: 0 4px 18px rgba(160, 60, 0, .22);
}
/* striped, wide-tracked slogan like the logo */
.slogan {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(11px, 1.5vw, 17px);
    text-transform: uppercase;
    letter-spacing: .55em;
    background: repeating-linear-gradient(180deg, #fff 0 2px, rgba(255,255,255,.6) 2px 3px);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.masthead-meta {
    text-align: right;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.9);
    line-height: 1.7;
}
.masthead-meta strong { color: #fff; font-family: var(--display); font-weight: 700; font-size: 48px; display: block; line-height: 1; }
.tagline {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    color: var(--ink-soft);
}

/* ---------- toolbar ---------- */
.toolbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; gap: 16px; align-items: center;
    padding: 16px 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    border: 1px solid var(--line);
    background: #fff;
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.chip sup { font-size: 10px; margin-left: 3px; opacity: .6; }
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.search {
    display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid var(--orange);
    padding: 6px 2px;
    width: 260px;
}
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 15px; }

/* ---------- grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 40px 28px;
    padding: 40px 0 80px;
}
.card {
    display: flex; flex-direction: column;
    text-decoration: none;
    opacity: 0;
    transform: translateY(14px);
    animation: rise .55s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card-img {
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img { transform: scale(1.04); }
.card-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); }
.card-img .noimg .icon { width: 48px; height: 48px; stroke-width: 1.2; }
.card-num {
    position: absolute; top: 10px; left: 10px;
    font-family: var(--display); font-weight: 700; font-size: 13px;
    background: var(--sun); color: var(--ink); padding: 3px 8px 1px; border-radius: 100px;
}
.card-cat { margin-top: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.card-title { margin-top: 6px; font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; letter-spacing: -.01em; }
.card-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.price { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--accent); }
.go {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}
.card:hover .go .icon { transform: translate(2px, -2px); }
.go .icon { width: 15px; height: 15px; transition: transform .2s; }

.empty { grid-column: 1 / -1; padding: 80px 0; text-align: center; color: var(--ink-soft); }
.empty h2 { font-family: var(--display); font-size: 32px; color: var(--ink); margin-bottom: 8px; }

footer {
    border-top: 3px solid var(--orange);
    padding: 24px 0 48px;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
    display: flex; justify-content: space-between; gap: 24px;
}

/* ---------- admin ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel h2 { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); font-weight: 600; }
.input {
    border: 1px solid var(--line); background: #fff;
    padding: 11px 13px; border-radius: var(--radius); font-size: 15px; outline: none; width: 100%;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,108,28,.18); }
.row { display: flex; gap: 10px; }
.row > .input { flex: 1; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--ink); color: var(--paper);
    border: 0; border-radius: var(--radius);
    padding: 11px 20px; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: wait; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: 14px; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 16px; }
.note.err { background: #fde5dd; color: #8a2a12; }
.note.ok { background: #e0efe4; color: var(--ok); }
.note.warn { background: #fbf0d2; color: #6b5310; }
.hidden { display: none !important; }

.admin-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 32px 0 80px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 140px 1fr; gap: 20px; }
.preview { aspect-ratio: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; color: var(--line); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.detected-raw { font-size: 13px; color: var(--ink-soft); margin: -8px 0 16px; line-height: 1.4; }

.list { list-style: none; }
.list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list img, .list .ph { width: 56px; height: 56px; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.list .t { font-weight: 600; font-size: 15px; line-height: 1.25; }
.list .c { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.list .actions { display: flex; gap: 6px; }

.login { max-width: 400px; margin: 72px auto; }

@media (max-width: 860px) {
    .admin-layout { grid-template-columns: 1fr; }
    .hero-inner { grid-template-columns: 1fr; }
    .masthead-meta { text-align: left; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search { width: 100%; }
    .tagline, footer { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .preview { max-width: 160px; }
}
.masthead-meta .btn { text-transform: none; letter-spacing: 0; text-decoration: none; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.15); }
.hero-small .hero-inner { padding-top: 24px; padding-bottom: 22px; }
.hero-small .logo-cart { width: 64px; }
.hero-small .brand { font-size: clamp(30px, 4.5vw, 46px); }
#actions { display: flex; gap: 8px; }
