/* ================================================================
   RC Powerclean — Redesign System
   Two themes via [data-theme]: "industrial" (default) + "editorial"
   Typography: Galano Grotesque (brand font, OTF files from repo)
   + Inter fallback for UI text. Monospace for specs/labels.
   ================================================================ */

@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUEREGULAR.OTF") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUEMEDIUM.OTF") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUEBOLD.OTF") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUEEXTRABOLD.OTF") format("opentype");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUEHEAVY.OTF") format("opentype");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Galano";
  src: url("public/fonts/GALANOGROTESQUELIGHT.OTF") format("opentype");
  font-weight: 300; font-style: normal; font-display: swap;
}

:root {
  /* Brand anchors */
  --brand-red: #B30F0D;
  --brand-red-deep: #B1040F;
  --brand-navy: #0A1A2F;
  --brand-navy-deep: #05111F;

  /* Industrial theme (default) — warm-neutral, steel-heavy */
  --bg: #F6F5F2;
  --bg-2: #EFEDE8;
  --surface: #FFFFFF;
  --ink: #0B1220;
  --ink-2: #2B3240;
  --ink-3: #5A6170;
  --ink-4: #8A909B;
  --line: #E3E1DB;
  --line-2: #D6D3CC;
  --accent: var(--brand-red);
  --accent-ink: #FFFFFF;
  --hi: #F2C94C;   /* caution yellow — industrial signal */

  /* Type */
  --font-sans: "Galano", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Galano", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --container: 1320px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(10,26,47,0.04), 0 2px 8px rgba(10,26,47,0.04);
  --shadow-2: 0 4px 16px rgba(10,26,47,0.08);
  --shadow-3: 0 20px 48px rgba(10,26,47,0.16);
}

[data-theme="editorial"] {
  --bg: #FAFAF7;
  --bg-2: #F1EFE8;
  --surface: #FFFFFF;
  --ink: #111111;
  --ink-2: #1F1F1F;
  --ink-3: #5C5C5C;
  --ink-4: #8A8A8A;
  --line: #E6E4DD;
  --line-2: #D2CFC5;
  --accent: #C8371D;   /* warmer, more editorial red */
  --accent-ink: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.5;
  overflow-x: clip;
  max-width: 100vw;
  overscroll-behavior-x: none;
}

