/* ═══════════════════════════════════════════════════════════════
   AUTOMOTO - Tienda en Línea  |  style.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --intro-bg:   #030b28;
  --dark:       #050f3a;
  --primary:    #0d1fa0;
  --primary-h:  #1530c8;
  --accent:     #2244ff;
  --accent-2:   #6080ff;
  --light:      #dce4ff;
  --white:      #ffffff;
  --bg:         #f3f5ff;
  --bg-card:    #ffffff;
  --text:       #0f172a;
  --text-muted: #64748b;
  --border:     #dde3f8;
  --offer:      #dc2626;
  --wa:         #25D366;
  --wa-dark:    #1da851;
  --shadow:     0 4px 24px rgba(13,31,160,.10);
  --shadow-h:   0 8px 40px rgba(13,31,160,.22);
  --radius:     14px;
  --radius-sm:  8px;
  --hdr-h:      68px;
  --ease:       cubic-bezier(.4,0,.2,1);
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
button, a, .cat-btn, .qty-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ══════════════════════════════════════════════════════════════
   PANTALLA DE INTRO
   ══════════════════════════════════════════════════════════════ */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse 90% 70% at 50% 25%, #0a1d6e 0%, #030b28 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .7s ease;
}
#intro-screen.fade-out { opacity: 0; pointer-events: none; }

/* Cuadrícula sutil de fondo */
#intro-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ── Partículas flotantes ── */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(91,127,255,.35);
  animation: float linear infinite;
}
.particles span:nth-child(1)  { width:6px;  height:6px;  left:10%; top:20%; animation-duration:8s;  animation-delay:0s;   }
.particles span:nth-child(2)  { width:4px;  height:4px;  left:25%; top:60%; animation-duration:12s; animation-delay:2s;   }
.particles span:nth-child(3)  { width:8px;  height:8px;  left:50%; top:15%; animation-duration:10s; animation-delay:1s;   }
.particles span:nth-child(4)  { width:3px;  height:3px;  left:70%; top:40%; animation-duration:7s;  animation-delay:3s;   }
.particles span:nth-child(5)  { width:5px;  height:5px;  left:85%; top:70%; animation-duration:9s;  animation-delay:0.5s; }
.particles span:nth-child(6)  { width:4px;  height:4px;  left:15%; top:80%; animation-duration:11s; animation-delay:4s;   }
.particles span:nth-child(7)  { width:7px;  height:7px;  left:40%; top:50%; animation-duration:13s; animation-delay:1.5s; }
.particles span:nth-child(8)  { width:3px;  height:3px;  left:60%; top:85%; animation-duration:6s;  animation-delay:2.5s; }
.particles span:nth-child(9)  { width:6px;  height:6px;  left:78%; top:20%; animation-duration:15s; animation-delay:0.8s; }
.particles span:nth-child(10) { width:4px;  height:4px;  left:33%; top:30%; animation-duration:9s;  animation-delay:3.5s; }
@keyframes float {
  0%   { transform: translateY(0) scale(1);    opacity: .6; }
  50%  { transform: translateY(-30px) scale(1.2); opacity: 1; }
  100% { transform: translateY(0) scale(1);    opacity: .6; }
}

/* ── Logo y texto del intro ── */
.intro-content {
  position: relative;
  z-index: 5;
  text-align: center;
  animation: introFadeIn .8s ease-out .15s both;
  margin-bottom: 20px;
}
@keyframes introFadeIn {
  from { opacity: 0; transform: translateY(-16px) scale(.92); }
  to   { opacity: 1; transform: none; }
}

.intro-logo {
  width: min(280px, 52vw);
  margin: 0 auto 18px;
  filter: drop-shadow(0 0 30px rgba(91,127,255,.55)) drop-shadow(0 0 60px rgba(30,60,200,.3));
}

.intro-tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1rem, 3.2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: .14em;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  animation: introFadeIn .8s ease-out .5s both;
}

.intro-location {
  font-size: clamp(.75rem, 2vw, .95rem);
  color: rgba(255,255,255,.42);
  letter-spacing: .1em;
  margin-top: 6px;
  animation: introFadeIn .8s ease-out .8s both;
}

