/* ── TIENDA HERO ─────────────────────────────────────── */
.tienda-main {
  padding-top: 60px; /* altura del nav fijo */
}

.tienda-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  padding: 48px 0 36px;
  text-align: center;
  color: var(--white);
}

.tienda-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.tienda-hero p {
  font-size: 1.05rem;
  opacity: 0.85;
}

/* ── DESTACADOS ─────────────────────────────────────── */
#destacados {
  padding: 56px 0 0;
}

.destacados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

/* ── FILTROS ─────────────────────────────────────────── */
#filtros {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 12px 0;
}

.filtros-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filtro {
  background: var(--sky);
  border: 1.5px solid transparent;
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-dark);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  font-family: inherit;
}

.filtro:hover {
  background: var(--blue-light);
  color: var(--white);
}

.filtro.activo {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* ── GRILLA DE PRODUCTOS ─────────────────────────────── */
#catalogo {
  padding: 40px 0 80px;
}

.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.productos-loading,
.productos-empty {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  padding: 48px 0;
}

/* ── CARD DE PRODUCTO ────────────────────────────────── */
.producto-card {
  background: var(--white);
  border: 1.5px solid rgba(26, 127, 193, 0.12);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(26, 127, 193, 0.07);
  cursor: pointer;
}

.producto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(26, 127, 193, 0.14);
}

.producto-card.sin-stock {
  opacity: 0.55;
}

.producto-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.producto-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.producto-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1.3;
}

.producto-card .descripcion {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
}

.producto-card .precio {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--blue);
}

.producto-card .unidad {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -4px;
}

.btn-agregar {
  margin-top: 8px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}

.btn-agregar:hover {
  background: var(--blue-dark);
}

.badge-sin-stock {
  margin-top: 8px;
  background: #e0e0e0;
  color: #777;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── MODAL DE PRODUCTO ───────────────────────────────── */
.producto-modal[hidden] {
  display: none;
}

.producto-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.producto-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.producto-modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.producto-modal__cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s;
}

.producto-modal__cerrar:hover {
  background: var(--sky);
}

.producto-modal__media {
  background: var(--sky);
}

.producto-modal__body {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.producto-modal__body h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1.25;
}

.producto-modal__body .precio {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--blue);
}

.producto-modal__body .unidad {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -6px;
}

.producto-modal__body .descripcion {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
  margin: 6px 0 12px;
}

.producto-modal__body .btn-agregar {
  align-self: flex-start;
  padding: 12px 24px;
}

/* ── CARRUSEL ────────────────────────────────────────── */
.carrusel {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 320px;
}

.carrusel__track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.carrusel__slide {
  flex: 0 0 100%;
  height: 100%;
}

.carrusel__slide img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.carrusel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--blue-dark);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}

.carrusel__nav:hover {
  background: var(--white);
}

.carrusel__nav--prev { left: 10px; }
.carrusel__nav--next { right: 10px; }

.carrusel__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.carrusel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.carrusel__dot.activo {
  background: var(--blue);
}

/* Una sola imagen: ocultar flechas y dots */
.carrusel--unica .carrusel__nav,
.carrusel--unica .carrusel__dots {
  display: none;
}

/* ── CARRITO LATERAL ─────────────────────────────────── */
#carrito {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 100vw);
  background: var(--white);
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

#carrito.abierto {
  transform: translateX(0);
}

.carrito-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.carrito-header h2 {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--blue-dark);
}

#btn-cerrar-carrito {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

#btn-cerrar-carrito:hover {
  background: var(--sky);
}

#carrito-lista {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 12px 0;
}

#carrito-lista li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.carrito-item__nombre {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  grid-column: 1 / -1;
}

.carrito-item__precio {
  font-size: 0.9rem;
  color: var(--blue);
  font-weight: 700;
}

.carrito-item__controles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carrito-item__controles button {
  background: var(--sky);
  border: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--blue-dark);
  font-weight: 700;
  transition: background 0.15s;
}

.carrito-item__controles button:hover {
  background: var(--blue-light);
  color: var(--white);
}

