/* ===== Página del catálogo (bodegondulcero.com/catalogo/, 2026-10-15) =====
   Encabezado de la página principal (solo el logo), franja azul con los
   avisos de precios, barra de botones (Catálogo general · Novedades ·
   Temporada) que se queda fija arriba al bajar, y los productos de la API.
   Celular primero: 2 tarjetas por fila, 3 en tablet y 4 en PC. */
#tienda [hidden],
.detalle [hidden] {
  display: none !important;
}

.sin-scroll {
  overflow: hidden;
}

/* En esta página el encabezado no va fijo: lo que se queda arriba es la barra de botones. */
.pagina-catalogo .header {
  position: relative;
}

/* ---------- Franja azul: avisos + botones ---------- */
.avisos-precios {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding-top: .8rem;
}

.avisos-precios__titulo {
  margin: 0;
  color: #fff;
  font: 800 1.15rem/1.2 'Baloo 2', cursive;
}

.avisos-precios__nota {
  max-width: 760px;
  margin: .2rem auto 0;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Botones de sección con el color de su tarjeta en la página principal:
   Catálogo general azul, Novedades rojo, Temporada amarillo. El elegido va en
   el tono más oscuro de su color, con aro blanco y efecto de presionado. La
   barra se queda fija arriba al bajar. */
.secciones {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blue-dark);
  border-bottom: 4px solid var(--yellow);
  box-shadow: 0 6px 16px rgba(15, 74, 158, 0.2);
}

.secciones__lista {
  display: flex;
  justify-content: center;
  gap: .7rem;
  padding-top: .7rem;
  padding-bottom: .8rem;
}

