/* Tienda pública — hoja de estilos independiente de main.css.
   La página no carga la SPA, así que aquí va todo lo que necesita.

   Estética tipo Shopify (tema Dawn): fondo blanco, mucho aire, tipografía
   grande, esquinas rectas, imágenes protagonistas y el color configurado por
   el cliente (--sp-primary) usado solo como acento en botones y detalles. */

:root {
  --sp-primary: #2563eb;
  --sp-ink: #121212;
  --sp-text: #1f1f1f;
  --sp-muted: #6d6d6d;
  --sp-bg: #ffffff;
  --sp-soft: #f4f4f4;
  --sp-line: #e3e3e3;
  --sp-success: #157347;
  --sp-danger: #b42318;
  --sp-page: 1360px;
  --sp-gutter: 32px;
  --sp-header-h: 68px;
  /* Tokens que sobrescribe Tienda → Apariencia (`applyTheme()` en shop.js).
     Los valores de aquí son el tema Dawn de siempre. */
  --sp-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sp-font-title: var(--sp-font);
  --sp-radius: 0px;
  --sp-cols: repeat(auto-fill, minmax(240px, 1fr));
  /* Ancho de tarjeta en las filas horizontales. Está aquí porque también lo
     usan las flechas del carrusel para centrarse sobre la imagen (que es
     cuadrada), y los dos valores tienen que moverse juntos. */
  --sp-row-card: clamp(210px, 22vw, 280px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sp-font);
  background: var(--sp-bg);
  color: var(--sp-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* El pie queda abajo aunque el catálogo sea corto (margin-top:auto del footer). */
#shop-root { flex: 1; display: flex; flex-direction: column; }
#shop-root > main { flex: 1; }

body.sp-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--sp-font-title);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--sp-ink);
}

.sp-brand span { font-family: var(--sp-font-title); }

/* Botones de contorno (Tienda → Apariencia). El claro del banner y el
   fantasma del carrito conservan su estilo. */
body.sp-btn-outline .sp-btn:not(.sp-btn-light):not(.sp-btn-ghost) {
  background: transparent;
  color: var(--sp-primary);
}

body.sp-btn-outline .sp-btn:not(.sp-btn-light):not(.sp-btn-ghost):not(:disabled):hover {
  background: var(--sp-primary);
  color: #fff;
  filter: none;
}

/* Las esquinas siguen el token: 0 = Dawn recto, 8/18 = suave o redondeado. */
.sp-card-media,
.sp-collection-img,
.sp-pdp-main,
.sp-thumb,
.sp-method,
.sp-item-img { border-radius: var(--sp-radius); }

.sp-wrap {
  max-width: var(--sp-page);
  margin: 0 auto;
  padding: 0 var(--sp-gutter);
}

.sp-loading { padding: 120px 20px; text-align: center; color: var(--sp-muted); }

/* Etiqueta pequeña en versalitas — el recurso tipográfico de Dawn. */
.sp-eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sp-muted);
  font-weight: 500;
}

/* ── Barra de anuncio ─────────────────────────────────── */
.sp-announce {
  background: var(--sp-ink);
  color: #fff;
  text-align: center;
  padding: 9px 20px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Cabecera ─────────────────────────────────────────── */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sp-bg);
  border-bottom: 1px solid var(--sp-line);
}

.sp-header-inner {
  max-width: var(--sp-page);
  margin: 0 auto;
  padding: 0 var(--sp-gutter);
  min-height: var(--sp-header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--sp-ink);
  flex-shrink: 0;
  /* Empuja el menú y los iconos al extremo derecho. */
  margin-right: auto;
}

.sp-brand img { height: 36px; width: auto; object-fit: contain; }

/* El menú va pegado a la derecha, junto a los iconos: el hueco lo abre la
   marca. Ponerle `margin-left:auto` al menú **y** a `.sp-actions` repartiría el
   espacio entre los dos y el menú quedaría al centro. */
.sp-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.sp-nav::-webkit-scrollbar { display: none; }

