:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #10639e;
  --primary-600: #10639e;
  --accent: #ffb703;
  --ring: rgba(15, 98, 158, 0.25);
  --shadow: 0 10px 30px rgba(15, 98, 158, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.top-bar {
  background: #0b1220;
  color: #e5e7eb;
  font-size: 0.9rem;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
  padding: 0.5rem 1.25rem;
}
.top-brand { font-weight: 600; }
.top-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.top-bar a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.top-bar a:hover { text-decoration: underline; }
.top-cart {
  background: rgba(255,255,255,0.1);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}
.top-login[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.top-account { display: none; }
.top-account.is-visible { display: inline-flex; gap: 0.4rem; align-items: center; }
.auth-message { font-weight: 600; color: var(--muted); }
.admin-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.admin-links .button--ghost {
  color: var(--primary-600);
  border-color: var(--primary-600);
  background: transparent;
}
.admin-links .button--ghost:hover {
  background: rgba(16, 99, 158, 0.08);
}
.admin-form { display: grid; gap: 0.75rem; margin: 1rem 0; }
.admin-list { display: grid; gap: 0.75rem; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.35); background: #fff; }
.category-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0 1.5rem; color: var(--muted); font-weight: 600; }
.category-strip a { background: #fff; border: 1px solid rgba(148, 163, 184, 0.35); padding: 0.35rem 0.75rem; border-radius: 999px; text-decoration: none; color: var(--text); }
.category-strip a:hover { border-color: var(--primary); }
.manual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.section-subhead { margin: 2rem 0 1rem; font-size: 1.35rem; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, #0f5e96 0%, #10639e 60%, #0b4e7d 100%);
}
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}
.logo {
  max-width: 360px;
  width: 90%;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  filter: none;
  opacity: 0.92;
  mix-blend-mode: lighten;
}
.title { font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem); margin: 0.25rem 0 0.5rem; font-weight: 700; }
.tagline { color: #e6f1ff; opacity: 0.95; margin: 0 auto 1.25rem; max-width: 800px; }

.cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; transition: all 0.2s ease;
}
.button--primary { background: #fff; color: var(--primary-600); }
.button--primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,255,255,0.25); }
.button--ghost { color: #fff; border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.08); backdrop-filter: blur(2px); }
.button--ghost:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }
.button--small { padding: 0.45rem 0.9rem; font-size: 0.9rem; }

