*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accentFg); font-weight: 500; cursor: pointer; transition: opacity .15s, transform .15s; white-space: nowrap; }
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--fg); opacity: 1; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; background: none; border-radius: 50%; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface); }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: calc(var(--radius) * .7); background: var(--bg); transition: border-color .15s; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--fg); }
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
label.field span.opt { color: var(--muted); font-weight: 400; }

/* header */
.announce { background: var(--accent); color: var(--accentFg); font-size: 13px; padding: 9px 0; letter-spacing: .01em; overflow: hidden; }
.announce .marquee { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.announce .marquee span { white-space: nowrap; padding-right: 48px; }
.announce:hover .marquee { animation-play-state: paused; }
@keyframes marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .announce .marquee { animation: none; } }
.header { position: sticky; top: 0; z-index: 20; background: var(--header, var(--bg)); background: color-mix(in srgb, var(--header, var(--bg)) 92%, transparent); color: var(--headerFg, var(--fg)); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border); }
.header-in { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { font-family: var(--font-heading); font-weight: 700; font-size: 22px; letter-spacing: -0.03em; display: flex; align-items: center; color: var(--headerFg, var(--fg)); }
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a { color: color-mix(in srgb, var(--headerFg, var(--fg)) 60%, transparent); transition: color .15s; }
.nav a:hover, .nav a.active { color: var(--headerFg, var(--fg)); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: var(--surface); border-radius: 999px; color: var(--muted); }
.search input { border: 0; background: none; outline: none; width: 160px; color: var(--fg); }
.cart-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accentFg); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; margin-left: -10px; }
  .header-in { gap: 8px; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--header, var(--bg)); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; }
  .nav a { padding: 12px 0; font-size: 17px; color: var(--headerFg, var(--fg)); }
  .header.open .nav { display: flex; }
  .search input { width: 90px; }
}
@media (max-width: 480px) { .search { display: none; } }

/* layout blocks */
main { min-height: 60vh; padding-bottom: 80px; }
.section { margin-top: 72px; }
.cover { margin: 48px calc(50% - 50vw) 0; width: 100vw; aspect-ratio: 16 / 7; background-size: cover; background-position: center; display: grid; place-items: center; padding: 40px 20px; color: #fff; text-shadow: 0 2px 20px rgb(0 0 0 / .45); position: relative; overflow: hidden; }
.cover::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .45) 0%, rgb(0 0 0 / .15) 35%, rgb(0 0 0 / .15) 65%, rgb(0 0 0 / .55) 100%); }
.cover-text { position: relative; text-align: center; max-width: 720px; display: grid; gap: 16px; justify-items: center; padding: 0 20px; }
.cover-text h2 { font-size: clamp(32px, 5vw, 56px); margin: 0; letter-spacing: -0.02em; font-weight: 700; line-height: 1.1; }
.cover-text p { margin: 0; font-size: clamp(15px, 1.4vw, 18px); opacity: .95; max-width: 560px; }
.cover-text .btn { background: #fff; color: #0a0a0a; border-color: #fff; }
@media (max-width: 640px) { .cover { aspect-ratio: 4 / 5; padding: 24px 16px; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-head a { color: var(--muted); font-size: 15px; }
.section-head a:hover { color: var(--fg); }
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); }
.page-head p { color: var(--muted); max-width: 620px; margin: 12px 0 0; }

/* hero */
.hero { margin-top: 20px; border-radius: calc(var(--radius) * 2); background: var(--surface); overflow: hidden; display: grid; min-height: 460px; }
.hero.has-img { grid-template-columns: 1fr 1fr; }
.hero-text { padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; }
.hero:not(.has-img) .hero-text { align-items: center; text-align: center; }
.hero h1 { font-size: clamp(38px, 6vw, 72px); letter-spacing: -0.035em; max-width: 14ch; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 46ch; }
.hero-img { background-size: cover; background-position: center; min-height: 320px; }
@media (max-width: 760px) { .hero.has-img { grid-template-columns: 1fr; } .hero { min-height: 0; } }

/* categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.cat:hover img { transform: scale(1.04); }
.cat span { position: absolute; left: 12px; bottom: 12px; background: var(--bg); color: var(--fg); padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); font-size: 14px; color: var(--muted); background: var(--bg); cursor: pointer; }
.pill:hover { color: var(--fg); border-color: var(--fg); }
.pill.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px 20px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr 1fr; gap: 28px 12px; } }
.card { display: block; }
.card-img { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s, transform .6s cubic-bezier(.2,.7,.2,1); }
.card-img img + img { opacity: 0; }
.card:hover .card-img img:first-child { transform: scale(1.03); }
.card:hover .card-img img + img { opacity: 1; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-heading); font-size: 42px; color: var(--muted); opacity: .5; }
.badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--bg); color: var(--fg); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge.sale { background: var(--sale); color: #fff; }
.card-body { padding-top: 12px; display: grid; gap: 2px; }
.card-name { font-weight: 500; }
.price { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.price s { color: var(--muted); font-size: .9em; }
.price .now.on-sale { color: var(--sale); }

/* bundles */
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
@media (max-width: 420px) { .bundles { grid-template-columns: 1fr; } }
.bundle { border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.3); padding: 20px; display: grid; gap: 16px; }
.bundle-imgs { display: flex; align-items: center; gap: 8px; }
.bundle-imgs .thumb { width: 84px; height: 84px; border-radius: calc(var(--radius) * .7); overflow: hidden; background: var(--surface); position: relative; flex: none; }
.bundle-imgs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.bundle-imgs .plus { color: var(--muted); }
.bundle h3 { font-size: 20px; }
.bundle-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.save { display: inline-block; font-size: 12px; font-weight: 600; color: var(--sale); background: color-mix(in srgb, var(--sale) 10%, transparent); padding: 3px 10px; border-radius: 999px; }