/* Enlaces a las páginas de la tienda (Inicio, Tienda, Contacto). */
.sp-nav-link {
  position: relative;
  background: none;
  border: none;
  padding: 6px 0;
  font: inherit;
  font-size: .92rem;
  color: var(--sp-text);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.sp-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.sp-nav-link:hover::after { transform: scaleX(1); }

.sp-nav-link.active {
  color: var(--sp-ink);
  font-weight: 600;
}

.sp-nav-link.active::after { transform: scaleX(1); }

.sp-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sp-icon-btn {
  position: relative;
  background: none;
  border: none;
  padding: 9px;
  cursor: pointer;
  color: var(--sp-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 0;
}

.sp-icon-btn:hover { background: var(--sp-soft); }

.sp-cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--sp-primary);
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  font-size: .68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sp-cart-count[data-empty="1"] { display: none; }

.sp-menu-btn { display: none; }

/* Buscador desplegable bajo la cabecera */
.sp-searchrow {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height .25s ease, border-color .25s ease;
}

.sp-searchrow.open {
  max-height: 90px;
  border-top-color: var(--sp-line);
}

.sp-searchrow-inner {
  max-width: var(--sp-page);
  margin: 0 auto;
  padding: 14px var(--sp-gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-searchrow-inner .sp-input { border: none; border-bottom: 1px solid var(--sp-line); padding-left: 0; }
.sp-searchrow-inner .sp-input:focus { box-shadow: none; border-bottom-color: var(--sp-ink); }

/* ── Banner principal (carrusel de 1 a 3) ─────────────── */
/* Todos los banners ocupan la misma celda del grid: el alto lo marca el más
   alto y el cambio es un fundido, sin saltos de layout. */
.sp-carousel {
  display: grid;
  position: relative;
  overflow: hidden;
}

.sp-carousel > .sp-hero { grid-area: 1 / 1; }

.sp-carousel-multi > .sp-hero {
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility .6s;
}

.sp-carousel-multi > .sp-hero.is-active { opacity: 1; visibility: visible; }

.sp-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  cursor: pointer;
  transition: background .15s;
}

.sp-hero-nav:hover { background: rgba(255, 255, 255, .4); }
.sp-hero-nav.prev { left: 16px; }
.sp-hero-nav.next { right: 16px; }

.sp-dots {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.sp-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .15s;
}

.sp-dot.is-active { background: #fff; }

.sp-hero {
  position: relative;
  min-height: clamp(340px, 52vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 24px;
  background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-ink) 140%);
  color: #fff;
  overflow: hidden;
}

.sp-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .5) 100%);
  pointer-events: none;
}

.sp-hero:not(:has(.sp-hero-img))::after { background: rgba(0, 0, 0, .12); }

.sp-hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.sp-hero-content .sp-eyebrow { color: rgba(255, 255, 255, .8); }

.sp-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 12px 0 0;
}

.sp-hero p {
  margin: 16px 0 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, .9);
}

.sp-hero .sp-btn { margin-top: 28px; }

/* ── Sección de productos ─────────────────────────────── */
.sp-section {
  padding: 72px 0 96px;
}

.sp-section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 44px;
}

.sp-section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-top: 10px;
}

.sp-section-head p {
  margin: 14px 0 0;
  color: var(--sp-muted);
}

.sp-result-count {
  text-align: center;
  color: var(--sp-muted);
  font-size: .85rem;
  margin-bottom: 28px;
}

/* Fila «Compra por categoría» (solo si hay categorías con imagen).
   Mismas reglas que `.sp-row` (destacados y relacionados): tarjeta de ancho
   fijo, alineadas a la izquierda y con scroll horizontal cuando no caben. Con
   `1fr` o centrado, una sola categoría se estiraría a pantalla completa. */
.sp-collections {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Es un <a> a /tienda/catalogo?categoria=…: la grilla filtrable vive en la
   página Tienda, así que el tile navega en vez de filtrar en el sitio. */
.sp-collection {
  flex: 0 0 var(--sp-row-card);
  scroll-snap-align: start;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--sp-ink);
  text-decoration: none;
  display: block;
}

/* El nombre va **dentro** de la imagen, centrado, sobre un velo oscuro que le
   da contraste con cualquier foto. */
.sp-collection-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--sp-soft);
  overflow: hidden;
}

.sp-collection-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .45) 100%);
}

@media (max-width: 700px) {
  .sp-collections { gap: 16px; }
  .sp-collection { flex-basis: 68vw; }
}

.sp-collection-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}