.nav { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1.25rem 0 0; padding-bottom: 1rem; }
.nav a {
  color: #e6f1ff; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.55rem 0.85rem; border-radius: 999px; transition: background 0.2s ease, color 0.2s ease;
}
.nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sub-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.25rem 0 0;
}
.sub-nav a {
  color: #e6f1ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.sub-nav a:hover { background: rgba(255,255,255,0.18); }

.wave {
  display: block; width: 100%; height: 64px; margin-top: -10px; color: var(--bg);
}

/* Hero tech circuit overlay */
.hero-circuit { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0.28; }
.hero-circuit .trace { stroke: rgba(255,255,255,0.28); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 10; animation: circuitFlow 20s linear infinite; }
.hero-circuit .node { fill: rgba(255,255,255,0.45); }
@keyframes circuitFlow { to { stroke-dashoffset: -240; } }

/* Motion preferences and mobile tuning */
@media (prefers-reduced-motion: reduce) {
  .hero-circuit .trace { animation: none !important; }
}
@media (max-width: 640px) {
  .hero-circuit { opacity: 0.22; }
  .hero-circuit .trace { animation: none; stroke-width: 1.5; }
}

section { padding: 2.5rem 0; }
section h2 { font-size: 1.75rem; margin: 0 0 0.25rem; letter-spacing: 0.2px; }
.container > h2::after, section h2::after { content: ""; display: block; width: 56px; height: 4px; background: var(--accent); border-radius: 999px; margin-top: 8px; }
.lead { color: var(--muted); margin: 0 0 1.5rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.1rem 1rem;
  box-shadow: var(--shadow); border: 1px solid rgba(2, 6, 23, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(15, 98, 158, 0.16); }
.card h3 { margin-top: 0.25rem; margin-bottom: 0.35rem; }
.card p { color: var(--muted); margin: 0; }

/* Store cards */
.product-card { display: flex; flex-direction: column; gap: 0.55rem; }
.grid .product-card { justify-self: center; max-width: 320px; width: 100%; }
.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-link { color: inherit; text-decoration: none; display: block; }
.product-link:hover { text-decoration: underline; }
.product-thumb--placeholder {
  background: linear-gradient(135deg, rgba(16, 99, 158, 0.1), rgba(255, 183, 3, 0.15));
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.product-price { font-weight: 700; color: var(--primary-600); }
.product-actions { margin-top: auto; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; align-items: start; }
.product-media { background: #fff; border-radius: var(--radius); padding: 1.25rem; border: 1px solid rgba(2, 6, 23, 0.08); box-shadow: var(--shadow); }
.product-media img { width: 100%; height: auto; max-height: 520px; object-fit: contain; display: block; }
.product-info { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; border: 1px solid rgba(2, 6, 23, 0.08); box-shadow: var(--shadow); }
.variant-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.variant-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem; border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.35); background: #fff; }
.variant-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.variant-picker { display: grid; gap: 1.25rem; margin-top: 1rem; }
.variant-block { display: grid; gap: 0.5rem; }
.variant-label { font-weight: 700; }
.size-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.size-option {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.size-option.is-active { border-color: var(--primary); color: var(--primary); }
.color-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.color-option {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.color-option.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(16, 99, 158, 0.15); }
.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #94a3b8, #cbd5f5);
  border: 1px solid rgba(15, 23, 42, 0.2);
}
.color-dot.is-light {
  border-color: rgba(15, 23, 42, 0.35);
}
.variant-summary { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
  .product-media img { max-height: 420px; }
}

/* Cart layout */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 1.5rem; }
.cart-items, .cart-summary { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border: 1px solid rgba(2, 6, 23, 0.06); }
.cart-list { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.cart-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem; border-radius: 12px; background: #f8fafc; border: 1px solid rgba(148, 163, 184, 0.25); }
.cart-item__info { display: flex; flex-direction: column; gap: 0.2rem; }
.cart-item__controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cart-qty { border: 1px solid rgba(15, 98, 158, 0.3); background: #fff; border-radius: 6px; width: 32px; height: 32px; cursor: pointer; font-weight: 700; }
.cart-remove { border: none; background: transparent; color: #c2410c; cursor: pointer; font-weight: 600; }
.cart-totals { margin: 1rem 0; display: grid; gap: 0.35rem; }
.cart-totals div { display: flex; justify-content: space-between; font-weight: 600; color: var(--text); }
.cart-total { font-size: 1.1rem; }
.cart-message { margin: 0.75rem 0; font-weight: 600; color: var(--muted); }
.cart-message--error { color: #b91c1c; }
.cart-message--success { color: #166534; }
.shipping-options { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.shipping-option { display: flex; gap: 0.5rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.35); background: #fff; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.form-grid input { margin: 0; }

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
}

/* Card icons */
.card .icon { color: var(--accent); margin-bottom: 0.35rem; }
.card .icon svg { display: block; width: 40px; height: 40px; stroke: currentColor; }

.panel {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(2, 6, 23, 0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

form { margin-top: 0.5rem; }
form input, form textarea {
  width: 100%; padding: 0.75rem 0.9rem; margin: 0.4rem 0 0.85rem; border-radius: 10px;
  border: 1px solid #dbe2ea; background: #fff; color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
form input:focus, form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
form button {
  background: var(--primary); color: #fff; border: none; padding: 0.75rem 1.1rem; cursor: pointer;
  border-radius: 999px; font-weight: 600; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
form button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15, 98, 158, 0.25); }

footer {
  background: #0b1220; color: #e5e7eb; text-align: center; padding: 1.25rem 0; margin-top: 2rem;
}
footer p { margin: 0; }

@media (max-width: 640px) {
  .top-bar .container { padding: 0.5rem 1rem; }
  .top-bar { font-size: 0.85rem; }
  .hero { padding: 3rem 0 2rem; }
  .nav { gap: 0.25rem; }
}
