:root {
  --color-bg: #f4f3f1;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #e8590c;
  --color-accent-dark: #c94a09;
  --color-header-start: #1c1f26;
  --color-header-end: #2c313d;
  --color-border: #e7e4de;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 20px -12px rgba(20, 20, 20, 0.18);
  --shadow-hover: 0 4px 10px rgba(20, 20, 20, 0.06), 0 16px 32px -14px rgba(20, 20, 20, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

.site-header {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px 16px;
  text-align: center;
  background: radial-gradient(circle at 15% 20%, rgba(232, 89, 12, 0.35), transparent 45%),
              linear-gradient(160deg, var(--color-header-start), var(--color-header-end));
  color: #fff;
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #ffb066 50%, var(--color-accent));
}

.brand-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  user-select: none;
}

.brand-marquee {
  transition: opacity 0.4s ease;
}

.brand-marquee.is-measuring {
  opacity: 0;
}

/* fuera de pantalla (al bajar por el catalogo) el fondo se detiene */
.brand-marquee.is-paused .brand-marquee-row {
  animation-play-state: paused;
}

.brand-marquee-row {
  display: flex;
  width: max-content;
  /* la velocidad y el desfase los calcula app.js segun el ancho real de los logos */
  animation: brand-marquee-left var(--marquee-duration, 60s) linear infinite;
  animation-delay: var(--marquee-delay, 0s);
  /* que el navegador la anime en la placa de video y no en el hilo principal (menos trabas) */
  will-change: transform;
  backface-visibility: hidden;
}

.brand-marquee-row.reverse {
  animation-name: brand-marquee-right;
}

.brand-marquee-row {
  align-items: center;
}

.brand-marquee-row span {
  display: flex;
  align-items: center;
  padding: 0 1.4rem;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.07);
}

/* todos los logos tienen el mismo alto; los muy anchos (ej. Crossmaster) se limitan a una
   proporcion maxima de 5,5 a 1 para no dominar el fondo. Ninguno se deforma: object-fit: contain
   conserva siempre la proporcion original */
.brand-marquee-logo {
  --logo-h: clamp(44px, 9vw, 62px);
  height: var(--logo-h);
  width: auto;
  max-width: calc(var(--logo-h) * 5.5);
  object-fit: contain;
  opacity: 0.5;
}

.brand-marquee-row span::after {
  content: "✦";
  margin-left: 2.8rem;
  color: rgba(232, 89, 12, 0.22);
}

@keyframes brand-marquee-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes brand-marquee-right {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

/* en celular los logos van mas juntos: la pista queda por debajo de los ~4.000 px que
   los celulares pueden animar de una vez sin trabarse */
@media (max-width: 640px) {
  .brand-marquee-row span { padding: 0 0.7rem; }
  .brand-marquee-row span::after { margin-left: 1.3rem; }
}

/* Si el sistema tiene las animaciones reducidas o desactivadas (pasa en compus con el modo
   de ahorro o en conexiones remotas), antes el fondo quedaba totalmente quieto. Ahora sigue
   moviendose, pero 3 veces mas despacio y sin desfase brusco. */
@media (prefers-reduced-motion: reduce) {
  .brand-marquee-row { animation-duration: calc(var(--marquee-duration, 60s) * 3); }
}

.site-header > :not(.brand-marquee):not(.sr-only) {
  position: relative;
  z-index: 1;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.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;
}


.tagline {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  color: rgba(255, 255, 255, 0.72);
  margin: 8px 0 0;
  font-size: 0.98rem;
}

.controls {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
}

#search-input {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  width: 100%;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

#search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.15), var(--shadow);
}

.category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.subcategory-block[hidden] {
  display: none;
}

.subcategory-block {
  max-width: 1100px;
  margin: 14px auto 14px;
  padding-inline: 20px;
  background: none;
  box-shadow: none;
  padding-block: 0;
}

.subcategory-block .category-nav .category-btn {
  font-size: 0.8rem;
  padding: 6px 13px;
}

.category-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.category-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.category-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(232, 89, 12, 0.6);
}

.price-notice {
  max-width: calc(100% - 40px);
  margin: 4px auto 18px;
  padding: 8px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: #8a5a12;
  background: #fff5e6;
  border: 1px solid #f3d9ad;
  border-radius: 999px;
  width: fit-content;
}

.product-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 20px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* barra unica fija arriba: inicio, buscador, marcas, ofertas y carrito */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #11161d;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.top-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.top-bar-home {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.top-bar-home:hover { background: rgba(255, 255, 255, 0.12); }

