:root {
  --bg: #ffffff; --ink: #14151a; --muted: #6b7280; --line: #ececf1;
  --brand: #4f46e5; --brand-dark: #4338ca; --soft: #f6f6fb; --star: #f5a623;
  --radius: 14px; --shadow: 0 6px 24px rgba(20,21,26,.08);
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }

/* header */
header#site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.88); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.brand span { color: var(--brand); }
.links { display: flex; gap: 22px; margin-left: 8px; }
.links a { color: var(--ink); font-weight: 500; font-size: 15px; opacity: .85; }
.links a:hover { color: var(--brand); opacity: 1; }
.cart-link { position: relative; margin-left: auto; color: var(--ink); display: inline-flex; }
.badge { position: absolute; top: -8px; right: -10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* hero */
.hero { background: linear-gradient(135deg, #eef0ff 0%, #f6f6fb 60%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 64px 0; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); }
.hero p { font-size: 18px; color: var(--muted); max-width: 46ch; }
.hero-img img { border-radius: 20px; box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.pill { display: inline-block; background: #fff; border: 1px solid var(--line); color: var(--brand); font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* sections */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 28px; margin: 0; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .18s; display: block; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #ddd; }
.card-img { position: relative; aspect-ratio: 1/1; background: var(--soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-badge { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.card-badge.best { background: var(--star); }
.card-badge.new { background: var(--brand); }
.card-body { padding: 14px 16px 18px; }
.card-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card-body h3 { font-size: 16px; margin: 4px 0 6px; }
.card-price { font-weight: 700; font-size: 18px; margin-top: 6px; }

/* stars */
.stars-row { letter-spacing: 1px; }
.star { color: #d6d6de; font-size: 14px; }
.star.on { color: var(--star); }
.stars { font-size: 13px; display: flex; align-items: center; gap: 6px; }

/* category chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip.active, .chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* product detail */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 48px 0; }
.pdp-img img { width: 100%; border-radius: 18px; aspect-ratio: 1/1; object-fit: cover; box-shadow: var(--shadow); }
.pdp h1 { font-size: 34px; margin-top: 8px; }
.pdp .price { font-size: 30px; font-weight: 800; margin: 16px 0; }
.pdp .desc { color: #3b3d46; font-size: 16px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 40px; height: 44px; border: none; background: #fff; font-size: 18px; cursor: pointer; }
.qty span { width: 44px; text-align: center; font-weight: 600; }
.pdp-actions { display: flex; gap: 14px; align-items: center; margin: 24px 0; flex-wrap: wrap; }
.feature-list { list-style: none; padding: 0; margin: 20px 0; }
.feature-list li { padding: 8px 0; border-top: 1px solid var(--line); color: #3b3d46; }
.feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 10px; }
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--brand); }

/* cart */
.cart-row { display: grid; grid-template-columns: 88px 1fr auto auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; }
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; padding: 36px 0; }
.summary { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 84px; }
.summary .line { display: flex; justify-content: space-between; padding: 8px 0; }
.summary .total { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.link-x { color: var(--muted); cursor: pointer; font-size: 13px; }
.link-x:hover { color: #e1374b; }
.empty { text-align: center; padding: 80px 20px; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }

/* feature strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 36px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip .item { text-align: center; }
.strip .item b { display: block; font-size: 15px; }
.strip .item span { font-size: 13px; color: var(--muted); }

/* about */
.prose { max-width: 70ch; margin: 0 auto; padding: 48px 0; font-size: 17px; color: #3b3d46; }
.prose h1 { font-size: 40px; }

/* footer */
footer#site-footer { background: var(--soft); border-top: 1px solid var(--line); margin-top: 60px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 50px 0 30px; }
.foot-grid h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.foot-grid a { display: block; padding: 4px 0; color: var(--ink); opacity: .8; font-size: 14px; }
.foot-grid a:hover { color: var(--brand); opacity: 1; }
.subfoot { display: flex; justify-content: space-between; padding: 18px 0 30px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; transition: .3s; z-index: 100; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .grid, .strip { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .pdp, .cart-layout { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .links { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