/* ── Carretera ── */
.road {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(to bottom, rgba(255,255,255,.04) 0%, rgba(255,255,255,.08) 100%);
  border-top: 1px solid rgba(255,255,255,.12);
  z-index: 2;
}
.road-line {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0, transparent 28px,
    rgba(255,255,255,.25) 28px, rgba(255,255,255,.25) 70px
  );
  animation: roadScroll 0.3s linear infinite;
}
@keyframes roadScroll {
  from { background-position: 0 0; }
  to   { background-position: -98px 0; }
}

/* ── Contenedor y SVG de la moto ── */
.moto-track {
  position: absolute;
  bottom: 28px;           /* justo encima de la carretera */
  left: 0;
  right: 0;
  height: 210px;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}

.moto-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  /* Ancho: grande y visible – ocupa bastante del ancho de pantalla */
  width: clamp(400px, 65vw, 780px);
  /* Empieza completamente fuera a la derecha */
  transform: translateX(110vw);
  /* Sombra bajo la moto para dar sensación de suelo */
  filter: drop-shadow(0 8px 24px rgba(13,31,200,.5));
}

/* Cuando el intro activa .moto-go, la moto cruza la pantalla */
#intro-screen.moto-go .moto-svg {
  animation: driveAcross 3.5s cubic-bezier(.12,.0,.42,1) .2s forwards;
}

@keyframes driveAcross {
  0%   { transform: translateX(110vw);   opacity: 1; }
  15%  { transform: translateX(55vw);    opacity: 1; }   /* desacelera al entrar */
  42%  { transform: translateX(22vw);    opacity: 1; }   /* pasa por el centro-derecho */
  58%  { transform: translateX(12vw);    opacity: 1; }   /* casi para, pausa dramática */
  100% { transform: translateX(-130vw);  opacity: 1; }   /* acelera y sale por la izquierda */
}

/* ── Rotación de ruedas ──
   transform-box:fill-box hace que transform-origin sea relativo al propio elemento
   lo que permite rotar cada rueda sobre su propio centro ── */
.wheel-front-g,
.wheel-rear-g {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: spinWheel .38s linear infinite;
}
@keyframes spinWheel { to { transform: rotate(360deg); } }

/* ── Líneas de velocidad (detrás de la rueda trasera) ── */
.speed-lines-svg {
  opacity: 0;
}
#intro-screen.moto-go .speed-lines-svg {
  animation: speedShow 3.5s ease .2s forwards;
}
@keyframes speedShow {
  0%,8%   { opacity: 0; }
  15%,80% { opacity: 1; }
  100%    { opacity: 0; }
}

/* ── Destello de la luz trasera ── */
#intro-screen.moto-go .tail-glow-anim {
  animation: tailBlink .35s ease-in-out infinite alternate;
}
@keyframes tailBlink {
  from { opacity: .65; }
  to   { opacity: 1; filter: brightness(1.6) drop-shadow(0 0 6px #EF5350); }
}

/* ══════════════════════════════════════════════════════════════
   CONTENIDO PRINCIPAL
   ══════════════════════════════════════════════════════════════ */
#main-content.hidden { display: none; }
#main-content { animation: pageFadeIn .55s ease; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Header ──────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--hdr-h);
  background: rgba(5,15,58,.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .25s var(--ease);
}
.header.scrolled { box-shadow: 0 4px 28px rgba(0,0,0,.45); }

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-logo-link { flex-shrink: 0; display: flex; align-items: center; }
.header-logo { height: 44px; width: auto; flex-shrink: 0; }

.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-track-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  color: rgba(255,255,255,.75);
  border-radius: 50px;
  font-weight: 600;
  font-size: .85rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.btn-track-header:hover { background: rgba(255,255,255,.08); color: #fff; }

.btn-cart-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  flex-shrink: 0;
  color: #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  transition: background .2s, transform .2s;
}
.btn-cart-header:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--offer);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #030f40 0%, var(--primary) 55%, #0a2070 100%);
  padding: 72px 20px 88px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,127,255,.14) 0%, transparent 70%);
  top: -250px; right: -150px;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.hero-logo  {
  width: min(220px, 48vw);
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 32px rgba(91,127,255,.4));
}
.hero h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1.7rem, 5.5vw, 3.1rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.08;
  margin-bottom: 14px;
}
.hero-sub {
  font-size: clamp(.88rem, 2vw, 1.08rem);
  color: rgba(255,255,255,.6);
  margin-bottom: 38px;
}