.top-bar #search-input {
  flex: 0 1 240px;
  width: auto;
  min-width: 120px;
  padding: 8px 14px;
  font-size: 0.92rem;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.95);
}

.top-bar .category-nav {
  flex: 1 1 auto;
  gap: 6px;
}

.top-bar .category-btn {
  padding: 6px 13px;
  font-size: 0.85rem;
  text-transform: uppercase; /* las marcas se muestran siempre en mayusculas */
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.top-bar .category-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.top-bar .category-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: none;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.top-nav-offers {
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.top-nav-offers:hover { background: var(--color-accent-dark); transform: translateY(-1px); }
.top-nav-offers[hidden] { display: none; }

.top-cart {
  position: relative;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.top-cart:hover { background: rgba(255, 255, 255, 0.2); }

.top-cart.has-items {
  background: #1f8a4c;
  border-color: #27ae60;
}

.top-cart.bump { animation: cart-bump 0.35s ease; }

@keyframes cart-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.top-cart-total[hidden] { display: none; }

.top-bar .cart-badge {
  top: -7px;
  right: -5px;
  background: var(--color-accent);
  border: 2px solid #11161d;
}

@media (max-width: 640px) {
  .top-bar-inner { padding: 6px 10px; gap: 6px 8px; }
  .top-bar-home { padding: 7px 9px; }
  .top-bar-home-text { display: none; }
  .top-bar #search-input { order: 1; flex: 1 1 100px; min-width: 0; }
  .top-bar-home { order: 0; }
  .top-bar-actions { order: 2; margin-left: 0; gap: 6px; }
  .top-bar .category-nav {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .top-bar .category-nav::-webkit-scrollbar { display: none; }
  .top-bar .category-btn { flex: 0 0 auto; }
  .top-nav-offers { padding: 7px 11px; font-size: 0.82rem; }
  .top-cart { padding: 7px 11px; }
  .top-cart-total { display: none; }
}

/* barra del catalogo en dos filas:
   1) buscador grande (con las ofertas y el carrito a la derecha)
   2) Inicio y, a su lado, las marcas */
.top-bar-catalog .top-bar-inner {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "logo search search actions"
    "logo home   brands brands";
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px 8px;
}

.top-bar-catalog .top-bar-home { grid-area: home; }

.top-bar-catalog #search-input {
  grid-area: search;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 22px;
  font-size: 1.05rem;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.top-bar-catalog #search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* las marcas viven en un menu desplegable ("Marcas") al lado de Inicio, para no ocupar lugar */
.brands-menu {
  grid-area: brands;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brands-toggle,
.brands-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
}

.brands-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.15s ease;
}

.brands-toggle:hover,
.brands-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.22);
}

.brands-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.brands-toggle[aria-expanded="true"] .brands-chevron {
  transform: rotate(180deg);
}

.brands-active {
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brands-active:hover {
  background: var(--color-accent-dark);
}

.brands-active[hidden] {
  display: none;
}

.brands-toggle:focus-visible,
.brands-active:focus-visible {
  outline: 2px solid #ffb066;
  outline-offset: 2px;
}

/* panel con todas las marcas */
.top-bar-catalog .category-nav {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 45;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: min(720px, calc(100vw - 20px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  background: #11161d;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.top-bar-catalog .category-nav.open {
  display: flex;
}

.top-bar-catalog .top-bar-actions {
  grid-area: actions;
  margin-left: 0;
}

/* logo de la tienda, sin fondo, a la izquierda de la barra (como en Mercado Libre) */
.top-bar-logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  align-self: center;
  margin-right: 6px;
}

.top-bar-logo img {
  display: block;
  height: 80px;
  width: auto;
}

/* pantallas anchas: el logo va en la esquina izquierda, en el margen oscuro, y el centro queda libre */
@media (min-width: 1560px) {
  .top-bar-catalog .top-bar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "search search actions"
      "home   brands brands";
  }

  .top-bar-logo {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
}

@media (max-width: 640px) {
  .top-bar-catalog .top-bar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "search search actions"
      "logo   brands brands";
    padding: 8px 10px 6px;
    gap: 6px 8px;
  }
  .top-bar-catalog #search-input { min-height: 42px; padding: 9px 16px; font-size: 1rem; }
  .top-bar-catalog .top-bar-home { display: none; } /* el logo ya lleva al inicio */
  .top-bar-logo { margin-right: 0; }
  .top-bar-logo img { height: 38px; }
}

.offers-section {
  max-width: 1100px;
  margin: 0 auto 8px;
  padding: 4px 20px 24px;
}

.offers-title {
  margin: 0 0 14px;
  padding: 10px 18px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent));
  border-radius: var(--radius);
}

