:root {
    --crimson-700: #8A141A; --crimson-600: #AC1B22; --crimson-50: #FBECEC;
    --saffron-500: #F0AC2D; --saffron-100: #FDF1D6;
    --charcoal-800: #363435; --charcoal-500: #7A7576;
    --cream-50: #FBF8F4; --white: #fff; --border: #E6DFD6;
    --success: #2E7D4F; --success-50: #E6F3EB;
    --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--cream-50); color: var(--charcoal-800); font: 400 16px/1.5 var(--font-body); }
h1, h2 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0; }
a { color: var(--crimson-600); }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.muted { color: var(--charcoal-500); }
.small { font-size: .82rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: 0 1px 8px rgba(54,52,53,.05); }
.top__row { display: flex; align-items: center; gap: 12px 20px; padding-block: 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--crimson-600); font: 700 1.15rem var(--font-head); }
.logo img { display: block; }
.search { flex: 1 1 260px; display: flex; min-width: 0; border: 1.5px solid var(--border); border-radius: 999px; background: var(--cream-50); overflow: hidden; }
.search:focus-within { border-color: var(--crimson-600); background: var(--white); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 16px; font: inherit; outline: none; }
.search button { border: 0; background: transparent; padding: 0 16px; color: var(--crimson-600); cursor: pointer; }
@media (max-width: 540px) { .logo span { display: none; } .logo { flex: none; } .top__row { flex-wrap: nowrap; } }

.main { padding-block: 20px 40px; flex: 1 0 auto; width: 100%; }