/* product page */
.product { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 72px); padding-top: 32px; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: 12px; align-content: start; }
.gallery-main { aspect-ratio: 1; border-radius: calc(var(--radius) * 1.3); overflow: hidden; background: var(--surface); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; overflow-x: auto; }
.thumbs button { width: 76px; height: 76px; flex: none; padding: 0; border: 2px solid transparent; border-radius: calc(var(--radius) * .7); overflow: hidden; background: var(--surface); cursor: pointer; }
.thumbs button.on { border-color: var(--fg); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { display: grid; gap: 22px; align-content: start; position: sticky; top: 92px; }
@media (max-width: 860px) { .info { position: static; } }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.info h1 { font-size: clamp(28px, 4vw, 42px); }
.info .price { font-size: 22px; }
.opt { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.opt legend { font-weight: 500; font-size: 14px; padding: 0; margin-bottom: 10px; }
.opt legend small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; gap: 6px; padding: 10px 16px; border: 1px solid var(--border); border-radius: calc(var(--radius) * .7); cursor: pointer; font-size: 14px; transition: border-color .15s; }
.chip span em { font-style: normal; color: var(--muted); }
.chip:hover span { border-color: var(--muted); }
.chip input:checked + span { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.chip input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.buy { display: flex; gap: 12px; }
.buy .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); height: 48px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--muted); }
.qty button:hover { color: var(--fg); }
.qty span, .qty input { width: 32px; text-align: center; border: 0; background: none; font-variant-numeric: tabular-nums; }
.qty.sm { height: 34px; }
.qty.sm button { width: 30px; font-size: 15px; }
.stock-note { font-size: 14px; color: var(--sale); }
.desc { color: var(--muted); white-space: pre-line; border-top: 1px solid var(--border); padding-top: 22px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); z-index: 50; transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; }
body.cart-open .scrim { opacity: 1; pointer-events: auto; }
body.cart-open .drawer { transform: none; box-shadow: -20px 0 60px rgb(0 0 0 / .12); }
body.cart-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.lines { padding: 8px 20px; flex: 1; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.line:last-child { border-bottom: 0; }
.line-img { width: 72px; height: 72px; border-radius: calc(var(--radius) * .6); overflow: hidden; background: var(--surface); position: relative; }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-weight: 500; font-size: 15px; }
.line-meta { font-size: 13px; color: var(--muted); }
.line-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--fg); }
.line-total { font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.summary { padding: 20px; border-top: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.row.discount { color: var(--sale); }
.row.total { font-size: 18px; font-weight: 600; padding-top: 10px; border-top: 1px solid var(--border); }
.notice { font-size: 13px; padding: 10px 12px; border-radius: calc(var(--radius) * .6); background: color-mix(in srgb, var(--sale) 10%, var(--bg)); color: var(--sale); }
.notice.ok { background: var(--surface); color: var(--fg); }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); display: grid; gap: 16px; justify-items: center; }
.empty h3 { color: var(--fg); font-size: 20px; }

/* checkout */
.checkout { display: grid; grid-template-columns: 1fr 420px; gap: 48px; padding-top: 32px; align-items: start; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } .checkout .card-box { order: -1; } }
.checkout form { display: grid; gap: 16px; }
.checkout h2 { font-size: 22px; margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.card-box { border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.3); overflow: hidden; position: sticky; top: 92px; }
.card-box .lines { padding: 4px 20px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { height: 42px; text-transform: uppercase; }

/* order confirmation */
.done { max-width: 620px; margin: 56px auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accentFg); display: grid; place-items: center; }
.done h1 { font-size: clamp(30px, 4vw, 42px); }
.done .card-box { width: 100%; text-align: left; position: static; margin-top: 16px; }

/* content pages */
.prose { max-width: 720px; padding-top: 16px; font-size: 17px; }
.prose p, .prose ul { color: var(--muted); }
.prose a { text-decoration: underline; }
.prose h2 { font-size: 24px; margin: 32px 0 8px; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; font-size: 14px; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer .logo { color: var(--fg); margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer a:hover { color: var(--fg); }
.footer-bottom { margin-top: 40px; font-size: 13px; }

/* misc */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { height: 50vh; display: grid; place-items: center; }
.loading::after { content: ''; width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--fg); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 24px; }
.select { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