.sp-collection:hover img { transform: scale(1.05); }

.sp-collection-img span {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}

.sp-grid {
  display: grid;
  grid-template-columns: var(--sp-cols);
  column-gap: 24px;
  row-gap: 48px;
}

.sp-card { display: flex; flex-direction: column; }

.sp-card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--sp-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4c4;
}

.sp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}

.sp-card:hover .sp-card-media img { transform: scale(1.05); }

/* Compra rápida: aparece sobre la imagen al pasar el mouse (Dawn "quick add") */
.sp-quick {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 11px 14px;
  background: var(--sp-bg);
  color: var(--sp-ink);
  border: 1px solid var(--sp-ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(calc(100% + 14px));
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease, background .15s, color .15s;
}

.sp-card:hover .sp-quick,
.sp-quick:focus-visible {
  transform: none;
  opacity: 1;
}

.sp-quick:hover { background: var(--sp-ink); color: #fff; }

/* En productos con variantes el «agregar» es un enlace a la ficha (hay que
   elegir talla antes), así que necesita verse igual que el botón. */
a.sp-quick { display: block; text-align: center; text-decoration: none; }

.sp-card-info { padding-top: 14px; }

.sp-card-cat {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sp-muted);
}

.sp-card-name {
  display: block;
  font-size: .96rem;
  font-weight: 500;
  color: var(--sp-ink);
  margin-top: 3px;
  text-decoration: none;
}

.sp-card-name:hover { text-decoration: underline; }

/* La imagen es un enlace a la ficha; ocupa toda la caja del medio. */
.sp-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
}

.sp-card-stock {
  font-size: .78rem;
  color: var(--sp-muted);
  margin-top: 6px;
}

.sp-card-stock.sp-stock-low { color: var(--sp-danger); font-weight: 600; }
.sp-card-stock.sp-stock-out { font-weight: 500; }

/* Agotado: en vez de una etiqueta encima, la foto se ve «apagada» y no hay
   compra rápida al pasar el mouse. El texto de disponibilidad, bajo el
   precio, es el único que lo dice con palabras. */
.sp-card-out .sp-card-media img,
.sp-media-out img {
  filter: grayscale(1);
  opacity: .45;
}

.sp-card-out:hover .sp-card-media img { transform: none; }

/* Fila horizontal de tarjetas (destacados y relacionados).
   Ancho fijo por tarjeta, no `1fr`: igual que en «Compra por categoría», con
   un solo producto una pista elástica lo estiraría a pantalla completa. */
.sp-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.sp-row > .sp-card {
  flex: 0 0 var(--sp-row-card);
  scroll-snap-align: start;
}

/* Flechas de las filas horizontales (destacados, relacionados, categorías).
   La fila sigue teniendo `overflow-x` —así se pasa con el dedo en móvil— pero
   la barra se oculta: el paso lo dan los botones. */
.sp-carousel-row { position: relative; }

.sp-row,
.sp-collections {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sp-row::-webkit-scrollbar,
.sp-collections::-webkit-scrollbar { width: 0; height: 0; }

.sp-row-nav {
  position: absolute;
  /* Centrada sobre la imagen de la tarjeta, que es cuadrada → media altura
     equivale a medio ancho. Centrarla en la fila entera la dejaría sobre el
     precio, tapando lo que el visitante está leyendo. */
  top: calc(var(--sp-row-card) / 2);
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sp-line);
  border-radius: 50%;
  background: var(--sp-bg);
  color: var(--sp-ink);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  transition: opacity .15s, background .15s;
}

.sp-row-nav.prev { left: -18px; }
.sp-row-nav.next { right: -18px; }
.sp-row-nav:hover:not(:disabled) { background: var(--sp-soft); }

/* En el extremo la flecha desaparece en vez de quedar gris: no hay a dónde ir. */
.sp-row-nav:disabled { opacity: 0; pointer-events: none; }

/* Si la fila cabe entera no hay nada que pasar. */
.sp-row-fits .sp-row-nav { display: none; }

@media (max-width: 700px) {
  .sp-row { gap: 16px; }
  /* La variable va en el contenedor para que la flecha y la tarjeta sigan
     midiendo lo mismo (la flecha se centra con ella). */
  .sp-carousel-row:has(> .sp-row) { --sp-row-card: 68vw; }
  .sp-row-nav { width: 38px; height: 38px; }
  .sp-row-nav.prev { left: 2px; }
  .sp-row-nav.next { right: 2px; }
}

