/* === Imports === */
@import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap');

/* === Root Variables === */
:root {
  --bg:#0f0f12;
  --panel:#16181d;
  --muted:#8b94a7;
  --text:#e9edf5;
  --brand:#2ecc71;
  --danger:#ff6b6b;
  --border:#242632;
  --link:#9bc2ff;
}

/* === Fluid type scale + rhythm === */
:root{
  --step--1: clamp(.86rem, .84rem + .2vw, .95rem);
  --step-0:  clamp(1rem,  .98rem + .2vw, 1.06rem);
  --step-1:  clamp(1.13rem,1.08rem + .35vw,1.25rem);
  --step-2:  clamp(1.28rem,1.18rem + .65vw,1.45rem);
  --step-3:  clamp(1.5rem, 1.32rem + 1vw,  1.8rem);
  --step-4:  clamp(1.9rem, 1.6rem  + 1.8vw, 2.4rem);

  --rhythm-1: .25rem;
  --rhythm-2: .5rem;
  --rhythm-3: .75rem;
  --rhythm-4: 1rem;
  --rhythm-5: 1.5rem;
  --rhythm-6: 2rem;
}

body { line-height: 1.6; letter-spacing: .01em; }
h1 { font-size: var(--step-4); line-height: 1.15; margin:.4em 0 .25em; }
h2 { font-size: var(--step-3); line-height: 1.2;  margin:.6em 0 .35em; }
h3 { font-size: var(--step-2); line-height: 1.25; margin:.6em 0 .35em; }
h4 { font-size: var(--step-1); line-height: 1.3;  margin:.6em 0 .35em; }
p { margin: 0 0 var(--rhythm-4); max-width: 70ch; }
small, .small { font-size: var(--step--1); }
.muted { color: var(--muted); opacity:.95; }

/* === Base === */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container.wide { max-width: 1240px; }
.narrow { max-width: 900px; margin: 0 auto; }
.hidden { display: none; }

/* === Accessibility helpers === */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.skip-link{
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  position:static; width:auto; height:auto; padding:.5rem;
  background:#000; color:#fff; border-radius:.25rem;
}

