/* =========================
   complexfour — light ecommerce theme (site-wide, defensive)
   Drop-in replacement for style.css
   ========================= */

:root{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;

  /* Warm, approachable palette */
  --bg: #fffaf0;              /* soft warm off-white */
  --surface: #ffffff;
  --surface-2: #fff3d6;       /* pastel warm panel */
  --text: #14171a;
  --muted: #566370;
  --muted-2: #6f7c88;

  --border: rgba(20, 23, 26, .12);
  --border-strong: rgba(20, 23, 26, .18);

  --shadow-sm: 0 6px 18px rgba(20, 23, 26, .06);
  --shadow-md: 0 14px 34px rgba(20, 23, 26, .10);

  --radius: 18px;

  /* Brand accents */
  --brand: #2563eb;           /* clean “buy” blue */
  --brand-ink: #ffffff;
  --brand-soft: rgba(37, 99, 235, .10);

  --accent: #0ea5a4;          /* secondary fresh accent */
  --accent-soft: rgba(14, 165, 164, .10);

  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .12);

  /* Typography scale */
  --h1: clamp(28px, 3.0vw, 40px);
  --h2: clamp(20px, 2.2vw, 28px);
  --h3: 18px;
  --h4: 16px;
  --p: 15px;
}

/* --- Reset / base --- */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(245,158,11,.10), transparent 60%),
              radial-gradient(900px 520px at 80% 0%, rgba(14,165,164,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* IMPORTANT: kill common legacy “dark theme” leftovers */
body, main, header, footer, section, article, nav, aside, dialog,
h1, h2, h3, h4, h5, h6, p, li, dt, dd, small, span, label, a, button, input, select, textarea{
  color: var(--text);
}
p, li{ color: var(--text); }

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-decoration-color: rgba(37,99,235,.45); }

img{ max-width: 100%; height: auto; display: block; }
hr{ border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

:focus-visible{
  outline: 3px solid rgba(37,99,235,.35);
  outline-offset: 2px;
  border-radius: 10px;
}

.container{
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 22px 0;
}

.muted{ color: var(--muted); }
.fineprint{ font-size: 12px; color: var(--muted-2); line-height: 1.45; }

/* --- Typography (works even without your classes) --- */
h1{
  font-size: var(--h1);
  margin: 0 0 10px;
  letter-spacing: -.02em;
  line-height: 1.05;
}
h2{
  font-size: var(--h2);
  margin: 22px 0 10px;
  letter-spacing: -.01em;
  line-height: 1.15;
}
h3{ font-size: var(--h3); margin: 18px 0 8px; }
h4{ font-size: var(--h4); margin: 14px 0 8px; }

p{
  margin: 0 0 12px;
  font-size: var(--p);
  line-height: 1.65;
  color: var(--muted);
}
li{ line-height: 1.65; color: var(--muted); }

/* Make headings + strong text always readable */
h1, h2, h3, h4, h5, h6, strong, b{ color: var(--text); }

/* --- Header / Nav (also styles plain header/nav if classes missing) --- */
.header, header{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 250, 240, .82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.header-inner, header .container, header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-inner{ padding: 10px 0; }

.brandwrap{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo{
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 8px 14px rgba(20,23,26,.10));
}
.brandtext{ display: grid; line-height: 1.1; }
.brandname{ font-weight: 850; letter-spacing: .2px; }
.brandsub{ font-size: 12px; color: var(--muted); }

/* Nav pills, whether you use .nav/.navlink or plain nav a */
.nav, nav{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a, .navlink, nav a{
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.nav a:hover, .navlink:hover, nav a:hover{
  border-color: var(--border);
  background: rgba(255,255,255,.75);
  transform: translateY(-1px);
  text-decoration: none;
}
.navlink.active, nav a[aria-current="page"], nav a.active{
  border-color: rgba(37,99,235,.20);
  background: var(--brand-soft);
  color: var(--text);
}

/* --- Controls / form elements --- */
.actions{
  display: flex;
  gap: 10px;
  align-items: center;
}
select, .select, input, textarea{
  background: rgba(255,255,255,.90);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  font: inherit;
}
select, .select{ border-radius: 999px; }

/* --- Sections / panels / common content wrappers --- */
.section{ padding: 10px 0; }
.section-head{ display: grid; gap: 4px; margin-bottom: 10px; }

.panel, .notice, .card, .product-media, .product-info,
main > section, main > article{
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* “panel” style (good for content pages too) */
.panel, main > article, main > section{
  background: linear-gradient(180deg, rgba(255,243,214,.65), rgba(255,255,255,.90));
  padding: 16px;
  box-shadow: var(--shadow-md);
}

/* Grid */
.grid{
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Cards */
.card{
  background: rgba(255,255,255,.90);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card p{ color: var(--muted); }

/* Badges / price */
.price{ font-weight: 850; margin-bottom: 12px; letter-spacing: .2px; color: var(--text); }
.badge{
  display: inline-block;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(14,165,164,.22);
  color: rgba(7, 88, 87, .95);
  margin-bottom: 10px;
}

/* --- Buttons: supports .button, <button>, and “link buttons” --- */
.button, button, a.button{
  border: 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-ink);
  cursor: pointer;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 22px rgba(37,99,235,.20);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.button:hover, button:hover, a.button:hover{
  transform: translateY(-1px);
  filter: brightness(.98);
  box-shadow: 0 16px 30px rgba(37,99,235,.24);
  text-decoration: none;
}
.button.secondary, button.secondary, .secondary.button, a.button.secondary{
  background: rgba(255,255,255,.92);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.button.secondary:hover, button.secondary:hover, a.button.secondary:hover{
  box-shadow: var(--shadow-md);
}
.button:disabled, button:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* --- Dialog / Cart --- */
.dialog, dialog{
  width: min(720px, 92vw);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  color: var(--text);
  padding: 16px;
  box-shadow: var(--shadow-md);
}
.dialog::backdrop, dialog::backdrop{ background: rgba(20, 23, 26, .55); }

.dialog-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-items{ margin: 12px 0; display: grid; gap: 10px; }

.cart-row{
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.90);
}
.qty{ display: inline-flex; gap: 8px; align-items: center; }
.row{ display: flex; justify-content: space-between; margin: 10px 0; }

/* --- Prose pages --- */
.prose{ padding-top: 18px; }
.prose p, .prose li{ color: var(--muted); }
.prose .muted{ color: var(--muted); }

/* --- Product detail --- */
.product-detail{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 860px){
  .product-detail{ grid-template-columns: 1fr; }
}

.product-media{
  background: linear-gradient(180deg, rgba(255,243,214,.55), rgba(255,255,255,.92));
  padding: 16px;
  min-height: 260px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.product-media .placeholder{ color: var(--muted); text-align: center; }

.product-info{
  background: rgba(255,255,255,.92);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Lists (checklist/specs) */
.checklist, .specs{ margin: 10px 0 0; padding-left: 18px; }
.checklist li, .specs li{ margin: 6px 0; color: var(--text); }

/* --- Footer --- */
.footer, footer{
  border-top: 1px solid var(--border);
  margin-top: 22px;
}
.footer-inner, footer .container, footer{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
}
.footer-links{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-links a, footer a{ color: var(--muted); }
.footer-links a:hover, footer a:hover{ color: var(--text); text-decoration: underline; }

/* --- Small-screen niceties --- */
@media (max-width: 860px){
  .header-inner{ flex-wrap: wrap; }
  .actions{ width: 100%; justify-content: space-between; }
  .nav, nav{ width: 100%; }
}
