* { box-sizing: border-box }
html, body { height: 100% }
:root {
  --bg: #f7f9f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --primary: #10b981;
  --primary-600: #059669;
  --ring: rgba(16,185,129,.35);
  --shadow: 0 10px 30px rgba(2, 6, 23, .08);
  --gradient: linear-gradient(45deg, #dcfce7, #a7f3d0, #6ee7b7, #34d399);
}
html[data-theme="dark"] {
  --bg: #0b1220;
  --card: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --primary: #34d399;
  --primary-600: #10b981;
  --ring: rgba(52,211,153,.25);
  --shadow: 0 12px 30px rgba(0, 0, 0, .35);
  --gradient: linear-gradient(45deg, #042f2e, #05423e, #059669, #34d399);
}
html { scroll-behavior: smooth }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block }
a { color: inherit; text-decoration: none }
.container { width: min(1200px, 92%); margin: 0 auto }

.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(16px); background: color-mix(in oklab, var(--bg), transparent 15%); border-bottom: 1px solid var(--border); transition: background .2s; }
.nav { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 0 }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px }
.brand .logo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow) }
.search { position: relative; display: flex; align-items: center }
.search input { width: 100%; padding: 12px 40px 12px 14px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; outline: none; transition: box-shadow .2s, border-color .2s }
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring) }
.search .icon-btn { position: absolute; right: 6px }
.actions { display: inline-flex; align-items: center; gap: 8px }

.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); color: var(--text); transition: transform .06s ease, background .2s, border-color .2s; cursor: pointer }
.icon-btn:active { transform: scale(.98) }
.badge { position: relative }
.icon-btn img { width: 20px; height: 20px; display: block }
.badge span { position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: white; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 1px solid color-mix(in oklab, var(--primary), black 20%) }
.badge span.bump { animation: bump .3s ease }
@keyframes bump { 0% { transform: scale(1) } 30% { transform: scale(1.2) } 100% { transform: scale(1) } }

.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: 12px; background: var(--gradient); color: var(--bg); font-weight: 600; border: 1px solid color-mix(in oklab, var(--primary), black 10%); box-shadow: 0 8px 18px color-mix(in oklab, var(--primary), transparent 80%); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; background-size: 200% 100%; animation: bg-pan 4s linear infinite; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px color-mix(in oklab, var(--primary), transparent 70%); }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 12px; background: transparent; color: var(--text); border: 1px solid var(--border) }
.block { width: 100% }

.hero { padding: 56px 0 }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center }
.hero-text h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.04; margin: 0 0 10px; opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .8s ease }
.hero-text p { margin: 0 0 18px; color: var(--muted); opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .8s ease }
.hero-text.fade-in h1, .hero-text.fade-in p { opacity: 1; transform: translateY(0) }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap }
.hero-art { position: relative; height: 320px; border-radius: 24px; background: radial-gradient(120px 140px at 20% 30%, #22c55e 0%, transparent 50%), radial-gradient(180px 200px at 80% 20%, #86efac 0%, transparent 60%), radial-gradient(240px 260px at 60% 80%, #34d399 0%, transparent 60%); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden }
.hero-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 400px at 60% 20%, color-mix(in oklab, var(--bg), transparent 50%), transparent 60%) }
.slider { position: relative; height: 320px; border-radius: 24px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--gradient); background-size: 200% 200%; animation: bg-pan 10s linear infinite; }
.slider .slide { position: absolute; inset: 0; opacity: 0; transform: scale(1.03); transition: opacity .6s ease, transform .8s ease }
.slider .slide.is-active { opacity: 1; transform: scale(1) }
.slider img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease }
.slider img:hover { transform: scale(1.05) }
.slider-controls { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px; pointer-events: none }
.slider-nav { pointer-events: auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text); opacity: .9 }
.slider-dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px }
.slider-dots button { width: 8px; height: 8px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in oklab, var(--card), transparent 10%); cursor: pointer; padding: 0 }
.slider-dots button.active { background: var(--primary); border-color: color-mix(in oklab, var(--primary), black 10%) }

.controls { padding: 10px 0 6px; position: sticky; top: 64px; z-index: 40; backdrop-filter: saturate(180%) blur(16px); background: color-mix(in oklab, var(--bg), transparent 15%); border-bottom: 1px solid var(--border); transition: background .2s; }
.controls-inner { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0 }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chip { padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--text); cursor: pointer; user-select: none }
.chip.active { background: color-mix(in oklab, var(--primary), white 70%); border-color: var(--primary); color: color-mix(in oklab, var(--primary), black 25%) }
.sort { display: inline-flex; align-items: center; gap: 8px }
.sort select { height: 40px; padding: 0 12px; border-radius: 10px; background: var(--card); color: var(--text); border: 1px solid var(--border) }

