@import url("variables.css");

/* =========================
   BASE / TOKENS
========================= */
:root {
  --bg: #070a12;
  --panel: rgba(255, 255, 255, 0.06);
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);

  --text: #e8ecff;
  --muted: rgba(232, 236, 255, 0.7);

  --accent: #22d3ee; /* neon cyan */
  --accent2: #a78bfa; /* neon violet */
  --danger: #ff4d6d;

  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadowHover: 0 20px 55px rgba(0, 0, 0, 0.6);

  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Si tu body ya está definido en base.css, esto igual ayuda en la página producto */
body {
  background:
    radial-gradient(circle at top, rgba(34, 211, 238, 0.08), transparent 55%),
    radial-gradient(
      circle at 70% 20%,
      rgba(167, 139, 250, 0.1),
      transparent 55%
    ),
    var(--bg);
  color: var(--text);
}

/* =========================
   HEADER PRODUCTO (TÍTULO + PRECIO FULL WIDTH)
========================= */
.producto-header {
  grid-column: 1 / -1;
  position: relative;
  margin-bottom: 0.75rem;
}

.producto-header h1 {
  font-size: 1.8rem;
  margin: 0 0 0.2rem;
}

.producto-header .precios {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

/* =========================
   CONTENEDOR GENERAL
========================= */
.producto-detalle {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
}

/* =========================
   GALERÍA
========================= */
.galeria {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Caja principal (glass) */
.galeria-principal {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow);
  height: 420px;
  max-height: 60vh;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen / iframe ocupando el alto fijo */
.galeria-principal img,
.galeria-principal iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(255, 255, 255, 0.92);
}

/* Miniaturas */
.galeria-miniaturas {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.galeria-miniaturas img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
  background: rgba(255, 255, 255, 0.9);
}

.galeria-miniaturas img:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  border-color: rgba(34, 211, 238, 0.35);
}

/* =========================
   INFO PRODUCTO
========================= */
.info-producto {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-producto h1 {
  font-size: 1.6rem;
}

/* bloque “panel” para descripción + form (opcional) */
.info-producto > p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Precio */
.titulo-precio {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.precios {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.precio {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--text);
}

.precio-oferta {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--accent);
}

.precio-original {
  font-size: 0.95rem;
  text-decoration: line-through;
  color: rgba(232, 236, 255, 0.55);
}

/* =========================
   FORMULARIO COMPRA (GLASS)
========================= */
#form-compra {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

#form-compra label {
  font-size: 0.85rem;
  color: rgba(232, 236, 255, 0.85);
}

#form-compra input,
#form-compra select {
  padding: 0.55rem 0.7rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

#form-compra input::placeholder {
  color: rgba(232, 236, 255, 0.55);
}

#form-compra input[type="checkbox"] {
  width: auto;
  margin-right: 0.3rem;
}

#form-compra > label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Focus */
#form-compra input:focus,
#form-compra select:focus {
  outline: 3px solid rgba(34, 211, 238, 0.3);
  outline-offset: 2px;
}

/* =========================
   BOTONES WHATSAPP (NEON)
========================= */
.botones-whatsapp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.botones-whatsapp button {
  flex: 1;
  min-width: 160px;
  padding: 0.68rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;

  color: #071018;
  font-weight: 900;

  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.95),
    rgba(167, 139, 250, 0.9)
  );
  box-shadow: 0 16px 42px rgba(34, 211, 238, 0.14);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.15s ease;
}

.botones-whatsapp button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 22px 60px rgba(34, 211, 238, 0.18);
}

/* Texto suave */
.texto-suave {
  font-size: 0.85rem;
  color: rgba(232, 236, 255, 0.65);
}

/* =========================
   THUMBNAILS (OTRA SECCIÓN)
========================= */
.galeria-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.galeria-thumbs .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  background: rgba(255, 255, 255, 0.9);
}

.galeria-thumbs .thumb:hover {
  border-color: rgba(34, 211, 238, 0.45);
  transform: scale(1.05);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.galeria-thumbs .thumb.active {
  border-color: rgba(34, 211, 238, 0.75);
}

/* =========================
   VIDEO YOUTUBE
========================= */
.video-producto {
  margin-top: 20px;
  position: relative;
  padding-bottom: 56.25%;
  width: 100%;
  max-width: 800px;
  height: 0;
}

.video-producto iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Thumb video */
.video-thumb {
  position: relative;
}

.video-thumb::after {
  content: "▶";
  position: absolute;
  color: #071018;
  font-size: 24px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.95),
    rgba(167, 139, 250, 0.9)
  );
  border-radius: 50%;
  padding: 8px 12px;
  box-shadow: 0 16px 42px rgba(34, 211, 238, 0.18);
}

/* === FIX VIDEO DENTRO DE GALERÍA === */
.galeria-principal .video-producto {
  width: 100%;
  max-width: 100%;
}

/* =========================
   FLECHAS GALERÍA
========================= */
.galeria-flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #071018;
  font-size: 28px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  z-index: 5;

  background: rgba(255, 255, 255, 0.92);
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}

.galeria-flecha:hover {
  transform: translateY(-50%) scale(1.05);
  filter: brightness(1.02);
}

.galeria-flecha.izquierda {
  left: 12px;
}
.galeria-flecha.derecha {
  right: 12px;
}

/* =========================
   BADGE OFERTA (PRODUCTO)
========================= */
.badge-oferta {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(34, 211, 238, 0.92);
  color: #071018;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.titulo-con-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   COMPARTIR
========================= */
.titulo-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-compartir {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
  backdrop-filter: blur(12px);
}

.btn-compartir:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.btn-compartir i {
  font-size: 18px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  .producto-detalle {
    grid-template-columns: 1fr;
  }

  .galeria-principal {
    height: 320px;
  }
}

@media (max-width: 600px) {
  .botones-whatsapp {
    flex-direction: column;
  }
}
/* Select cerrado: dark */
.filtros-form select,
#form-compra select {
  background: rgba(0, 0, 0, 0.35);
  color: #e8ecff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Desplegable (options): claro para máxima legibilidad */
.filtros-form select option,
#form-compra select option {
  background: #ffffff;
  color: #111111;
}

/*PARA VER EL LAS FOTOS EN GRANDE... */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  z-index: 9999;
}
.lb.is-open {
  display: block;
}

/* Capa del contenido (debajo de botones) */
.lb-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 1; /* ✅ */
}

#lbImg {
  max-width: min(96vw, 980px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 14px;
}

/* Botón cerrar siempre arriba */
.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  z-index: 3; /* ✅ */
  touch-action: manipulation; /* ✅ mobile */
}

/* Flechas arriba */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(39, 39, 39, 0.637);
  color: #fff;
  font-size: 26px;
  z-index: 3; /* ✅ */
  touch-action: manipulation; /* ✅ mobile */
}

.lb-prev {
  left: 14px;
}
.lb-next {
  right: 14px;
}

@media (max-width: 480px) {
  .lb-nav {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}
