:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e6e8ec;
  --brand: #1f6feb;
  --brand-dark: #1857c0;
  --accent: #0a7d33;
  --accent-bg: #e7f6ec;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must always win over author display rules
   (e.g. .pay-opt{display:flex}), otherwise hidden elements stay visible. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, 92vw); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: .9rem; letter-spacing: .5px;
}
.brand-name { font-weight: 700; }
.header-cod { font-size: .85rem; color: var(--accent); font-weight: 600; }

/* Product grid */
.product-grid {
  display: grid; gap: 32px; padding: 28px 0 48px;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 860px) { .product-grid { grid-template-columns: 1fr; } }

.gallery { position: sticky; top: 82px; align-self: start; }
.gallery-main {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; aspect-ratio: 1/1; display: grid; place-items: center;
}
.gallery-main img { max-height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb {
  width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px; background: #fff; cursor: pointer; transition: border-color .15s;
}
.thumb.active, .thumb:hover { border-color: var(--brand); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Product info */
.eyebrow { color: var(--brand); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
h1.title { font-size: 1.7rem; margin: 6px 0 4px; line-height: 1.25; }
.subtitle { color: var(--muted); margin: 0 0 16px; }
.price-row { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 6px; }
.price { font-size: 2rem; font-weight: 800; }
.mrp { color: var(--muted); text-decoration: line-through; font-size: 1.05rem; }
.save { color: var(--accent); font-weight: 700; font-size: .9rem; }
.cod-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-bg); color: var(--accent);
  padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .88rem;
  margin: 10px 0 18px;
}
.highlights { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; }
.highlights li { display: flex; gap: 10px; align-items: flex-start; }
.highlights li::before { content: "✓"; color: var(--accent); font-weight: 800; }
.desc { color: #374151; margin: 0 0 22px; }

.qty { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qty label { font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 1.2rem; cursor: pointer; }
.stepper button:hover { background: #f2f4f7; }
.stepper input { width: 46px; height: 40px; border: 0; text-align: center; font-size: 1rem; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Buttons */
.btn {
  border: 0; border-radius: 12px; padding: 14px 20px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .05s; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #9db8e6; cursor: default; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 22px; font-size: 1.05rem; }

/* Cards / checkout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.checkout-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 24px; padding-bottom: 48px; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 82px; align-self: start; }
.link-back { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: .95rem; padding: 18px 0 8px; }

.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-weight: 600; font-size: .9rem; }
input, textarea {
  font-family: inherit; font-size: 1rem; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input.invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-weight: 600; margin: 4px 0 10px; }

.summary h3 { margin-top: 0; }
.sum-line { display: flex; justify-content: space-between; padding: 7px 0; }
.sum-line.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.15rem; }
.sum-prod { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sum-prod img { width: 54px; height: 54px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }

/* Confirmation */
.confirm-card { max-width: 520px; margin: 40px auto; text-align: center; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 14px; }
.order-number { background: #f2f4f7; border-radius: 10px; padding: 12px; margin: 14px 0; font-size: 1.05rem; }
.order-number strong { letter-spacing: 1px; }

/* Skeletons */
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #e3e6ea 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); }
.gallery-skel { aspect-ratio: 1/1; }
.info-skel { min-height: 380px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Payment methods */
.pay-methods { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 6px 0 14px; }
.pay-methods legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; cursor: pointer; }
.pay-opt:hover { background: rgba(31,111,235,.06); }
.pay-opt input { margin-top: 3px; }
.agree { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 14px; }
.agree input { margin-top: 3px; }
.tax-line { margin: -2px 0 8px; }
.wake-note { text-align: center; color: var(--muted); padding: 16px; font-size: .92rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 26px 0; margin-top: 20px; text-align: center; }
.site-footer p { margin: 4px 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 12px; }
.footer-links a { color: var(--brand); text-decoration: none; font-size: .9rem; }
.footer-links a:hover { text-decoration: underline; }
.site-footer a { color: var(--brand); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #16181d; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 50; }

/* Legal / policy pages */
.legal { max-width: 820px; margin: 0 auto; padding: 32px 0 56px; }
.legal h1 { font-size: 1.9rem; margin-bottom: 4px; }
.legal .updated { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal p, .legal li { color: #33373f; }
.legal ul { padding-left: 20px; }
.legal li { margin: 5px 0; }
.legal a { color: var(--brand); }
.legal .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.legal th, .legal td { text-align: left; padding: 9px 12px; border: 1px solid var(--line); font-size: .93rem; }
@media (prefers-color-scheme: dark) { .legal p, .legal li { color: #c6cad2; } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #171a20; --ink: #e8eaed; --muted: #9aa2ad;
    --line: #262b33; --accent-bg: #12331f;
  }
  .stepper button, input, textarea { background: #12151a; color: var(--ink); }
  .stepper input { background: #12151a; }
  .gallery-main, .thumb { background: #fff; }
  .order-number, .sum-line, .toast { }
  .order-number { background: #12151a; }
}