/* que al saltar a una seccion no quede tapada por la barra fija */
.offers-section { scroll-margin-top: 130px; }

.offers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.offers-heading-wrap,
.offers-title-wrap {
  margin: 0;
  font-size: inherit;
  flex: 1;
  min-width: 0;
}

.offers-title-wrap {
  flex: none;
}

/* encabezados de ofertas que se pliegan y despliegan al tocarlos */
.offers-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.offers-toggle:focus-visible {
  outline: 3px solid rgba(232, 89, 12, 0.45);
  outline-offset: 2px;
}

.offers-toggle-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.offers-chevron {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.offers-toggle[aria-expanded="true"] .offers-chevron {
  transform: rotate(180deg);
}

.offers-title.offers-toggle {
  border: none;
  margin-bottom: 14px;
}

.offers-title.offers-toggle[aria-expanded="false"] {
  margin-bottom: 0;
}

.offers-title.offers-toggle:hover {
  filter: brightness(1.06);
}

.offers-heading.offers-toggle {
  border: none;
  background: none;
  padding: 0;
}

.offers-grid[hidden] {
  display: none;
}

.offers-heading {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.offers-close {
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
}

.offers-grid {
  max-width: none;
  margin: 0;
  padding: 0;
}


.offers-grid .product-card.on-sale {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent), var(--shadow);
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.product-image-wrap {
  position: relative;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* "contain" (no "cover"): las fotos no son todas cuadradas (hay herramientas muy
     alargadas), y recortarlas a la fuerza cortaba parte del producto. Con "contain"
     se ve la foto completa, con relleno gris parejo alrededor si hace falta. */
  object-fit: contain;
  background: #eef0f2;
  display: block;
}

.offer-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-accent);
  border-radius: 999px;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.35);
}

/* porcentaje de descuento, en la esquina opuesta al cartel OFERTA */
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  background: #d62828;
  border-radius: 8px;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.4);
}

.product-info {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  border-top: 1px solid var(--color-border);
}

.product-category {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent-dark);
  font-weight: 700;
}

.product-name {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
}

.product-description {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  display: none;
}

.product-card.expanded .product-description {
  display: block;
  margin-top: 2px;
}

.product-more-toggle {
  display: none;
}

.product-card.has-description .product-more-toggle {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.product-price-box {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.product-price {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--color-text);
}

.product-price.now-sale {
  color: var(--color-accent-dark);
}

.product-price-original {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.product-price.unavailable {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  font-style: italic;
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 60px 20px;
  font-size: 1rem;
}

.site-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  padding: 24px 20px 32px;
}

.site-footer a {
  color: inherit;
}

.privacy-notice[hidden] {
  display: none;
}

.privacy-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
  background: var(--color-header-start);
  color: #f1f1f1;
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  font-size: 0.82rem;
  line-height: 1.4;
}

.privacy-notice p {
  margin: 0;
}

.privacy-notice a {
  color: #ffb27a;
}

.privacy-ok {
  flex-shrink: 0;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.privacy-ok:hover {
  background: var(--color-accent-dark);
}

@media (max-width: 480px) {
  .privacy-notice {
    flex-direction: column;
    align-items: stretch;
  }
}

.whatsapp-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
  padding: 12px 20px;
  text-align: center;
  animation: whatsapp-pulse 2.4s ease-in-out infinite;
}

@media (max-width: 480px) {
  .whatsapp-banner {
    font-size: 0.8rem;
  }
}

.whatsapp-banner:hover {
  background: #1ebe5a;
}

.whatsapp-banner svg {
  flex-shrink: 0;
}

