/* Red White Mobile - shared foundation for all three homepage directions.
   Palette and behaviour only. Each direction owns its own layout and type. */

:root {
  --rwm-red: #e11d2e;
  --rwm-red-deep: #a2101d;
  --rwm-red-wash: #fff1f2;
  --rwm-black: #16171a;
  --rwm-ink: #26282d;
  --rwm-muted: #6b6f76;
  --rwm-line: #e4e6ea;
  --rwm-paper: #f5f5f7;
  --rwm-white: #ffffff;
  --rwm-good: #0f8a5f;
  --rwm-warn: #b45309;

  --pill: 999px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --sh-1: 0 1px 2px rgba(22, 23, 26, .06);
  --sh-2: 0 6px 20px rgba(22, 23, 26, .08);
  --sh-3: 0 18px 44px rgba(22, 23, 26, .14);
  --sh-red: 0 10px 28px rgba(225, 29, 46, .28);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--rwm-ink);
  background: var(--rwm-white);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

/* height:auto matters: the HTML height attribute is a presentational hint, so
   setting only a CSS width would stretch every render to that attribute. */
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }

/* Prices and stock counts are data. Keep the figures aligned everywhere. */
.tnum { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 3px solid var(--rwm-red);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shared configurator modal + cart drawer ---------- */

.rwm-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(22, 23, 26, .55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.rwm-scrim.open { display: flex; }

.rwm-sheet {
  background: var(--rwm-white);
  border-radius: var(--r-xl);
  width: min(880px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--sh-3);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
}
@media (max-width: 760px) { .rwm-sheet { grid-template-columns: 1fr; } }

.cfg-media {
  background: var(--rwm-paper);
  padding: 32px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  position: relative;
}
.cfg-media img { width: min(210px, 70%); filter: drop-shadow(0 18px 26px rgba(22,23,26,.18)); }
.cfg-flag {
  position: absolute; top: 20px; left: 20px;
  background: var(--rwm-black); color: #fff;
  border-radius: var(--pill);
  padding: 5px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.cfg-flag[data-cond="Used"] { background: var(--rwm-warn); }

.cfg-body { padding: 30px 32px 32px; }
.cfg-title { font-size: 24px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
.cfg-blurb { color: var(--rwm-muted); font-size: 14px; margin: 0 0 22px; }

.cfg-group { margin-bottom: 20px; }
.cfg-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rwm-muted);
  display: block; margin-bottom: 9px;
}
.cfg-opts { display: flex; flex-wrap: wrap; gap: 8px; }

.opt {
  border: 1.5px solid var(--rwm-line);
  border-radius: var(--pill);
  padding: 8px 15px;
  font-size: 13px; font-weight: 600;
  background: #fff;
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.opt:hover { border-color: var(--rwm-black); }
.opt[aria-pressed="true"] {
  background: var(--rwm-black); border-color: var(--rwm-black); color: #fff;
}
.opt .delta { opacity: .65; font-weight: 500; margin-left: 5px; }

.opt-color { display: flex; align-items: center; gap: 8px; }
.opt-color .dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid rgba(22,23,26,.2);
}

.cfg-bundles { display: grid; gap: 8px; }
.bundle {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--rwm-line);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 14px;
  transition: border-color .16s var(--ease);
}
.bundle:has(input:checked) { border-color: var(--rwm-black); background: var(--rwm-paper); }
.bundle input { accent-color: var(--rwm-red); width: 17px; height: 17px; }
.bundle .b-price { margin-left: auto; font-weight: 700; }

.cfg-total {
  border-top: 1.5px solid var(--rwm-line);
  margin-top: 24px; padding-top: 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.cfg-total .cap {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rwm-muted);
}
.cfg-total .amt {
  font-size: 34px; font-weight: 800; color: var(--rwm-red);
  letter-spacing: -.03em; line-height: 1;
}
.cfg-total .was { font-size: 13px; color: var(--rwm-muted); text-decoration: line-through; }

.btn-add {
  background: var(--rwm-red); color: #fff;
  border-radius: var(--pill);
  padding: 14px 26px; font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-red);
  transition: transform .16s var(--ease), background .16s var(--ease);
}
.btn-add:hover { background: var(--rwm-red-deep); transform: translateY(-1px); }

.cfg-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(22,23,26,.08); font-size: 17px; line-height: 1;
  display: grid; place-items: center;
}

/* The cart drawer lives in shop.css. The prototype's version used to sit here
   too and its `width: min(400px,100%)` was still winning over the real rule's
   `inset: 0`, pinning the whole overlay to the left edge. Deleted, not merged. */

/* search results, shared shape */
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: #fff; border: 1px solid var(--rwm-line);
  border-radius: var(--r-md); box-shadow: var(--sh-2);
  overflow: hidden; display: none;
}
.ac-list.open { display: block; }
.ac-item { display: flex; gap: 12px; align-items: center; padding: 11px 15px; width: 100%; text-align: left; }
.ac-item:hover, .ac-item:focus-visible, .ac-item[aria-selected="true"] { background: var(--rwm-paper); }
.ac-item img { width: 34px; }
.ac-item .t { font-size: 14px; font-weight: 600; }
.ac-item .p { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--rwm-red); }
.ac-none { padding: 15px; color: var(--rwm-muted); font-size: 14px; }

/* toast */
.rwm-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--rwm-black); color: #fff;
  padding: 12px 22px; border-radius: var(--pill);
  font-size: 14px; font-weight: 600; z-index: 120;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.rwm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* scroll reveal, opt-in per direction */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* accessories carry an icon, not a photo, so the cart row needs a placeholder */
.cart-noimg { width: 46px; height: 46px; border-radius: 8px; background: var(--rwm-paper); flex: none; }

/* Footer stays at the bottom on short pages (order received, empty cart). */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