.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255,255,255,.96);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.hero-search input {
  flex: 1;
  padding: 16px 22px;
  border: none; outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}
.hero-search input::placeholder { color: var(--text-muted); }
#hero-search-btn {
  padding: 14px 30px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .04em;
  flex-shrink: 0;
  transition: background .2s;
}
#hero-search-btn:hover { background: var(--primary-h); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 44px;
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
}
.hero-stat .lbl {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Quiénes Somos ───────────────────────────────────────────── */
.about-section { padding: 64px 20px; background: #fff; }
.about-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-text .section-title { margin-bottom: 14px; }
.about-lead {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.02rem;
  margin-bottom: 16px;
}
.about-text p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.about-stats {
  display: flex;
  gap: 36px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.about-stat { text-align: left; }
.about-stat .num {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.about-stat .lbl {
  font-size: .76rem;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.about-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.about-gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Barra categorías ────────────────────────────────────────── */
.categories-section {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--hdr-h);
  z-index: 90;
}
.categories-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.categories-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: .87rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  transition: all .2s var(--ease);
  scroll-snap-align: start;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Sección Ofertas ─────────────────────────────────────────── */
.ofertas-section {
  padding: 52px 20px 44px;
  background: linear-gradient(to bottom, #fff5f5, var(--bg));
}
.section-header { max-width: 1400px; margin: 0 auto 24px; }
.section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .fire { font-size: 1.4em; }

.badge-oferta {
  display: inline-block;
  background: var(--offer);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ofertas-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

/* ── Sección Catálogo ────────────────────────────────────────── */
#catalog-section { padding: 52px 20px 64px; }
.catalog-header {
  max-width: 1400px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
#catalog-count { font-size: .9rem; color: var(--text-muted); }

.products-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ── Tarjeta de producto ─────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-h); }

.card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #eef1ff;
  overflow: hidden;
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.07); }

.card-img-wrap .badge-oferta {
  position: absolute;
  top: 10px; right: 10px;
  font-size: .67rem;
  padding: 4px 10px;
  box-shadow: 0 2px 8px rgba(220,38,38,.35);
}
.badge-cat {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(5,15,58,.78);
  color: rgba(255,255,255,.92);
  font-size: .67rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
  letter-spacing: .04em;
}

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card-code {
  font-size: .74rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}
.card-name {
  font-size: .94rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex: 1;
}
.card-price {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}
.card-price.no-price { font-size: .9rem; font-weight: 400; font-family: inherit; color: var(--text-muted); }
.card-unit { font-size: .74rem; font-weight: 400; font-family: inherit; color: var(--text-muted); }

.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-weight: 600;
  margin-top: 8px;
  transition: background .2s, transform .2s;
}
.btn-add-cart:hover:not(:disabled) { background: var(--primary-h); transform: translateY(-1px); }
.btn-add-cart:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-add-cart.added { background: #16a34a; }
.cart-icon-sm { width: 15px; height: 15px; flex-shrink: 0; }

.badge-agotado {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(15,23,42,.78);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: .08em;
}

/* Card en fila de ofertas (un poco más pequeña) */
.card-sm .card-name  { font-size: .86rem; }
.card-sm .card-price { font-size: 1.15rem; }

/* ── Vacío / carga / error ───────────────────────────────────── */
.loading-grid, .empty-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 20px;
  color: var(--text-muted);
}
.spinner-grid {
  width: 46px; height: 46px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-icon { font-size: 3.2rem; margin-bottom: 14px; }
.btn-clear {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  transition: background .2s;
}
.btn-clear:hover { background: var(--primary-h); }

/* ── Paginación ──────────────────────────────────────────────── */
.pagination {
  max-width: 1400px;
  margin: 38px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .87rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all .2s var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active  { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .38; cursor: not-allowed; }
.page-dots { padding: 0 4px; color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding: 64px 20px 32px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px 64px;
  align-items: start;
}
.footer-logo  { width: 140px; }
.footer-info h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
.footer-info .tagline {
  font-size: .82rem;
  letter-spacing: .09em;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.footer-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.footer-row:last-child { border: none; }
.footer-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.footer-info a { color: var(--wa); transition: color .2s; }
.footer-info a:hover { color: #5eedaa; }

.footer-bottom {
  max-width: 1200px;
  margin: 44px auto 0;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,.055);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  color: rgba(255,255,255,.28);
}

/* ── WhatsApp flotante ───────────────────────────────────────── */
#whatsapp-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--wa);
  color: #fff;
  padding: 14px 20px 14px 16px;
  border-radius: 50px;
  box-shadow: 0 6px 24px rgba(37,211,102,.42);
  font-weight: 700;
  font-size: .9rem;
  transition: transform .22s, box-shadow .22s, background .22s;
  animation: waPulse 3s ease-in-out 6s infinite;
}
#whatsapp-btn:hover {
  background: var(--wa-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(37,211,102,.58);
  animation: none;
}
.wa-float-icon { width: 26px; height: 26px; flex-shrink: 0; }
.wa-float-txt  {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.wa-float-txt span:first-child { font-size: .74rem; font-weight: 400; opacity: .88; }

@keyframes waPulse {
  0%,100% { box-shadow: 0 6px 24px rgba(37,211,102,.42); }
  50%      { box-shadow: 0 6px 40px rgba(37,211,102,.78), 0 0 0 12px rgba(37,211,102,.08); }
}

/* ══════════════════════════════════════════════════════════════
   CARRITO DE COMPRAS — drawer lateral
   ══════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(5,15,58,.55);
  backdrop-filter: blur(2px);
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg);
  z-index: 701;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease);
  box-shadow: -8px 0 32px rgba(0,0,0,.25);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  background: var(--dark);
  color: #fff;
}
.cart-drawer-head h3 { font-family: 'Rajdhani', sans-serif; font-size: 1.3rem; font-weight: 700; }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.cart-empty-icon { font-size: 2.6rem; margin-bottom: 10px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.cart-item-img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #eef1ff; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .85rem; font-weight: 600; color: var(--text); line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cart-item-code { font-size: .68rem; color: var(--text-muted); font-family: 'Courier New', monospace; }
.cart-item-price { font-size: .85rem; font-weight: 700; color: var(--primary); margin-top: 2px; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.cart-item-remove { font-size: .9rem; color: var(--text-muted); transition: color .2s; }
.cart-item-remove:hover { color: var(--offer); }

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 4px 6px;
}
.qty-stepper-sm { gap: 6px; padding: 2px 4px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.qty-stepper-sm .qty-btn { width: 22px; height: 22px; font-size: .9rem; }
.qty-btn:hover { background: var(--light); }
.qty-val { min-width: 18px; text-align: center; font-weight: 700; font-size: .9rem; }

.cart-drawer-footer {
  padding: 16px 22px 22px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-direction: column;
  gap: 12px;
}
.cart-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.cart-total-row strong { font-family: 'Rajdhani', sans-serif; font-size: 1.4rem; color: var(--primary); }
.btn-checkout {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s;
}
.btn-checkout:hover { background: var(--primary-h); }

.no-scroll { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   MODALES (genérico): overlay + content + close
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,15,58,.65);
  backdrop-filter: blur(3px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  transform: translateY(16px);
  transition: transform .25s var(--ease);
}
.modal-overlay.open .modal-content { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background .2s;
}
.modal-close:hover { background: var(--light); }

/* ── Modal: detalle de producto ──────────────────────────────── */
.ck-content { max-width: 480px; }

.pm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.pm-gallery { padding: 24px; background: #f7f8ff; }
.pm-main-img-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef1ff;
  cursor: zoom-in;
}
.pm-main-img { width: 100%; height: 100%; object-fit: contain; }
.pm-badge-oferta { position: absolute; top: 10px; right: 10px; }
.pm-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.pm-nav-prev { left: 10px; }
.pm-nav-next { right: 10px; }
.pm-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pm-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: .65;
  transition: opacity .2s, border-color .2s;
}
.pm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-thumb.active, .pm-thumb:hover { opacity: 1; border-color: var(--primary); }

.pm-info { padding: 28px 28px 28px 16px; display: flex; flex-direction: column; }
.pm-code { font-size: .78rem; color: var(--text-muted); font-family: 'Courier New', monospace; }
.pm-name { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 4px 0 10px; line-height: 1.2; }
.pm-badge-cat { position: static; display: inline-block; width: fit-content; margin-bottom: 10px; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.pm-price { font-family: 'Rajdhani', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.pm-stock { font-size: .85rem; font-weight: 600; margin: 8px 0 14px; }
.pm-stock.in-stock { color: #16a34a; }
.pm-stock.out-stock { color: var(--offer); }
.pm-section { margin-top: 6px; margin-bottom: 16px; }
.pm-section h4 { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.pm-text { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.pm-actions { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pm-btn-add { width: auto; flex: 1; min-width: 180px; margin-top: 0; padding: 13px 18px; }

/* ── Lightbox de fotos a pantalla completa ───────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(3,8,30,.94);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-img { max-width: 88vw; max-height: 86vh; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,.22); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ══════════════════════════════════════════════════════════════
   CHECKOUT (modal por pasos)
   ══════════════════════════════════════════════════════════════ */
.ck-content > div, #checkout-modal-content { padding: 32px 28px 28px; }
.ck-title { font-family: 'Rajdhani', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ck-sub { font-size: .85rem; color: var(--text-muted); margin-bottom: 18px; line-height: 1.4; }
.ck-error { font-size: .82rem; color: var(--offer); margin: 8px 0; font-weight: 600; }

.ck-search-row { display: flex; gap: 8px; }
.ck-search-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 1rem;
  outline: none;
}
.ck-search-row input:focus { border-color: var(--primary); }

.btn-primary-ck, .btn-secondary-ck {
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .88rem;
  transition: all .2s;
  white-space: nowrap;
}
.btn-primary-ck { background: var(--primary); color: #fff; }
.btn-primary-ck:hover { background: var(--primary-h); }
.btn-secondary-ck { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary-ck:hover { border-color: var(--primary); color: var(--primary); }

.ck-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .8rem; }
.ck-divider::before, .ck-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

#ck-new-btn { width: 100%; }

.ck-data-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: .88rem;
  line-height: 1.7;
}
.ck-data-card p { color: var(--text); }
.ck-data-card p strong { font-size: 1.05rem; }

.ck-form { display: flex; flex-direction: column; gap: 4px; }
.ck-form label { font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-top: 10px; }
.ck-form input {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 1rem;
  outline: none;
}
.ck-form input:focus { border-color: var(--primary); }

.ck-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.ck-actions button { flex: 1; }

.ck-review-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 260px; overflow-y: auto; }
.ck-review-item { display: flex; justify-content: space-between; font-size: .87rem; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ck-review-item small { color: var(--text-muted); }
.ck-review-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 2px solid var(--border); font-size: 1rem; margin-bottom: 8px; }
.ck-review-total strong { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; color: var(--primary); }

.ck-loading { text-align: center; padding: 50px 0; color: var(--text-muted); }

.ck-success { text-align: center; }
.ck-success-icon { font-size: 3rem; margin-bottom: 8px; }
.ck-codigo { font-family: 'Rajdhani', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--primary); letter-spacing: .04em; }

/* ══════════════════════════════════════════════════════════════
   RASTREO DE PEDIDOS
   ══════════════════════════════════════════════════════════════ */
.tracking-section { padding: 56px 20px 64px; background: linear-gradient(to bottom, #fff, var(--bg)); }
.tracking-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.tracking-sub { font-size: .9rem; color: var(--text-muted); margin: 8px 0 24px; }
.tracking-search-row { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.tracking-search-row input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  font-size: 1rem;
  outline: none;
  background: #fff;
}
.tracking-search-row input:focus { border-color: var(--primary); }
.tracking-search-row button {
  padding: 13px 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  transition: background .2s;
}
.tracking-search-row button:hover { background: var(--primary-h); }

.tracking-result { margin-top: 32px; text-align: left; }
.tk-hint, .tk-empty { text-align: center; color: var(--text-muted); padding: 30px 0; }
.tk-empty .empty-icon { font-size: 2.4rem; margin-bottom: 10px; }
.tk-greeting { font-size: .92rem; color: var(--text); margin-bottom: 16px; text-align: center; }

.tk-orders { display: flex; flex-direction: column; gap: 16px; }
.tk-order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.tk-order-head { display: flex; justify-content: space-between; align-items: center; }
.tk-order-id { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.tk-order-estado { padding: 4px 12px; border-radius: 50px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.tk-estado-pendiente { background: #fef3c7; color: #92400e; }
.tk-estado-parcial { background: #dbeafe; color: #1e40af; }
.tk-order-fecha { font-size: .78rem; color: var(--text-muted); margin: 4px 0 16px; }

.tk-timeline { display: flex; align-items: center; margin-bottom: 18px; }
.tk-step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.tk-step::before {
  content: '';
  position: absolute;
  top: 7px; left: -50%; width: 100%; height: 2px;
  background: var(--border);
  z-index: 0;
}
.tk-step:first-child::before { display: none; }
.tk-step.done::before { background: var(--primary); }
.tk-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--border); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); z-index: 1; margin-bottom: 6px; }
.tk-step.done .tk-dot { background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tk-step-label { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.tk-step.done .tk-step-label { color: var(--primary); }

.tk-order-items { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tk-order-item { display: flex; justify-content: space-between; font-size: .85rem; }
.tk-order-item small { color: var(--text-muted); }
.tk-pendiente { font-size: .76rem; color: var(--text-muted); }
.tk-order-total { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-weight: 700; color: var(--primary); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-logo  { width: 120px; }
  .pm-grid { grid-template-columns: 1fr; }
  .pm-info { padding: 8px 24px 24px; }
}

@media (max-width: 640px) {
  .btn-track-header .track-hdr-txt { display: none; }
  .btn-track-header { padding: 12px; }
  .header-inner  { gap: 6px; }
  .hero          { padding: 50px 16px 64px; }
  .hero-stats    { gap: 28px; }
  .about-inner   { grid-template-columns: 1fr; }
  .about-gallery { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ofertas-grid  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* WhatsApp: solo el ícono en móvil */
  #whatsapp-btn .wa-float-txt { display: none; }
  #whatsapp-btn { padding: 15px; border-radius: 50%; bottom: 18px; right: 18px; }
  .cart-drawer { width: 100vw; }
  .ck-actions { flex-direction: column; }
  .tracking-search-row { flex-direction: column; }

  /* Áreas táctiles más grandes (mínimo recomendado ~40-44px) */
  .qty-btn            { width: 38px; height: 38px; font-size: 1.1rem; }
  .qty-stepper-sm .qty-btn { width: 34px; height: 34px; font-size: 1rem; }
  .modal-close        { width: 42px; height: 42px; top: 10px; right: 10px; }
  .pm-nav              { width: 42px; height: 42px; }
  /* Evita que el badge OFERTA quede debajo del botón de cerrar agrandado */
  .pm-badge-oferta     { top: 10px; right: auto; left: 10px; }
  .cat-btn             { padding: 10px 18px; }
  .cart-item-remove    { padding: 8px; margin: -8px; font-size: 1rem; }
  .btn-add-cart        { padding: 12px; }
  .page-btn            { padding: 10px 14px; min-height: 40px; }

  /* Paginación: solo flechas, sin texto, para que quepa en pantallas chicas */
  .page-btn .pg-txt { display: none; }
}

@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
}