/* Mobile: lock horizontal pan/swipe entirely (vertical scroll only) */
@media (max-width: 1024px) {
  html, body { touch-action: pan-y; }
  body { position: relative; }
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Utility */
.mono { font-family: var(--font-sans); font-feature-settings: "zero"; letter-spacing: -0.01em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.red { color: var(--accent); }
.eyebrow .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); margin-right: 8px; vertical-align: 2px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: #a00e0c; color: var(--accent-ink); }
.btn-primary:hover { background: #c9110e; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-outline-white { color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.btn-outline-white:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.6); }
.btn-lg { padding: 15px 26px; font-size: 15px; }

/* Add-to-cart click feedback: zoom in pulse */
@keyframes addToCartZoom {
  0%   { transform: scale(0.7); box-shadow: 0 0 0 0 rgba(160,14,12,0.45); }
  40%  { transform: scale(1.22); box-shadow: 0 0 0 14px rgba(160,14,12,0.18); }
  70%  { transform: scale(0.96); box-shadow: 0 0 0 22px rgba(160,14,12,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(160,14,12,0); }
}
.btn-add-zoom {
  animation: addToCartZoom .9s cubic-bezier(.34, 1.56, .64, 1) both;
  transition: none !important;
  transform-origin: center;
  will-change: transform;
}

/* PDP desktop: zoom-in al pasar el mouse por "Agregar al carrito" */
.pdp-add-btn {
  transition: transform .18s ease;
  transform-origin: center;
}
@media (hover: hover) and (pointer: fine) {
  .pdp-add-btn:hover { transform: scale(1.04); }
}

/* Tarjetas de categoría (catálogo desktop) */
.cat-tile { transition: transform .2s ease, box-shadow .2s ease; }
.cat-tile img { transition: transform .35s ease; }
@media (hover: hover) and (pointer: fine) {
  .cat-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(11, 18, 32, 0.14); }
  .cat-tile:hover img { transform: scale(1.06); }
}

/* Carrito a ancho total en mobile */
@media (max-width: 768px) {
  .cart-drawer-panel { width: 100% !important; }
}

/* PDP mobile: flechas de galería sin círculo blanco — solo la flecha */
@media (max-width: 768px) {
  .pdp-gallery-arrow {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 44px !important;
    height: 44px !important;
  }
  .pdp-gallery-arrow svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  }
  /* Lightbox (zoom fullscreen): solo la flecha, blanca sobre el fondo oscuro */
  .pdp-lightbox-arrow {
    background: transparent !important;
    box-shadow: none !important;
    color: #fff !important;
    width: 48px !important;
    height: 48px !important;
  }
  .pdp-lightbox-arrow svg {
    width: 34px;
    height: 34px;
    stroke-width: 2.2;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  }
}

/* Icons */
.ic { width: 18px; height: 18px; stroke-width: 1.6; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Scrollbar hidden helper */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Placeholder product image (striped) */
.ph-product {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      var(--bg-2) 0 10px,
      var(--bg) 10px 20px);
  border-radius: var(--r-md);
  overflow: hidden;
}
.ph-product::after {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  padding: 12px;
  text-align: center;
}

/* Studio product placeholder — looks like a pro product photo */
.ph-studio {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, #233248 0%, #0A1A2F 55%, #05111F 100%);
  overflow: hidden;
}
.ph-studio::before {
  /* floor reflection */
  content: "";
  position: absolute; left: 10%; right: 10%; bottom: 12%; height: 30px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 70%);
  filter: blur(6px);
}
.ph-studio::after {
  content: attr(data-label);
  position: absolute; left: 20px; bottom: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

/* Grain overlay for industrial textures */
.grain::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Vertical ticker */
.ticker-y {
  animation: tickerY 16s linear infinite;
}
@keyframes tickerY {
  0%, 20% { transform: translateY(0); }
  25%, 45% { transform: translateY(-100%); }
  50%, 70% { transform: translateY(-200%); }
  75%, 95% { transform: translateY(-300%); }
  100% { transform: translateY(0); }
}

/* Pulse dot */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.pulse { animation: pulseDot 1.6s ease-in-out infinite; }

/* Transitions for fade in */
.fade-in {
  animation: fadeIn .4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Marquee */
.marquee-wrap { overflow: hidden; }
.marquee-track {
  display: flex; gap: 48px; width: max-content;
  animation: marquee 50s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Skeleton */
.sk {
  background: linear-gradient(90deg, var(--bg-2), var(--bg) 40%, var(--bg-2) 80%);
  background-size: 200% 100%;
  animation: sk 1.4s linear infinite;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Headings scale */
.h-display { font-size: clamp(36px, 5.5vw, 72px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; }
.h-display-xl { font-size: clamp(44px, 7.7vw, 102px); line-height: 0.96; letter-spacing: -0.035em; font-weight: 800; }
.h-1 { font-size: clamp(28px, 3.5vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
.h-2 { font-size: clamp(22px, 2.4vw, 31px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.h-3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; }
.t-lead { font-size: 17px; line-height: 1.55; color: var(--ink-3); }
.t-body { font-size: 15px; line-height: 1.6; color: var(--ink-3); }
.t-small { font-size: 14px; color: var(--ink-3); }
.t-xs { font-size: 12px; color: var(--ink-4); }

/* Card base */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }

/* Divider */
.rule { height: 1px; background: var(--line); }

/* Toast */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 14px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500;
  animation: toastIn .25s ease;
  pointer-events: auto;
  min-width: 260px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shop grid responsive — adapta al ancho del contenedor sin depender de viewport media queries */
.shop-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
}
@media (max-width: 1024px) {
  .shop-grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; }
}

/* Cards inside the grid must never push their cell wider than 1fr */
.shop-grid-3 > * { min-width: 0; }
.shop-grid-3 > * * { min-width: 0; }
.shop-grid-3 [data-card], .shop-grid-3 a, .shop-grid-3 > div > a { max-width: 100%; overflow: hidden; }

/* Tighten 2-col grid breakpoint so cards never get squeezed past readable width */
@media (max-width: 820px) and (min-width: 641px) {
  .shop-grid-3 { gap: 12px !important; }
}

/* ─────── Responsive: tablet & mobile ─────── */
.hide-mobile { display: flex; }
.show-mobile { display: none !important; }

/* PDP layout */
.pdp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Shop layout */
.shop-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

/* Shop list view: 3-col on desktop, stacks on mobile */
.shop-list-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
@media (max-width: 640px) {
  .shop-list-row {
    grid-template-columns: 96px 1fr;
    grid-template-areas: "img info" "price price";
    gap: 12px;
    padding: 12px;
  }
  .shop-list-row > :nth-child(1) { grid-area: img; }
  .shop-list-row > :nth-child(2) { grid-area: info; min-width: 0; }
  .shop-list-row > :nth-child(3) { grid-area: price; text-align: left !important; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 8px; border-top: 1px solid var(--line); }
  .shop-list-row > :nth-child(3) > * { margin: 0 !important; }
  .shop-list-row > :nth-child(3) > button { margin-left: auto !important; }
}

/* Tablet (<= 1024px) — nav collapses to hamburger here because
   the 5-category nav + search + icons need >1000px to fit. */
@media (max-width: 1024px) {
  :root { --container: 100%; }
  .container { padding: 0 20px; }
  .hero-grid-imgs { grid-template-columns: 1fr 1fr !important; }
  .hero-grid-imgs > *:last-child { grid-column: 1 / -1; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
  .announce-strip { display: none; }
  header .container { height: 64px !important; gap: 12px !important; }
  .shop-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .shop-side { display: none; }
  .shop-side.open { display: block; position: fixed; inset: 0; z-index: 200; background: var(--bg); overflow: auto; padding: 20px; }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  header .container { height: 60px !important; }

  /* Hero grid: stack */
  .hero-grid-imgs { grid-template-columns: 1fr !important; min-height: 0 !important; }
  .hero-grid-imgs > * { min-height: 260px; grid-column: auto !important; }

  /* Hero editorial: stack text + image */
  .hero-grid { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Hide aggressive text-stroke on hero bold to avoid overflow */
  .hero-bold-outline { -webkit-text-stroke: 0 !important; color: rgba(255,255,255,0.2) !important; }

  /* Section spacing */
  section { padding-top: 40px !important; padding-bottom: 40px !important; }

  /* Buttons/inputs larger tap targets */
  .btn { min-height: 40px; }

  /* Promo grid stack */
  .promo-grid { grid-template-columns: 1fr !important; }
}

/* Small mobile (<= 420px) */
@media (max-width: 420px) {
  .container { padding: 0 14px; }
  h1 { letter-spacing: -0.02em; word-break: break-word; hyphens: auto; }
}