[data-seccion="general"] { --sec: var(--blue); --sec-oscuro: #0b3d8a; --sec-texto: #fff; }
[data-seccion="novedades"] { --sec: var(--red); --sec-oscuro: #a3150e; --sec-texto: #fff; }
[data-seccion="temporada"] { --sec: var(--yellow); --sec-oscuro: #d99400; --sec-texto: var(--blue-dark); }

.secciones__boton {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.4rem;
  background: var(--sec);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: var(--sec-texto);
  font: 800 1.02rem/1.1 'Baloo 2', cursive;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.secciones__boton:hover {
  border-color: rgba(255, 255, 255, 0.7);
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.secciones__boton.activa {
  background: var(--sec-oscuro);
  border-color: #fff;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.22);
  filter: none;
  transform: none;
}

.secciones__boton:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.secciones__icono {
  font-size: 1.1rem;
}

/* ---------- Productos ---------- */
.cuerpo {
  padding-top: 1.6rem;
  padding-bottom: 3rem;
}

.tienda__titulo {
  margin: 0 0 1rem;
  color: var(--blue-dark);
  font-size: 1.8rem;
  text-align: center;
}

/* Cargando / error / temporada vacía */
.tienda__mensaje {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #6b7688;
  font-weight: 600;
}

.tienda__mensaje p {
  margin: .4rem 0 1rem;
}

.tienda__cargando {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 4px solid rgba(31, 111, 214, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: tienda-giro .8s linear infinite;
}

@keyframes tienda-giro {
  to { transform: rotate(360deg); }
}

.tienda__pronto-icono {
  font-size: 2.6rem;
  letter-spacing: .3rem;
}

.tienda__pronto {
  color: var(--blue-dark);
  font: 800 1.4rem/1.2 'Baloo 2', cursive;
}

/* Buscador y filtros */
.tienda__herramientas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: .6rem;
  margin-bottom: .8rem;
}

.tienda__buscar {
  grid-column: 1 / -1;
}

/* Cada lista con su etiqueta fija arriba ("Categoría" / "Marca"). */
.tienda__campo {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.tienda__etiqueta {
  padding-left: .9rem;
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.tienda__buscar,
.tienda__filtro {
  width: 100%;
  min-width: 0;
  padding: .7rem 1rem;
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 50px;
  color: var(--dark);
  font: 600 .95rem 'Nunito', sans-serif;
  box-shadow: 0 3px 10px rgba(15, 74, 158, 0.08);
}

.tienda__filtro {
  padding-right: 2rem;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tienda__buscar:focus,
.tienda__filtro:focus {
  outline: none;
  border-color: var(--blue-dark);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.2);
}

.tienda__limpiar {
  grid-column: 1 / -1;
  justify-self: start;
  padding: .3rem .2rem;
  background: none;
  border: 0;
  color: var(--red);
  font: 800 .9rem 'Nunito', sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

.tienda__estado {
  margin: 0 0 1rem;
  color: var(--blue-dark);
  font-size: .9rem;
  font-weight: 800;
}

/* Rejilla de tarjetas: la foto, la leyenda de caja y los datos comparten
   filas con las tarjetas de al lado (subgrid), así la línea roja queda
   pareja en toda la fila. */
.tienda__rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 12px;
}

.producto {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 3px solid var(--yellow);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 74, 158, 0.12);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

@supports (grid-template-rows: subgrid) {
  .tienda__rejilla {
    row-gap: 0;
  }

  .producto {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    margin-bottom: 12px;
  }
}

.producto:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 74, 158, 0.2);
}

.producto:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.producto__foto {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
}

.producto__foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.producto:hover .producto__foto img {
  transform: scale(1.05);
}

.producto__caja {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4px;
  margin: 0;
  padding: 2px 6px;
  background: #fff3cd;
  color: var(--blue-dark);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.producto__caja:empty {
  padding: 0;
}

.producto__info {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  border-top: 3px solid var(--red);
}

.producto__nombre {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font: 700 .95rem/1.15 'Baloo 2', cursive;
  overflow-wrap: anywhere;
}

.producto__precios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.producto__precio {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  background: var(--blue);
  border-radius: 50px;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  white-space: nowrap;
}

.producto__precio small {
  font-size: .6rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.producto__precio--mayoreo {
  background: var(--blue-dark);
}

.tienda__mas {
  display: flex;
  margin: 1.2rem auto 0;
}

/* "Ver más" de cada sección en su color. */
.tienda__panel .tienda__mas {
  background: var(--sec);
  color: var(--sec-texto);
}

.tienda__panel .tienda__mas:hover {
  background: var(--sec-oscuro);
}

/* ---------- Pie ---------- */
.pie-catalogo {
  padding: 1.8rem 0;
  text-align: center;
}

.pie-catalogo p {
  margin: 0;
}

.pie-catalogo__informativo {
  max-width: 680px;
  margin: 0 auto !important;
  color: rgba(255, 255, 255, 0.9);
  font-size: .85rem;
  line-height: 1.45;
}

.pie-catalogo__copyright {
  margin-top: .7rem !important;
  font-size: .85rem;
  font-weight: 700;
}

.pie-catalogo__inicio {
  display: inline-block;
  margin-top: .8rem;
  color: var(--yellow);
  font-weight: 800;
  text-decoration: none;
}

.pie-catalogo__inicio:hover {
  text-decoration: underline;
}

/* ---------- Tablet y PC ---------- */
@media (min-width: 640px) {
  .tienda__herramientas {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .tienda__buscar {
    grid-column: auto;
  }

  .tienda__rejilla {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 20px;
  }

  .producto {
    margin-bottom: 20px;
  }

  .producto__info {
    padding: 12px 14px 14px;
  }

  .producto__nombre {
    font-size: 1.05rem;
  }

  .producto__caja {
    font-size: .68rem;
  }
}

@media (min-width: 960px) {
  .tienda__rejilla {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 24px;
  }

  .producto {
    margin-bottom: 24px;
  }
}

/* ---------- Celular ---------- */
@media (max-width: 600px) {
  .pagina-catalogo .header__inner {
    padding-top: .45rem;
    padding-bottom: .45rem;
  }

  .pagina-catalogo .logo__image {
    max-height: 44px;
  }

  .avisos-precios {
    padding-top: .55rem;
  }

  .avisos-precios__titulo {
    font-size: .98rem;
  }

  .avisos-precios__nota {
    font-size: .7rem;
    line-height: 1.3;
  }

  /* Los tres botones repartidos a lo ancho, icono arriba */
  .secciones__lista {
    gap: .4rem;
    padding: .5rem .6rem .6rem;
  }

  .secciones__boton {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: .1rem;
    padding: .35rem .3rem;
    border-radius: 14px;
    font-size: .85rem;
    white-space: normal;
    text-align: center;
  }

  .secciones__icono {
    font-size: 1.15rem;
  }

  .cuerpo {
    padding-top: 1.1rem;
  }

  .tienda__titulo {
    font-size: 1.35rem;
  }

  .tienda__buscar,
  .tienda__filtro {
    padding: .6rem .8rem;
    font-size: .86rem;
  }

  .tienda__filtro {
    padding-left: .7rem;
    padding-right: 1.3rem;
  }
}

/* ===== Detalle del producto (ventana emergente) =====
   Foto a la izquierda y datos a la derecha en PC; en celular, foto arriba.
   Se cierra tocando en cualquier parte. */
.detalle {
  width: min(860px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 4px solid var(--yellow);
  border-radius: 20px;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.detalle::backdrop {
  background: rgba(15, 27, 51, 0.6);
  backdrop-filter: blur(3px);
}

.detalle[open] {
  animation: detalle-entra .28s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes detalle-entra {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
}

.detalle__ventana {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.detalle__cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 2px solid var(--blue-dark);
  border-radius: 50%;
  color: var(--blue-dark);
  font: 800 1rem/1 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.detalle__foto {
  aspect-ratio: 1 / 1;
  max-height: 55vh;
  max-height: 55dvh;
  background: #fff;
}

.detalle__foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detalle__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 20px;
  border-top: 3px solid var(--red);
  text-align: center;
}

.detalle__nombre {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1.4rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.detalle__precios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 130px));
  gap: 8px;
}

.detalle__precio {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 5px 8px;
  background: var(--blue);
  border-radius: 12px;
  color: #fff;
  white-space: nowrap;
}

.detalle__precio--mayoreo {
  background: var(--blue-dark);
}

.detalle__precio small {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.detalle__precio span {
  font: 800 1.15rem/1.1 'Baloo 2', cursive;
}

.detalle__piezas {
  margin: 0;
  padding: 6px 14px;
  background: #fff3cd;
  border: 2px solid var(--yellow);
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 700;
}

.detalle__nota {
  margin: 0;
  color: #6c757d;
  font-size: .85rem;
}

@media (min-width: 700px) {
  .detalle__ventana {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }

  .detalle__foto {
    max-height: none;
  }

  .detalle__info {
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    padding: 28px 28px 22px;
    border-top: 0;
    border-left: 3px solid var(--red);
    text-align: left;
  }

  .detalle__nombre {
    margin-bottom: auto;
    padding-right: 36px;
    font-size: 1.8rem;
  }

  .detalle__nombre::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 12px;
    background: var(--red);
    border-radius: 999px;
  }

  .detalle__precios {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detalle__precio {
    justify-content: center;
    min-height: 56px;
  }

  .detalle__piezas {
    border-radius: 12px;
    text-align: center;
  }

  .detalle__nota {
    margin-top: auto;
    padding-top: 12px;
    border-top: 2px solid #eef2f8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detalle[open],
  .tienda__cargando {
    animation: none;
  }
}