/* hero + chips */
.hero { background: linear-gradient(135deg, var(--crimson-600), var(--crimson-700)); color: #fff; border-radius: var(--radius); padding: 26px 22px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(1.35rem, 4.5vw, 2rem); }
.hero p { margin: 8px 0 0; max-width: 46ch; opacity: .92; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--white); color: var(--charcoal-800); text-decoration: none; font-weight: 500; font-size: .92rem; }
.chip.is-on { background: var(--charcoal-800); border-color: var(--charcoal-800); color: #fff; }
.found { margin: 0 0 14px; }

/* product grid */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .grid--small { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; height: 100%; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.card:hover, .card:focus-visible { box-shadow: 0 6px 22px rgba(54,52,53,.12); transform: translateY(-2px); outline: none; }
.card__img { display: grid; place-items: center; aspect-ratio: 1; background: var(--saffron-100); }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.ph { width: 64px !important; height: 64px !important; object-fit: contain !important; opacity: .55; }
.card__body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; align-items: flex-start; }
.card__name { font: 600 1rem var(--font-head); }
.card__price { margin-top: 6px; font: 600 1.05rem var(--font-head); color: var(--crimson-600); }
.card.is-out .card__img img:not(.ph) { filter: grayscale(1); opacity: .6; }

.stock { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; margin-top: 6px; }
.stock--in { background: var(--success-50); color: var(--success); }
.stock--low { background: var(--saffron-100); color: #7A4B00; }
.stock--out { background: #EEE9E3; color: #6b6560; }

/* product page */
.crumbs { font-size: .9rem; margin-bottom: 14px; color: var(--charcoal-500); }
.pdp { display: grid; gap: 22px; }
@media (min-width: 820px) { .pdp { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; } }
.pdp__img { display: grid; place-items: center; aspect-ratio: 1; background: var(--saffron-100); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.pdp__img img { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.pdp .muted { margin: 6px 0 0; }
.sub { font-size: 1.05rem; margin: 22px 0 10px; }
.sub--gap { margin-top: 34px; }
.packs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pack { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; }
.pack div:first-child { display: grid; gap: 2px; }
.pack__r { display: grid; gap: 2px; justify-items: end; text-align: right; }
.pack__price { font: 600 1.1rem var(--font-head); color: var(--crimson-600); }
.pack .stock { margin-top: 0; }
.pack.is-out strong, .pack.is-out .pack__price { color: var(--charcoal-500); }
.note { margin: 14px 0 0; font-size: .88rem; color: var(--charcoal-500); }

.btn { display: inline-block; padding: 11px 22px; border-radius: 999px; background: var(--crimson-600); color: #fff; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: var(--crimson-700); }
.empty { text-align: center; padding: 56px 16px; display: grid; gap: 12px; justify-items: center; }

.foot { background: var(--charcoal-800); color: #e9e4de; padding-block: 28px; }
.foot a { color: var(--saffron-500); }
.foot .muted { color: #b7b0a8; }
.foot__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* header cart */
.cartlink { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--charcoal-800); flex: none; }
.cartlink:hover { background: var(--cream-50); }
.cartlink em { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--crimson-600); color: #fff; font: 600 .72rem/20px var(--font-body); text-align: center; font-style: normal; }
.flash { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash--success { background: var(--success-50); color: var(--success); }
.flash--error { background: var(--crimson-50); color: var(--crimson-700); }
.flash--info { background: var(--saffron-100); color: #7A4B00; }
.page-title { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 16px; }

/* quantity controls */
.pack { flex-direction: column; align-items: stretch; }
.pack__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pack__top > div:first-child { display: grid; gap: 2px; }
.qtyrow { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; }
.qty { display: grid; gap: 4px; font-size: .8rem; color: var(--charcoal-500); font-weight: 500; }
.stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; border: 0; background: var(--cream-50); font: 600 1.2rem var(--font-body); color: var(--charcoal-800); cursor: pointer; }
.stepper button:hover { background: var(--saffron-100); }
.stepper input { width: 64px; border: 0; text-align: center; font: 600 1rem var(--font-body); padding: 9px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--crimson-600); }
.btn--block { display: block; width: 100%; text-align: center; padding: 14px 22px; margin-top: 16px; }
.btn--ghost { background: #fff; color: var(--charcoal-800); border: 1.5px solid var(--border); }
.btn--ghost:hover { background: var(--cream-50); }
.btn--off { background: #d9d3cc; color: #fff; pointer-events: none; }
.link { border: 0; background: none; color: var(--crimson-600); cursor: pointer; font: inherit; font-size: .85rem; text-decoration: underline; padding: 0; }

/* cart */
.cart { display: grid; gap: 18px; }
@media (min-width: 860px) { .cart { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.line__img { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--saffron-100); display: grid; place-items: center; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__img img.ph { width: 40px !important; height: 40px !important; }
.line__main { display: grid; gap: 2px; min-width: 0; }
.line__name { font: 600 1rem var(--font-head); color: var(--charcoal-800); text-decoration: none; }
.line__r { display: grid; gap: 6px; align-content: space-between; justify-items: end; }
@media (max-width: 520px) { .line { grid-template-columns: 56px minmax(0, 1fr); } .line__img { width: 56px; height: 56px; } .line__r { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; } }
.summary, .ordersum { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
@media (min-width: 860px) { .summary { position: sticky; top: 84px; } }
.summary__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary__total { font: 700 1.4rem var(--font-head); color: var(--crimson-600); }
.summary__btns { display: grid; gap: 10px; }
.summary .btn, .summary__btns .btn { text-align: center; }

/* checkout */
.checkout { display: grid; gap: 22px; }
@media (min-width: 860px) { .checkout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .checkout .ordersum { position: sticky; top: 84px; } }
.form { display: grid; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; background: #fff; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--crimson-600); box-shadow: 0 0 0 3px rgba(172,27,34,.12); }
.field small { color: var(--charcoal-500); font-size: .82rem; }
.has-err input, .has-err textarea { border-color: var(--crimson-600); }
.err { color: var(--crimson-700); font-size: .85rem; font-weight: 500; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.ordersum h2 { font-size: 1.05rem; }
.ordersum ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ordersum li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ordersum--plain { text-align: left; max-width: 460px; margin: 18px auto; }

/* done */
.done { text-align: center; max-width: 560px; margin: 10px auto; display: grid; gap: 10px; justify-items: center; }
.done__tick { width: 64px; height: 64px; border-radius: 50%; background: var(--success-50); color: var(--success); display: grid; place-items: center; font-size: 2rem; font-weight: 700; }
.done h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
.done p { margin: 0; }