.sp-card-desc {
  font-size: .84rem;
  color: var(--sp-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sp-card-price {
  margin-top: 8px;
  font-size: .96rem;
  font-weight: 600;
  color: var(--sp-ink);
}

/* Descuentos: precio de lista tachado junto al precio vigente, y distintivo
   sobre la imagen. El precio que se cobra siempre lo recalcula el servidor. */
.sp-price-old {
  margin-left: 8px;
  font-weight: 400;
  color: var(--sp-muted);
  text-decoration: line-through;
  font-size: .88em;
}

.sp-sale-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--sp-danger);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.sp-savings {
  display: flex;
  justify-content: flex-end;
  color: var(--sp-danger);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Esqueleto de carga */
.sp-skel .sp-card-media,
.sp-skel-line {
  background: linear-gradient(90deg, #f1f1f1 25%, #e8e8e8 37%, #f1f1f1 63%);
  background-size: 400% 100%;
  animation: sp-shimmer 1.3s infinite linear;
}

.sp-skel-line { height: 11px; margin-top: 10px; }
.sp-skel-line.short { width: 45%; }

@keyframes sp-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.sp-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--sp-muted);
}

/* Sin hover (táctil): la compra rápida siempre visible */
@media (hover: none) {
  .sp-quick { transform: none; opacity: 1; }
}

/* ── Controles ────────────────────────────────────────── */
.sp-input {
  width: 100%;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 12px 14px;
  font-size: .92rem;
  font-family: inherit;
  background: var(--sp-bg);
  color: inherit;
}

.sp-input::placeholder { color: #9a9a9a; }

.sp-input:focus {
  outline: none;
  border-color: var(--sp-ink);
  box-shadow: 0 0 0 1px var(--sp-ink);
}

textarea.sp-input { resize: vertical; }

.sp-btn {
  border: 1px solid var(--sp-primary);
  border-radius: var(--sp-radius);
  padding: 14px 30px;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .01em;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sp-primary);
  color: #fff;
  text-decoration: none;
  transition: filter .15s, background .15s, color .15s;
}

.sp-btn:disabled { opacity: .5; cursor: not-allowed; }
.sp-btn:not(:disabled):hover { filter: brightness(.88); }

/* Botón claro sobre el banner */
.sp-btn-light {
  background: #fff;
  color: var(--sp-ink);
  border-color: #fff;
}

.sp-btn-ghost {
  background: transparent;
  border-color: var(--sp-line);
  color: var(--sp-ink);
}

.sp-btn-ghost:not(:disabled):hover { filter: none; background: var(--sp-soft); }

.sp-btn-block { width: 100%; }

.sp-label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--sp-muted);
  margin-bottom: 6px;
}

.sp-field { margin-bottom: 14px; }

/* Métodos de pago del checkout (solo si la tienda tiene más de una pasarela) */
.sp-methods { display: flex; flex-direction: column; gap: 8px; }

.sp-method {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--sp-line);
  cursor: pointer;
  transition: border-color .15s;
}

.sp-method:hover { border-color: var(--sp-ink); }
.sp-method:has(input:checked) { border-color: var(--sp-ink); background: var(--sp-soft); }
.sp-method input { margin-top: 3px; accent-color: var(--sp-primary); }
.sp-method span { display: flex; flex-direction: column; gap: 2px; }
.sp-method strong { font-size: .9rem; font-weight: 600; color: var(--sp-ink); }
.sp-method em { font-style: normal; font-size: .78rem; color: var(--sp-muted); }

/* ── Menú móvil / carrito (paneles) ───────────────────── */
.sp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 40;
}

.sp-overlay.open { opacity: 1; pointer-events: auto; }

.sp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--sp-bg);
  z-index: 50;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2, .6, .2, 1);
  display: flex;
  flex-direction: column;
}

.sp-drawer.open { transform: none; }

.sp-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--sp-bg);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.2, .6, .2, 1);
  display: flex;
  flex-direction: column;
}

.sp-menu-panel.open { transform: none; }