.carrito-item__cantidad {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.btn-quitar {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.btn-quitar:hover {
  color: #e53e3e;
  background: #fff0f0;
}

.carrito-footer {
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.carrito-total {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--blue-dark);
  text-align: right;
}

.btn-confirmar {
  background: #25d366;
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}

.btn-confirmar:hover {
  background: #1ebe5c;
}

/* ── OVERLAY ─────────────────────────────────────────── */
#carrito-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 190;
}

#carrito-overlay.visible {
  display: block;
}

/* ── BOTÓN FLOTANTE ──────────────────────────────────── */
#btn-carrito-flotante {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s, transform 0.18s;
}

#btn-carrito-flotante:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
}

.carrito-count {
  background: var(--white);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  border-radius: 50px;
  padding: 2px 8px;
  line-height: 1.4;
}

/* ── ACTIVE NAV LINK ─────────────────────────────────── */
.nav__link--active {
  color: var(--blue) !important;
}

/* ── MOBILE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav__links {
    gap: 14px;
  }

  .nav__links a {
    font-size: 0.78rem;
  }

  .productos-grid,
  .destacados-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  #btn-carrito-flotante {
    bottom: 18px;
    right: 18px;
    padding: 12px 16px;
    font-size: 1.15rem;
  }

  .producto-modal {
    padding: 0;
  }

  .producto-modal__dialog {
    grid-template-columns: 1fr;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }

  .carrusel {
    min-height: 0;
  }

  .carrusel__slide img {
    aspect-ratio: 1;
    height: auto;
  }
}

/* ── CHECKOUT MODAL ──────────────────────────────────── */
#btn-finalizar {
  background: var(--blue);
}
#btn-finalizar:hover {
  background: var(--blue-dark);
}

.checkout-modal[hidden] {
  display: none;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.checkout-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.checkout-modal__dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 28px 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.checkout-modal__cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--sky);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--blue-dark);
  transition: background 0.15s;
}
.checkout-modal__cerrar:hover {
  background: var(--blue-light);
}

.checkout-paso[hidden] {
  display: none;
}
.checkout-paso h3 {
  color: var(--blue-dark);
  margin-bottom: 18px;
  font-size: 1.15rem;
}

.checkout-opcion {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: var(--sky);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.checkout-opcion:hover {
  border-color: var(--blue);
  background: var(--white);
}
.checkout-opcion__titulo {
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 1rem;
}
.checkout-opcion__desc {
  font-size: 0.85rem;
  color: var(--muted);
}

.checkout-volver {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0 0 12px;
}

.checkout-campos {
  display: grid;
  gap: 10px;
}
.checkout-campos input,
.checkout-campos select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cdd9e3;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
}
.checkout-campos input:focus,
.checkout-campos select:focus {
  outline: none;
  border-color: var(--blue);
}

.checkout-resumen {
  margin: 18px 0;
  border-top: 1px solid #e3ecf3;
  padding-top: 14px;
}
.checkout-resumen__fila {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 3px 0;
  color: var(--text);
}
.checkout-resumen__fila--muted {
  color: var(--muted);
}
.checkout-resumen__fila--total {
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 1.05rem;
  margin-top: 6px;
  border-top: 1px solid #e3ecf3;
  padding-top: 8px;
}

#btn-pagar {
  width: 100%;
  background: var(--blue);
}
#btn-pagar:hover {
  background: var(--blue-dark);
}
#btn-pagar:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── MENSAJE DE RETORNO DE PAGO ───────────────────────────────────────────── */

.pago-mensaje {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pago-mensaje__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.pago-mensaje__dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 400px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.pago-mensaje__icono {
  font-size: 3rem;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.pago-mensaje__dialog h3 {
  color: var(--blue-dark);
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.pago-mensaje__dialog p {
  color: #444;
  margin: 0 0 22px;
  line-height: 1.5;
}

.pago-mensaje__cerrar {
  width: 100%;
  background: var(--blue);
}
.pago-mensaje__cerrar:hover {
  background: var(--blue-dark);
}