.products { padding: 26px 0 60px }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px color-mix(in oklab, var(--primary), transparent 85%); }
.card.reveal { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); transition: transform .5s ease, opacity .5s ease, filter .5s ease }
.card.reveal.show { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) }
.thumb { position: relative; width: 100%; height: 200px; overflow: hidden; background: color-mix(in oklab, var(--bg), transparent 25%) }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease }
.thumb:hover img { transform: scale(1.04) }
.badge-pill { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: 999px; background: rgba(16,185,129,.9); color: white; font-size: 12px; font-weight: 700; border: 1px solid color-mix(in oklab, var(--primary), black 10%) }
.card-body { display: grid; gap: 8px; padding: 12px 12px 14px }
.title { font-weight: 600 }
.meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted) }
.price { font-weight: 700; color: var(--text) }
.rating { display: inline-flex; align-items: center; gap: 4px }
.rating svg { color: #fbbf24 }
.card-actions { display: flex; gap: 8px }
@media (hover: hover) {
  .card-actions { transform: translateY(100%); transition: transform .2s ease; opacity: 0; transition: opacity .2s, transform .2s; }
  .card:hover .card-actions { transform: translateY(0); opacity: 1; }
}
.add-btn { flex: 1; height: 40px; border-radius: 10px; background: var(--text); color: var(--bg); border: 1px solid color-mix(in oklab, var(--text), black 8%); cursor: pointer }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); opacity: 0; visibility: hidden; transition: .2s; z-index: 60 }
.overlay.show { opacity: 1; visibility: visible }
.drawer { position: fixed; right: 0; top: 0; height: 100%; width: min(92vw, 380px); background: var(--card); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .2s ease; z-index: 70; display: grid; grid-template-rows: auto 1fr auto }
.drawer.open { transform: translateX(0) }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--border) }
.cart-items { overflow: auto; padding: 12px }
.cart-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); align-items: center }
.cart-row + .cart-row { margin-top: 10px }
.cart-thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: color-mix(in oklab, var(--bg), transparent 25%) }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover }
.cart-info { display: grid; gap: 6px }
.cart-name { font-weight: 600 }
.cart-price { color: var(--muted) }
.qty { display: inline-flex; align-items: center; gap: 8px }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); cursor: pointer }
.remove { background: transparent; border: none; color: var(--muted); cursor: pointer }
.drawer-footer { border-top: 1px solid var(--border); padding: 14px; display: grid; gap: 12px }
.totals { display: grid; gap: 6px }
.totals .row { display: flex; align-items: center; justify-content: space-between }
.totals .grand { font-weight: 700 }

.site-footer { border-top: 1px solid var(--border); padding: 16px 0; background: color-mix(in oklab, var(--bg), transparent 6%) }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.f-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700 }
.footer-actions { display: inline-flex; align-items: center; gap: 10px }
.social-links { display: flex; gap: 8px }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px); background: var(--text); color: var(--bg); border: 1px solid color-mix(in oklab, var(--text), black 10%); border-radius: 12px; padding: 10px 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90 }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) }

.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 0 }
.auth-card { width: min(420px, 92%); background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 18px }
.auth-tabs { display: flex; gap: 8px; padding: 6px; background: color-mix(in oklab, var(--bg), transparent 20%); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px }
.auth-tab { flex: 1; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer }
.auth-tab.active { background: var(--card); border-color: var(--border) }
.auth-form { display: grid; gap: 12px }
.auth-form .f { display: grid; gap: 6px }
.auth-form label { font-size: 14px; color: var(--muted) }
.auth-form input { height: 44px; padding: 0 12px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--border); outline: none; transition: box-shadow .2s, border-color .2s }
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring) }
.auth-form textarea { min-height: 120px; padding: 10px 12px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--border); outline: none; transition: box-shadow .2s, border-color .2s }
.auth-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring) }
.auth-form select { height: 44px; padding: 0 12px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--border); outline: none; transition: box-shadow .2s, border-color .2s }
.auth-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring) }
.auth-error { color: #ef4444; min-height: 18px; font-size: 13px }
.auth-note { font-size: 14px; color: var(--muted); text-align: center }
.auth-note a { color: var(--primary) }
.hidden { display: none !important }

@keyframes bg-pan { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr; grid-template-rows: auto auto }
  .actions { grid-column: 2 }
  .hero-inner { grid-template-columns: 1fr }
  .controls { top: 102px }
}