/* === Site Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(180deg,#0f0f12,rgba(15,15,18,.9));
  border-bottom: 1px solid var(--border);
}
.site-header .brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.site-header .brand img{
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

/* Nav (cart forced to far right) */
.site-header .nav {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.nav a {
  margin-left: 20px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.nav .cart-link { margin-left: auto; order: 99; }
.nav a:hover,
.nav a.active,
.nav a[aria-current="page"] {
  background: #1a1d26;
  color: var(--brand);
}

/* Tagline Centering (under main title on home) */
.tagline {
  text-align: center;
  margin: 0.5rem auto;
}

/* Full-width banner wrapper (home hero image) */
.banner { width: 100%; margin: 0; padding: 0; }
.banner img { width: 100%; height: auto; display: block; }

/* --- Maintenance banner + safety styles --- */
.maint-banner{
  background:#d90429;
  color:#fff;
  text-align:center;
  padding:10px 12px;
  font-weight:800;
  border-radius:8px;
  margin-bottom:8px;
  letter-spacing:.4px;
}
.maintenance .btn[data-add],
.maintenance .btn[data-buy],
.maintenance #sb-add,
.maintenance #sb-buy { pointer-events:none; opacity:.5; cursor:not-allowed; }
.maintenance a[href*="checkout.html"]{ pointer-events:none; opacity:.6; }

/* === Buttons === */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #07130a;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
}
.btn.ghost { background: transparent; border: 1px solid var(--brand); color: var(--text); }
.btn.sm { padding: 6px 10px; border-radius: 10px; }
.btn.danger { background: var(--danger); color: #210000; }
.btn:hover { background: #27ae60; }

/* === Cart Remove Button === */
.cart-row { position: relative; }
.remove-btn {
  background: none;
  border: 0;
  color: #fff;
  padding: 0;
  cursor: pointer;
  opacity: .8;
  display: inline-flex;
  align-items: center;
  position: absolute;
  bottom: 8px;
  right: 8px;
}
/* Mobile adjustment for trash icon */
@media (max-width:600px) {
  .cart-row .remove-btn {
    position: static;       /* don’t absolutely position */
    margin-top: 0.5rem;
    justify-content: center;
  }
}

.remove-btn:hover { opacity: 1; }
.remove-btn svg { width: 18px; height: 18px; display: block; }
.remove-btn:hover { opacity: 1; }
.remove-btn .label { font-size: 0.7rem; margin-left: 4px; }

/* === Hero Section (generic) === */
.hero { padding: 28px 20px; border-bottom: 1px solid var(--border); }
.hero h1 { margin: 0 0 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* === Grid / Cards === */
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
@media (max-width:900px){ .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .img { display: block; background: #0d0f14; position: relative; }
.card .ph { height: 170px; background: linear-gradient(135deg,#1c2030,#10131a); }
.card .soldout {
  position: absolute; top: 10px; left: 10px;
  background: var(--danger); color: #111;
  padding: 6px 10px; border-radius: 999px; font-weight: 800;
}
.card .fav {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  border-radius: 999px; padding: 6px; cursor: pointer;
}
.card .fav svg { display: block; width: 20px; height: 20px; fill: #ffffff80; }
.card .fav.active svg { fill: #ff6b6b; }
.card .meta { padding: 14px; }
.card h3 { margin: 10px 0 6px; }
.card p { margin: 0 0 10px; color: var(--muted); }
.sku { font-size: 12px; color: var(--muted); }
.price-row { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 800; }

/* === Misc === */
.notice { padding: 10px 0; color: #cfead7; }

/* === Product Page (gallery + info) === */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width:900px){ .product { grid-template-columns: 1fr; } }

/* Bulletproof gallery layout */
.gallery{
  display: grid !important;
  grid-template-columns: 1fr 92px;
  align-items: start;
  gap: 10px;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  min-height: 320px;
}
.gallery > img{
  grid-column: 1;
  width: 100%;
  height: auto;
  max-height: 420px;
  border-radius: 8px;
}
.gallery .thumbs{
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gallery .thumbs img{
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
/* Phones: thumbs below main image */
@media (max-width: 640px){
  .gallery{ grid-template-columns: 1fr; }
  .gallery .thumbs{
    grid-column: 1;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .gallery .thumbs img{ width: 72px; }
}

.product .info h1 { margin: 0 0 10px; }
.product .price { font-size: 22px; }
.product .buy-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

/* === Tables === */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}
.table .num { text-align: right; }

/* === Forms === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.field { display: flex; flex-direction: column; }
.field.wide { grid-column: 1 / -1; }
label { font-weight: 600; margin-bottom: 6px; color: var(--text); }
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #111;
  color: var(--text);
  font-size: 15px;
}
input::placeholder, textarea::placeholder { color: #999; font-size: 14px; }
textarea { min-height: 140px; resize: vertical; }

/* === Title Strip === */
.site-title-strip { text-align: center; margin: 20px auto; }
.site-title-strip h1 {
  font-size: 3rem; font-weight: 900; margin: 0 0 0.5rem 0;
  font-family: "Black Ops One", system-ui, sans-serif;
  letter-spacing: 2px; text-transform: uppercase;
}
.site-title-strip p { font-size: 1.25rem; margin: 5px 0 0 0; font-weight: 400; }
.site-title-strip .slogan {
  font-family: 'Satisfy', cursive; font-size: 1.3rem; font-style: italic;
  margin-top: 5px; color: #ffffff;
}

/* === Product Detail Page === */
.product-detail { max-width: 900px; margin: 0 auto; padding: 20px; }
.product-detail .product-hero { width: 100%; height: auto; border-radius: 8px; margin: 0 0 16px; }
.product-detail h1 { margin: 8px 0 6px; }
.branch-label {
  font-family: "Black Ops One", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700; letter-spacing: 1px; font-size: 1.05rem; text-transform: uppercase;
  color: var(--link); opacity: 1; display: inline-block; margin: -.25rem 0 .5rem;
}
.product-detail .muted { color: var(--muted); margin-bottom: 14px; }
.product-detail label { display: block; font-weight: 600; margin: 14px 0 6px; }
.product-detail select {
  width: 100%; padding: 10px 12px; background: #0e1013; color: #fff;
  border: 1px solid var(--border); border-radius: 8px;
}
.product-detail .price { font-size: 1.4rem; font-weight: 700; margin: 16px 0 8px; }
.product-detail .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.product-detail .btn.ghost { background: transparent; border: 1px solid var(--brand); }

/* === Product description lists === */
.product-description ul,
.product-description ol { margin: 0.75rem 0 0.5rem 1.25rem; padding: 0; }
.product-description li { margin: 0.25rem 0; line-height: 1.5; }
.product-description strong { font-weight: 600; display: inline-block; margin-bottom: 0.25rem; }

/* === Cart qty controls === */
.qty-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.qty-cell .qty { width: 70px; text-align: center; -moz-appearance: textfield; }
.qty-cell .qty-inc,
.qty-cell .qty-dec {
  padding: 6px 10px; border: 1px solid var(--border);
  background: #0e1013; color: var(--text); border-radius: 8px; line-height: 1;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* === Cart Totals Alignment Fix === */
.cart-summary {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
}
.cart-summary .label { flex: 1; text-align: right; padding-right: 10px; }
.cart-summary .value { font-weight: 600; }

/* === Inventory/stock + image fixes === */
.card .stock-badge{ position:absolute; top:2.2rem; left:.5rem; z-index:2; }
.card.no-title-overlay .img::before{ content:none !important; display:none !important; }
.product-hero{ width:100%; height:auto; display:block; object-fit:cover; }
.card .img::before { content: none !important; display: none !important; }
.card .img img { width:100%; height:auto; display:block; object-fit:cover; }

/* === Coming Soon diagonal ribbon === */
.card.coming-soon { position: relative; overflow: hidden; }
.card.coming-soon::after {
  content: "COMING SOON";
  position: absolute; top: 40px; left: -50px; width: 220px;
  text-align: center; transform: rotate(-45deg);
  background: #ff0000; color: #fff; font-weight: 900;
  font-size: 1rem; padding: 6px 0; z-index: 3; letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Force product titles under images to be white */
.card h3 a { color: #fff !important; font-weight: 900; }

/* Optional low-stock ribbon */
.card.low-stock::after {
  content: attr(data-stock);
  position: absolute;
  top: 12px; left: -45px; width: 160px;
  transform: rotate(-45deg);
  background: #ff0000; color: #fff; font-weight: 900;
  font-size: 0.9rem; text-align: center; padding: 4px 0; z-index: 3;
  letter-spacing: 0.5px; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Stock quantity label */
.card .stock-label { color: #ff4d4d; font-weight: 800; font-size: 0.95rem; }

/* Under-photo quantity badge (in meta) */
.card .meta .stock-badge {
  position: static; display: inline-block; margin: 6px 0 8px;
  padding: 4px 8px; background: #ff0000; color: #fff;
  font-weight: 800; border-radius: 6px; font-size: 0.9rem; line-height: 1;
}
.card .img .stock-badge { display: none !important; }

/* === Lightbox overlay === */
.lightbox{
  position: fixed; inset: 0; display: none; place-items: center;
  background: rgba(0,0,0,.8); z-index: 10000; padding: 16px;
}
.lightbox.open{ display: grid; }
.lightbox img{
  max-width: min(92vw, 1200px); max-height: 92vh;
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.lightbox .ctrl,
.lightbox .close{
  position: absolute; background: rgba(0,0,0,.55); color: #fff;
  border: 1px solid rgba(255,255,255,.25); width: 44px; height: 44px;
  border-radius: 999px; font-size: 28px; line-height: 42px;
  text-align: center; cursor: pointer; user-select: none;
}
.lightbox .prev{ left: 12px;  top: 50%; transform: translateY(-50%); }
.lightbox .next{ right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .close{ right: 12px; top: 12px; font-size: 22px; line-height: 42px; }

/* Hint cursor on the main product image */
.gallery .product-hero{ cursor: zoom-in; }

/* Make entire product card clickable */
.product-card{ position:relative; cursor:pointer; }
.product-card .overlay-link{ position:absolute; inset:0; z-index:5; text-indent:-9999px; overflow:hidden; }
.product-card .actions, .product-card .fav { position:relative; z-index:10; }

/* === Personalization UI (2 lines × 30 chars) === */
.opt-row{margin:.75rem 0}
.check{display:flex;gap:.5rem;align-items:center}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.help{display:block;opacity:.8;margin-top:.25rem}
.inline-hint{font-size:.9rem;opacity:.85;margin-top:.5rem}
.error{color: var(--danger); margin-top:.4rem; font-size:.92rem}
.btn.disabled{opacity:.6;pointer-events:none}
@media (max-width:640px){ .grid2{grid-template-columns:1fr;} }

/* Clamp product card descriptions */
.product-card .meta p{
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}

/* ==== Featured cards (Classic + RM400) ==== */
.featured-wrap { margin: 2rem 0; }
.featured-card{
  display: grid; gap: 1rem; grid-template-columns: 1fr;
  padding: 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(255,255,255,.02); max-width: 1100px; margin: 0 auto; overflow: hidden;
}
@media (min-width: 880px){
  .featured-card{ grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); align-items: start; }
}
.featured-card > .fc-media,
.featured-card > .fc-controls { min-width: 0; }
.fc-media img{
  max-width: 100%; height: auto; border-radius: 6px; display: block;
  transition: opacity .25s ease; opacity: 1;
}
.fc-media img.is-loading{ opacity: 0; }
.fc-controls label{ font-weight: 600; display: block; margin: .5rem 0 .25rem; }
.fc-row{ display: flex; align-items: center; gap: 1rem; margin: .75rem 0; }
.fc-btn{ padding: .75rem 1.25rem; border-radius: 6px; cursor: pointer; }
.fc-note{ opacity: .75; font-size: .9rem; }
.option-row{ margin-bottom: .5rem; }
#classic-box, #rm400-card{ max-width: 1100px; margin: 2rem auto; }

/* ==== RM400 Details & Specs ==== */
.details-wrap { max-width: 1000px; margin: 2rem auto; padding: 1rem; }
.details-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; background: rgba(255,255,255,0.02);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); overflow: hidden;
}
/* Toggle button */
.details-toggle{
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  font-size: 1.25rem; font-weight: 800; padding: 1rem; background: #12141a;
  border: none; cursor: pointer; color: var(--text);
}
.details-toggle svg{ transition: transform .2s ease; }
.details-toggle[aria-expanded="true"] svg{ transform: rotate(180deg); }
/* Body */
.details-body { padding: 1.25rem; border-top: 1px solid var(--border); }
.details-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 880px){ .details-grid { grid-template-columns: 1.15fr 1fr; } }
/* Media */
.details-media img{
  max-width: 100%; border-radius: 8px; display: block; background: #0d0f14; border: 1px solid var(--border);
}
.thumbs-mini { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.thumbs-mini button{
  font-weight: 700; font-size: .85rem; padding: .35rem .5rem; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; background: #0e1013; color: var(--text); cursor: pointer;
}
.thumbs-mini button.active { outline: 2px solid var(--brand); }
/* Info */
.details-info .lede { font-size: 1rem; margin-bottom: 1rem; opacity: .95; }
.details-info h4 { margin: .6rem 0 .35rem; font-size: 1.1rem; }
.bullets { margin: .5rem 0; padding-left: 1.25rem; list-style: disc; }
.bullets li + li { margin-top: .35rem; }
/* Actions */
.details-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.details-actions .btn { flex: 1; }

/* Final override: cart trash icon should be icon-only */
#cartContainer .remove-btn,
.cart-card .remove-btn,
.cart-row .remove-btn{
  background: none !important; border: 0 !important; padding: 0 !important;
  border-radius: 0 !important; box-shadow: none !important;
}
#cartContainer .remove-btn svg { display: block; }

/* === Homepage tagline centering === */
.site-title-strip,
.site-title-strip p,
.site-title-strip .slogan,
.tagline {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* === Full-width banner (image element only) === */
.banner,
.hero-banner,
.full-bleed {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.banner img,
.hero-banner img,
.full-bleed img {
  display: block;
  width: 100%;
  height: auto;
}
/* No background-image on .hero-banner — prevents double layer */
.hero-banner { background: none !important; }