.sp-menu-panel .sp-menu-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--sp-line);
  padding: 16px 24px;
  font: inherit;
  font-size: 1rem;
  color: var(--sp-ink);
  cursor: pointer;
  text-decoration: none;
}

.sp-menu-panel .sp-menu-link.active { font-weight: 600; }

.sp-drawer-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--sp-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--sp-ink);
  letter-spacing: -.01em;
}

.sp-drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 20px; }

.sp-drawer-foot {
  border-top: 1px solid var(--sp-line);
  padding: 20px 24px 24px;
  background: var(--sp-bg);
}

.sp-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sp-ink);
  padding: 6px;
  line-height: 0;
  border-radius: 999px;
}

.sp-close:hover { background: var(--sp-soft); }

.sp-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--sp-line);
}

.sp-item-img {
  width: 74px;
  height: 92px;
  background: var(--sp-soft);
  object-fit: cover;
  flex-shrink: 0;
}

.sp-item-info { flex: 1; min-width: 0; }
.sp-item-name { font-weight: 500; font-size: .92rem; color: var(--sp-ink); }
.sp-item-price { color: var(--sp-muted); font-size: .82rem; margin-top: 2px; }

.sp-item-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.sp-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--sp-line);
}

.sp-qty button {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--sp-ink);
}

.sp-qty button:hover { background: var(--sp-soft); }
.sp-qty span { min-width: 30px; text-align: center; font-size: .88rem; }

.sp-item-total { font-weight: 600; font-size: .9rem; color: var(--sp-ink); }

.sp-remove {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .78rem;
  color: var(--sp-muted);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 6px;
}

.sp-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--sp-ink);
  margin-bottom: 6px;
}

.sp-total-note {
  color: var(--sp-muted);
  font-size: .78rem;
  margin-bottom: 16px;
}

/* ── Pie de página ────────────────────────────────────── */
.sp-footer {
  border-top: 1px solid var(--sp-line);
  background: var(--sp-soft);
  padding: 56px 0 0;
  margin-top: auto;
}

.sp-footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}

.sp-footer h4 {
  margin: 0 0 14px;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sp-ink);
  font-weight: 600;
}

.sp-footer p { margin: 0; color: var(--sp-muted); font-size: .88rem; max-width: 40ch; }

.sp-footer-list { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }

.sp-footer-list a,
.sp-footer-list button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: .88rem;
  color: var(--sp-muted);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.sp-footer-list a:hover,
.sp-footer-list button:hover { color: var(--sp-ink); }

.sp-footer-bar {
  border-top: 1px solid var(--sp-line);
  padding: 18px 0;
  font-size: .8rem;
  color: var(--sp-muted);
  text-align: center;
}

/* ── Botón flotante de WhatsApp ───────────────────────── */
.sp-wa {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  transition: transform .18s;
}

.sp-wa:hover { transform: scale(1.06); }

/* ── Confirmación / gracias ───────────────────────────── */
/* ── Ficha de producto (/tienda/producto/<código>) ──────────────────────── */

.sp-pdp { padding-top: 34px; padding-bottom: 90px; }

.sp-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .8rem;
  color: var(--sp-muted);
  margin-bottom: 28px;
}

.sp-crumbs a { color: var(--sp-muted); text-decoration: none; }
.sp-crumbs a:hover { color: var(--sp-ink); text-decoration: underline; }
.sp-crumb-current { color: var(--sp-ink); }

.sp-pdp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.sp-pdp-main {
  position: relative;
  aspect-ratio: 1;
  background: var(--sp-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4c4c4;
  overflow: hidden;
}

.sp-pdp-main img { width: 100%; height: 100%; object-fit: cover; }

.sp-thumbs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sp-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid var(--sp-line);
  background: var(--sp-soft);
  cursor: pointer;
  overflow: hidden;
}

.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-thumb.active { border-color: var(--sp-ink); }

.sp-pdp-info h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  margin: 8px 0 0;
  line-height: 1.25;
}

.sp-pdp-price {
  margin-top: 16px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--sp-ink);
}

.sp-pdp-stock { margin-top: 10px; font-size: .85rem; color: var(--sp-muted); }
.sp-pdp-stock.out { color: var(--sp-danger); font-weight: 600; }