@keyframes whatsapp-pulse {
  0%, 100% { background-color: #25d366; }
  50% { background-color: #1fb959; }
}

.whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
  z-index: 50;
}

.whatsapp-fab:hover {
  transform: scale(1.06);
}

.cart-badge[hidden] {
  display: none;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* boton "agregar al pedido" y contador de cantidad en cada tarjeta */
.order-control {
  margin-top: 8px;
}

.add-to-order-btn {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-accent);
  background: #fff;
  color: var(--color-accent-dark);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-to-order-btn:hover {
  background: #fff3ea;
}

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.qty-stepper button {
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.qty-stepper button:hover {
  background: var(--color-border);
}

.qty-stepper span {
  font-weight: 700;
  font-size: 0.9rem;
}

.cart-total {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.cart-disclaimer {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.cart-footer[hidden] {
  display: none;
}

.cart-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-footer label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.cart-footer input {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.cart-footer input.input-error {
  border-color: #c0392b;
  outline: 2px solid rgba(192, 57, 43, 0.2);
}

.cart-delivery {
  margin: 0;
  padding: 8px 12px 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cart-delivery legend {
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.cart-delivery.input-error {
  border-color: #c0392b;
  outline: 2px solid rgba(192, 57, 43, 0.2);
}

.cart-footer .cart-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
}

.cart-footer .cart-choice:has(input:checked) {
  border-color: var(--color-accent);
  background: #fff3ea;
  color: var(--color-accent-dark);
}

.cart-delivery-note[hidden] {
  display: none;
}

.cart-delivery-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5e6;
  border: 1px solid #f3d9ad;
  color: #8a5a12;
  font-size: 0.85rem;
}

.cart-delivery-note span {
  font-size: 0.78rem;
}

.cart-footer .cart-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.cart-footer .cart-consent input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-top: 1px;
  accent-color: var(--color-accent);
}

.cart-footer .cart-consent a {
  color: var(--color-accent-dark);
}

.cart-consent.input-error {
  outline: 2px solid rgba(192, 57, 43, 0.35);
  background: #fdecea;
}

.cart-send-btn {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.cart-send-btn:hover {
  background: #1ebe5a;
}

@media (min-width: 640px) {
  .category-block {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 118px;
    padding: 16px 16px 12px;
  }


  .tagline {
    font-size: 0.85rem;
  }

  .product-grid {
    padding: 6px 14px 36px;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
  }

  .offers-section {
    padding: 4px 14px 18px;
  }

  .offers-title {
    font-size: 1.05rem;
    padding: 8px 14px;
  }

  .product-info {
    padding: 10px 10px 12px;
  }

  .product-name {
    font-size: 0.85rem;
  }

  .product-card.has-description .product-more-toggle {
    font-size: 0.72rem;
  }

  .product-category {
    font-size: 0.62rem;
  }

  .product-price {
    font-size: 0.92rem;
  }

  .whatsapp-fab {
    width: 48px;
    height: 48px;
    right: 14px;
    bottom: 14px;
  }

  .whatsapp-fab svg {
    width: 24px;
    height: 24px;
  }

  .discount-badge {
    top: 8px;
    right: 8px;
    padding: 3px 7px;
    font-size: 0.8rem;
  }

}


/* foto ampliada al tocar la imagen de un producto */
.product-image-wrap.zoomable { cursor: zoom-in; }

body.no-scroll { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 16px 24px;
  background: rgba(8, 10, 14, 0.9);
  cursor: zoom-out;
  animation: lightbox-in 0.15s ease;
}

.lightbox[hidden] { display: none; }

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* marco de tamaño fijo: todas las fotos se ven en el mismo recuadro (completas, sin recortar)
   y al pasar de una a otra la ventana no se agranda ni se achica */
.lightbox-stage {
  width: min(94vw, 700px);
  height: min(calc(100vh - 150px), 600px);
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
  overflow: hidden;
}

.lightbox-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.lightbox-caption {
  max-width: 90vw;
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* varias fotos: flechas, contador y miniaturas */
/* con varias fotos hace falta lugar abajo para el contador y las miniaturas */
.lightbox.has-gallery .lightbox-stage {
  height: min(calc(100vh - 260px), 600px);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.34); }
.lightbox-nav[hidden] { display: none; }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }

.lightbox-count {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 700;
}

.lightbox-count[hidden] { display: none; }

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  max-width: min(94vw, 760px);
  overflow-x: auto;
  padding: 4px;
  cursor: default;
}

.lightbox-thumbs[hidden] { display: none; }

.lightbox-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  opacity: 0.6;
  cursor: pointer;
}

.lightbox-thumb.active {
  border-color: var(--color-accent);
  opacity: 1;
}

@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.7rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* aviso en la tarjeta: este producto tiene mas de una foto */
.photo-count-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: rgba(17, 22, 29, 0.78);
  border-radius: 999px;
  pointer-events: none;
}
