:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15151a;
  background: #f5f4ef;
  color-scheme: light;
  --surface: #ffffff;
  --surface-soft: #eeece4;
  --text: #15151a;
  --muted: #68686f;
  --line: #d9d7cf;
  --accent: #6d4aff;
  --accent-ink: #ffffff;
  --shadow: 0 20px 60px rgba(31, 26, 45, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #19191f;
  --surface-soft: #23232b;
  --text: #f8f7f2;
  --muted: #aaa8b2;
  --line: #34343e;
  --accent: #a18cff;
  --accent-ink: #131218;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  background: #111116;
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: #f5f4ef; transition: background 160ms ease; }
html[data-theme="dark"] { background: #111116; }
body { margin: 0; min-height: 100vh; background: inherit; color: var(--text); transition: color 160ms ease, background 160ms ease; }
button, a { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.03em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: 14px; }
.actions { display: flex; gap: 10px; }
.icon-button, .cart-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 12px; }

main { max-width: 1180px; margin: 0 auto; padding: 48px 28px 80px; }
.hero { padding: 64px 0 72px; max-width: 900px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: .18em; font-weight: 800; color: var(--accent); }
h1 { margin: 0; font-size: clamp(52px, 9vw, 112px); line-height: .89; letter-spacing: -.075em; font-weight: 850; }
h1 span { color: var(--accent); }
.hero-copy { max-width: 690px; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.5; color: var(--muted); margin: 30px 0 0; }
.promise-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.promise-strip span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; font-size: 13px; font-weight: 700; }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
h2 { font-size: clamp(32px, 4vw, 52px); margin: 0; letter-spacing: -.05em; }
.status-pill { border-radius: 999px; padding: 9px 13px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-size: 12px; font-weight: 800; }
.catalog-search { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 24px; }
.catalog-search #clear-search[hidden] { display: none; }
.catalog-search label { font-size: 14px; font-weight: 800; }
.catalog-search input { min-height: 46px; flex: 1 1 260px; max-width: 460px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.catalog-search p { margin: 0; color: var(--muted); font-size: 13px; }
.catalog-search input:focus-visible, .catalog-search select:focus-visible, .catalog-search button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.catalog-search select { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 16px; box-shadow: var(--shadow); }
.favorite-toggle { position: absolute; top: 26px; right: 26px; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 23px; line-height: 1; cursor: pointer; }
.favorite-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.favorite-toggle:focus-visible, #favorites-filter:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.product-art { height: 260px; display: grid; place-items: center; border-radius: 18px; font-size: 96px; font-weight: 100; }
.art-one { background: linear-gradient(145deg, #d9ff90, #8de0c3); color: #143f34; }
.art-two { background: linear-gradient(145deg, #ffd89a, #ff9aa2); color: #713f3e; }
.art-three { background: linear-gradient(145deg, #cfc4ff, #7c9bff); color: #252a62; }
.product-meta { display: flex; justify-content: space-between; gap: 20px; padding: 18px 4px 16px; }
.product-meta h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.product-meta p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.product-meta strong { white-space: nowrap; }
.add-to-cart { width: 100%; min-height: 46px; border: 0; border-radius: 14px; background: var(--text); color: var(--surface); font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: 160ms ease; box-shadow: var(--shadow); }
.toast[aria-hidden="false"] { opacity: 1; transform: translate(-50%, 0); }
footer { max-width: 1180px; margin: 0 auto; padding: 24px 28px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .topbar { padding: 16px 18px; }
  .brand span:last-child { display: none; }
  .icon-button, .cart-button { padding: 9px 11px; }
  main { padding: 30px 18px 60px; }
  .hero { padding: 44px 0 56px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-art { height: 210px; }
  .section-heading { align-items: start; gap: 20px; }
  .status-pill { margin-top: 5px; }
  footer { margin: 0 18px; padding-left: 0; padding-right: 0; }
}
.order-section { margin-top: 72px; }
.muted { color: var(--muted); line-height: 1.6; }
#orders { display: grid; gap: 12px; margin-top: 24px; }
.order-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--surface); }
.order-card h3 { margin: 0 0 8px; }
.order-card small { color: var(--muted); }
dialog { width: min(560px, calc(100% - 32px)); max-height: 85vh; overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 24px; color: var(--text); background: var(--surface); box-shadow: 0 24px 100px #0005; }
dialog::backdrop { background: #1119; backdrop-filter: blur(5px); }
dialog h2 { font-size: 34px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-total { display: flex; justify-content: space-between; padding: 24px 0 8px; font-size: 22px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media (max-width: 600px) { dialog { padding: 20px; } .order-section .section-heading { align-items: start; gap: 12px; flex-direction: column; } }

.cart-item-summary { display: grid; gap: 6px; }
.quantity-controls { display: flex; align-items: center; gap: 8px; }
.quantity-controls .icon-button { min-width: 44px; min-height: 44px; justify-content: center; }
.quantity-value { min-width: 88px; text-align: center; font-weight: 700; }
@media (max-width: 600px) {
  .cart-row { align-items: stretch; flex-direction: column; gap: 12px; }
  .quantity-controls { justify-content: space-between; }
  .cart-row > .icon-button { justify-content: center; min-height: 44px; }
}