.sp-pdp-desc {
  margin-top: 22px;
  color: var(--sp-text);
  line-height: 1.8;
  white-space: pre-line;
}

/* ── Variantes: selector de talla / tipo / presentación ───────────────── */
.sp-options { margin-top: 22px; }

.sp-options-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sp-muted);
  margin-bottom: 10px;
}

.sp-options-picked { color: var(--sp-ink); font-weight: 600; text-transform: none; letter-spacing: 0; }

.sp-options-list { display: flex; flex-wrap: wrap; gap: 8px; }

.sp-option {
  min-width: 48px;
  padding: 10px 14px;
  border: 1px solid var(--sp-line);
  border-radius: calc(var(--sp-radius) * .6);
  background: var(--sp-bg);
  color: var(--sp-ink);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.sp-option:hover:not(:disabled) { border-color: var(--sp-ink); }

.sp-option.active {
  border-color: var(--sp-ink);
  background: var(--sp-ink);
  color: var(--sp-bg);
}

/* Agotada: se deja ver (informa qué tallas existen) pero tachada y sin clic. */
.sp-option-out {
  color: var(--sp-muted);
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: .55;
}

/* Existe, pero no en la combinación elegida ahora mismo (talla 38 sí, pero no
   en negro). Sí se puede pulsar: al hacerlo se reacomodan los demás ejes. */
.sp-option-na {
  color: var(--sp-muted);
  border-style: dashed;
  opacity: .7;
}

/* Tallas disponibles resumidas en la tarjeta de la grilla. */
.sp-card-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.sp-card-opts span {
  font-size: .7rem;
  padding: 2px 7px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  color: var(--sp-muted);
}

.sp-pdp-actions {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 30px;
}

.sp-pdp-actions .sp-qty { flex: 0 0 auto; }
.sp-pdp-actions .sp-btn-block { flex: 1; }

.sp-pdp-meta {
  margin-top: 18px;
  font-size: .78rem;
  color: var(--sp-muted);
  letter-spacing: .04em;
}

@media (max-width: 860px) {
  .sp-pdp-grid { grid-template-columns: 1fr; gap: 30px; }
}

.sp-result {
  max-width: 560px;
  margin: 90px auto 110px;
  text-align: center;
  padding: 0 24px;
}

.sp-result h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 12px; }
.sp-result p { color: var(--sp-muted); line-height: 1.7; }

.sp-order-num {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin: 20px 0 14px;
  color: var(--sp-ink);
}

.sp-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}

.sp-pill-ok { background: #e7f5ec; color: var(--sp-success); }
.sp-pill-wait { background: #fff6e5; color: #9a6700; }
.sp-pill-bad { background: #fdeceb; color: var(--sp-danger); }

/* ── Toasts ───────────────────────────────────────────── */
.sp-toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.sp-toast {
  background: var(--sp-ink);
  color: #fff;
  padding: 12px 20px;
  font-size: .86rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  animation: sp-in .22s ease;
}

.sp-toast.error { background: var(--sp-danger); }

@keyframes sp-in {
  from { opacity: 0; transform: translateY(12px); }
}

/* ── Página de contacto ───────────────────────────────── */
.sp-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 940px;
  margin: 0 auto;
}

.sp-contact-card {
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 26px 24px;
  text-align: center;
}

.sp-contact-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--sp-soft);
  color: var(--sp-primary);
  margin-bottom: 14px;
}

.sp-contact-card h4 {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sp-muted);
}

.sp-contact-card p,
.sp-contact-card a {
  margin: 0;
  color: var(--sp-ink);
  font-size: .95rem;
  text-decoration: none;
  /* Una dirección larga o un correo no deben desbordar la tarjeta. */
  overflow-wrap: anywhere;
}

.sp-contact-card a:hover { color: var(--sp-primary); text-decoration: underline; }

.sp-contact-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

/* Mapa insertado. Alto por proporción y no fijo: en móvil un 16/9 se queda
   demasiado bajo para reconocer el barrio. */
.sp-contact-map {
  max-width: 940px;
  margin: 40px auto 0;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  overflow: hidden;
  aspect-ratio: 16 / 7;
}

.sp-contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 640px) {
  .sp-contact-map { aspect-ratio: 4 / 3; }
}

/* Botón «Ver todo el catálogo» bajo la muestra de la portada. */
.sp-seeall {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

/* ── Catálogo con filtros laterales ───────────────────── */
/* Dos columnas: el panel de filtros a la izquierda (pegajoso mientras se baja
   por la grilla) y los resultados a la derecha. En móvil el panel pasa a ser
   un cajón, igual que el menú y el carrito. */
.sp-catalog {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.sp-results { min-width: 0; }

.sp-filters {
  position: sticky;
  top: calc(var(--sp-header-h) + 20px);
  max-height: calc(100vh - var(--sp-header-h) - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

/* La cabecera del panel solo hace falta cuando es cajón (móvil). */
.sp-filters-head { display: none; }

.sp-fclear {
  background: none;
  border: none;
  padding: 0 0 18px;
  font: inherit;
  font-size: .82rem;
  color: var(--sp-primary);
  cursor: pointer;
  text-decoration: underline;
}

.sp-fgroup {
  border-top: 1px solid var(--sp-line);
  padding: 20px 0;
}

.sp-fgroup:first-of-type { border-top: none; padding-top: 0; }

.sp-fgroup h4 {
  margin: 0 0 12px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sp-ink);
}

.sp-fopts { display: flex; flex-direction: column; gap: 2px; }

.sp-fopt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: .9rem;
  cursor: pointer;
  color: var(--sp-text);
}

.sp-fopt input { accent-color: var(--sp-primary); margin: 0; flex: none; }
.sp-fopt span { flex: 1; min-width: 0; }

/* El contador de cada opción: cuántos productos quedarían al marcarla. */
.sp-fopt em {
  font-style: normal;
  font-size: .78rem;
  color: var(--sp-muted);
}

.sp-fopt:hover span { color: var(--sp-primary); }

/* Opción que no deja nada: se ve, para saber que existe, pero no se marca. */
.sp-fopt-empty { opacity: .4; cursor: not-allowed; }
.sp-fopt-empty:hover span { color: inherit; }

/* Valores cortos (tallas) como fichas: ocupan menos y se leen de un vistazo. */
.sp-fopts-chips { flex-direction: row; flex-wrap: wrap; gap: 6px; }

.sp-fchip {
  padding: 0;
  border: 1px solid var(--sp-line);
  border-radius: calc(var(--sp-radius) * .6);
  min-width: 40px;
  justify-content: center;
}

.sp-fchip input { position: absolute; opacity: 0; pointer-events: none; }

.sp-fchip span {
  flex: none;
  padding: 7px 10px;
  font-size: .86rem;
  text-align: center;
}

.sp-fchip:has(input:checked) {
  border-color: var(--sp-ink);
  background: var(--sp-ink);
}

.sp-fchip:has(input:checked) span { color: #fff; }

/* Agotada en todas sus combinaciones: tachada, como en la ficha de producto. */
.sp-fchip.sp-fopt-empty span { text-decoration: line-through; }

.sp-fmore {
  background: none;
  border: none;
  padding: 8px 0 0;
  font: inherit;
  font-size: .82rem;
  color: var(--sp-primary);
  cursor: pointer;
  text-decoration: underline;
}

.sp-fprice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.sp-fprice .sp-input { padding: 8px 10px; font-size: .85rem; min-width: 0; }
.sp-fprice span { color: var(--sp-muted); flex: none; }

.sp-fgo {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  background: var(--sp-bg);
  color: var(--sp-ink);
  cursor: pointer;
}

.sp-fgo:hover { background: var(--sp-soft); }

.sp-fempty { color: var(--sp-muted); font-size: .88rem; }

/* ── Barra sobre la grilla ────────────────────────────── */
.sp-toolbar { margin-bottom: 24px; }

.sp-toolbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sp-line);
}

/* El conteo hereda el estilo centrado de la sección; aquí va en línea. */
.sp-toolbar .sp-result-count { margin: 0; text-align: left; flex: 1; }

.sp-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--sp-muted);
  flex: none;
}

.sp-sort select {
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  background: var(--sp-bg);
  color: var(--sp-ink);
  font: inherit;
  font-size: .85rem;
  padding: 8px 10px;
  cursor: pointer;
  max-width: 100%;
}

/* Abre el cajón de filtros: solo existe cuando no hay sitio para la columna. */
.sp-filter-btn {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  background: var(--sp-bg);
  color: var(--sp-ink);
  font: inherit;
  font-size: .85rem;
  font-weight: 500;
  padding: 9px 14px;
  cursor: pointer;
  flex: none;
}

/* Filtros activos, para quitarlos de uno en uno sin volver al panel. */
.sp-fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.sp-fchip-off {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--sp-line);
  border-radius: calc(var(--sp-radius) * .6);
  background: var(--sp-soft);
  color: var(--sp-ink);
  font: inherit;
  font-size: .8rem;
  padding: 5px 10px;
  cursor: pointer;
}

.sp-fchip-off:hover { border-color: var(--sp-ink); }

.sp-fchip-clear {
  background: none;
  border: none;
  font: inherit;
  font-size: .8rem;
  color: var(--sp-primary);
  cursor: pointer;
  text-decoration: underline;
}

.sp-empty .sp-btn { margin-top: 18px; }

@media (max-width: 900px) {
  .sp-catalog { grid-template-columns: 1fr; gap: 0; }
  .sp-filter-btn { display: inline-flex; }

  /* Mismo cajón que el menú lateral (`.sp-menu-panel`). */
  .sp-filters {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 330px;
    max-width: 88vw;
    max-height: none;
    z-index: 50;
    background: var(--sp-bg);
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.2, .6, .2, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
  }

  .sp-filters.open { transform: none; }

  .sp-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--sp-line);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--sp-ink);
  }

  .sp-filters-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px 40px;
  }
}

@media (max-width: 520px) {
  .sp-toolbar-row { flex-wrap: wrap; gap: 10px; }
  .sp-toolbar .sp-result-count { order: 3; flex-basis: 100%; }
  .sp-sort { flex: 1; justify-content: flex-end; }
  .sp-sort span { display: none; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sp-gutter: 20px; }

  .sp-nav { display: none; }
  .sp-menu-btn { display: inline-flex; }
  .sp-header-inner { gap: 8px; }
  .sp-brand { font-size: 1rem; }
  .sp-brand img { height: 30px; }

  .sp-footer-cols { grid-template-columns: 1fr; gap: 32px; }
  .sp-section { padding: 48px 0 64px; }
}

@media (max-width: 640px) {
  .sp-grid { grid-template-columns: repeat(2, 1fr); column-gap: 12px; row-gap: 32px; }
  .sp-card-desc { display: none; }
  .sp-hero { min-height: 300px; padding: 56px 20px; }
  /* En móvil el carrusel se pasa deslizando: las flechas taparían el texto. */
  .sp-hero-nav { display: none; }
  .sp-drawer-body, .sp-drawer-head, .sp-drawer-foot { padding-left: 18px; padding-right: 18px; }
}

/* ── Pop-up publicitario ──────────────────────────────── */
.sp-popup-back {
  position: fixed;
  inset: 0;
  /* Por debajo de los avisos (90): un toast tapado por el fondo no se vería. */
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .2s ease;
}

.sp-popup-back.open { opacity: 1; }

.sp-popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--sp-bg);
  color: var(--sp-text);
  border-radius: var(--sp-radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  transform: translateY(14px);
  transition: transform .25s ease;
}

.sp-popup-back.open .sp-popup { transform: none; }

.sp-popup-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--sp-ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.sp-popup-img {
  display: block;
  width: 100%;
  height: auto;
}

.sp-popup-body { padding: 24px 26px 28px; text-align: center; }

.sp-popup-body h3 {
  font-family: var(--sp-font-title);
  font-size: 1.35rem;
  margin: 0;
}

.sp-popup-body p {
  margin: 10px 0 0;
  font-size: .92rem;
  color: var(--sp-muted);
  white-space: pre-line;
}

.sp-popup-body .sp-btn { margin-top: 18px; }

/* Regla por volumen: la línea que salió más barata por cantidad lo dice, y el
   «te falta poco» va sobre el subtotal, que es donde el comprador decide. */
.sp-item-tier {
  display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; background: #dcfce7; color: #166534;
}
.sp-hint {
  font-size: .8rem; line-height: 1.4; padding: 8px 10px; margin-bottom: 8px;
  border-radius: 8px; background: #fef3c7; color: #92400e;
}
