/* ============================================================
   KZA DESIGN — PRODUCTO.CSS
   Estilos exclusivos para páginas de producto individual.
   Corrige conflictos entre style.css y kza.css.
   ============================================================ */

/* ── RESET ESPECÍFICO PRODUCTO ──────────────
   Neutraliza reglas de kza.css que rompen el layout
   de producto (body oscuro, h1/h2 con color incorrecto, etc.)
   ─────────────────────────────────────────── */
body.page-producto {
  background: var(--white);
  color: var(--dark);
}
body.page-producto h1,
body.page-producto h2,
body.page-producto h3,
body.page-producto h4 {
  font-family: var(--font-display);
  color: var(--dark);
}

/* ── HERO DEL PRODUCTO ──────────────────────
   Contenedor con imagen de fondo, altura fija,
   SIN conflicto con el .hero del home
   ─────────────────────────────────────────── */
.prod-hero {
  position: relative;
  height: 52vh;
  min-height: 340px;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  /* Asegura que no hereda background oscuro de kza.css */
  background: var(--cream);
}
.prod-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.04);
  transition: transform 8s ease-out;
}
.prod-hero-img.loaded { transform: scale(1); }
.prod-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(14,13,12,.65) 0%,
    rgba(14,13,12,.18) 55%,
    transparent 100%);
  z-index: 1;
}
.prod-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--pad-x) clamp(2rem, 4vw, 3rem);
  width: 100%;
  max-width: calc(var(--max-w) + var(--pad-x)*2);
  margin: 0 auto;
}
.prod-hero-kicker {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.prod-hero-kicker::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}
.prod-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 300;
  color: var(--white);
  line-height: 1;
  letter-spacing: -.02em;
}
.prod-hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,.5);
  margin-top: .5rem;
}

/* ── BREADCRUMB ─────────────────────────────── */
.breadcrumb-wrap {
  padding: 1.1rem var(--pad-x);
  max-width: calc(var(--max-w) + var(--pad-x)*2);
  margin: 0 auto;
  font-size: .78rem;
  color: var(--mid-grey);
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  /* Reset por si kza.css pisa algo */
  background: none;
  border: none;
}
.breadcrumb-wrap a { color: inherit; transition: color .2s; }
.breadcrumb-wrap a:hover { color: var(--dark); }
.breadcrumb-sep { opacity: .45; }

/* ── PRODUCT PAGE CONTAINER ─────────────────
   CRÍTICO: Sobreescribe el padding-top que da el
   style.css global (.product-page con calc(80px + 3rem))
   En páginas de producto el hero ya maneja el espacio
   ─────────────────────────────────────────── */
body.page-producto .product-page {
  padding: 0 var(--pad-x) var(--section-gap);
  max-width: calc(var(--max-w) + var(--pad-x)*2);
  margin: 0 auto;
}

/* ── PRODUCT GRID ──────────────────────────── */
body.page-producto .product-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 900px) {
  body.page-producto .product-page-grid {
    grid-template-columns: 1fr;
  }
}

/* ── GALERÍA PRINCIPAL ─────────────────────── */
body.page-producto .product-gallery-main {
  position: sticky;
  top: 100px;
}

/* Foto principal: contenedor con aspect-ratio fijo */
body.page-producto .main-photo-wrap {
  position: relative;
  background: var(--cream);
  overflow: hidden;
  aspect-ratio: 4/3;  /* ratio consistente en todas las páginas */
  cursor: zoom-in;
}
body.page-producto .main-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  pointer-events: none;
}

/* CRÍTICO: La foto principal ocupa TODO el contenedor.
   kza.css tiene .product-img-wrap img con aspect-ratio:1 que
   corrompe el tamaño. Aquí lo reseteamos explícitamente. */
body.page-producto .main-photo {
  position: absolute;     /* ← Posicionada dentro del contenedor */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform .7s cubic-bezier(.25,.46,.45,.94), opacity .3s;
  /* Reset de cualquier aspect-ratio heredado */
  aspect-ratio: auto;
}
body.page-producto .main-photo.switching {
  opacity: 0;
  transform: scale(1.02);
}

/* ── MINIATURAS ─────────────────────────────
   CRÍTICO: style.css global pone .product-thumbs como
   grid de 4 columnas. kza.css las pone cuadradas.
   Aquí forzamos flex con aspect-ratio horizontal.
   ─────────────────────────────────────────── */
body.page-producto .product-thumbs {
  display: flex;          /* ← flex, NO grid */
  gap: 8px;
  margin-top: 8px;
  /* Reset de grid que viene del CSS global */
  grid-template-columns: none;
}
body.page-producto .product-thumbs img {
  flex: 1;
  min-width: 0;
  /* Ratio 4:3 igual que la foto principal, NO cuadrado */
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: center center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s, opacity .2s;
  opacity: .65;
  /* Reset de width fijo que pudiera haber */
  width: auto;
  height: auto;
}
body.page-producto .product-thumbs img:hover { opacity: .9; }
body.page-producto .product-thumbs img.active {
  border-color: var(--dark);
  opacity: 1;
}

/* ── ZOOM HINT ──────────────────────────────── */
.zoom-hint {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(253,252,250,.88);
  backdrop-filter: blur(8px);
  padding: .35rem .65rem;
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mid-grey);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
body.page-producto .main-photo-wrap:hover .zoom-hint { opacity: 1; }

/* ── DETALLE DEL PRODUCTO ───────────────────── */
body.page-producto .product-detail { padding-top: .5rem; }

body.page-producto .product-detail-cat {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .6rem;
  /* Reset de kza.css */
  font-family: var(--font-body);
  opacity: 1;
}
body.page-producto .product-detail-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  color: var(--dark);
  line-height: 1;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
}
body.page-producto .product-detail-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent-light);
  margin-bottom: 1.4rem;
  line-height: 1.5;
}
body.page-producto .product-detail-desc {
  font-size: .93rem;
  color: var(--mid-grey);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.product-divider {
  border: none;
  border-top: 1px solid var(--sand);
  margin: 1.75rem 0;
}

/* ── SPECS ──────────────────────────────────── */
body.page-producto .product-spec-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--sand);
  margin: 1.75rem 0;
}
body.page-producto .product-spec {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--sand);
  border-right: 1px solid var(--sand);
  background: none; /* reset */
}
body.page-producto .product-spec:nth-child(even) { border-right: none; }
body.page-producto .product-spec:nth-last-child(-n+2) { border-bottom: none; }
body.page-producto .product-spec .label {
  font-size: .63rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--warm-grey);
  font-family: var(--font-body);
}
body.page-producto .product-spec .value {
  font-size: .88rem;
  color: var(--dark);
  font-family: var(--font-body);
}

/* ── SELECTOR DE COLOR ──────────────────────── */
body.page-producto .product-color-selector { margin: 1.75rem 0; }
body.page-producto .product-color-selector h4 {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: .9rem;
}
body.page-producto .product-color-selector h4 span {
  color: var(--accent-light);
  font-weight: 400;
}
body.page-producto .color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
body.page-producto .swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform .2s;
  outline: none;
  border: none;
  /* Evita que kza.css ponga border-radius:8px */
}
body.page-producto .swatch-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color .2s;
}
body.page-producto .swatch-btn:hover { transform: scale(1.12); }
body.page-producto .swatch-btn.active::after { border-color: var(--dark); }

/* ── SELECTOR DE TALLA ──────────────────────── */
.size-selector { margin: 1.5rem 0; }
.size-selector h4 {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: .9rem;
}
.size-options { display: flex; gap: 10px; }
.size-btn {
  padding: .55rem 1.4rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  border: 1px solid var(--sand);
  color: var(--mid-grey);
  background: transparent;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
  border-radius: 0; /* reset de kza.css que usa border-radius */
}
.size-btn:hover { border-color: var(--dark); color: var(--dark); }
.size-btn.active { background: var(--dark); border-color: var(--dark); color: var(--white); }

/* ── BOTONES DE ACCIÓN ──────────────────────── */
body.page-producto .product-page-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.25rem;
}
body.page-producto .product-page-actions .btn-primary {
  flex: 1;
  min-width: 180px;
  justify-content: center;
  /* Asegura que no hereda estilos de kza.css .btn-primary */
  border-radius: 0;
  background: var(--dark);
  color: var(--white);
  border: 1px solid var(--dark);
  padding: .95rem 2.25rem;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
body.page-producto .product-page-actions .btn-primary:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
  transform: none; /* reset el translateY(-2px) de kza.css */
  box-shadow: none;
}
body.page-producto .product-page-actions .btn-ghost-dark {
  flex: 0 0 auto;
  border-radius: 0;
  padding: .95rem 2.25rem;
}

.product-note {
  font-size: .72rem;
  color: var(--mid-grey);
  letter-spacing: .04em;
  line-height: 1.8;
}

/* ── TARJETAS DE PRODUCTO RELACIONADAS ─────────
   CRÍTICO: Sobreescribe las tarjetas de kza.css
   que tienen background oscuro, border-radius, hover con
   transform translateY que rompe el layout
   ─────────────────────────────────────────── */
body.page-producto .product-card {
  background: var(--white);
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: background var(--t-fast);
  position: relative;
  transform: none !important; /* anula el translateY(-6px) de kza.css */
  box-shadow: none !important;
}
body.page-producto .product-card:hover {
  background: var(--cream);
  border-color: transparent;
}

/* Contenedor de imagen de tarjeta de producto */
body.page-producto .product-card .product-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  aspect-ratio: 5/6;  /* ratio vertical para tarjetas */
  border-radius: 0;
}

/* Imagen dentro de tarjeta — sin interferencia de kza.css */
body.page-producto .product-card .product-img-wrap img,
body.page-producto .product-card .product-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto; /* reset */
  transition: transform var(--t-slow) var(--ease);
  border-radius: 0;
}
body.page-producto .product-card:hover .product-img-wrap img,
body.page-producto .product-card:hover .product-img { transform: scale(1.05); }

/* Oculta los botones de hover de kza.css en tarjetas */
body.page-producto .product-actions-hover { display: none; }

body.page-producto .product-info {
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  background: var(--white);
}
body.page-producto .product-card:hover .product-info { background: var(--cream); }

body.page-producto .product-card .product-cat {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .4rem;
  opacity: 1; /* reset kza .65 */
  font-family: var(--font-body);
}
body.page-producto .product-card .product-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--dark);
  margin-bottom: .6rem;
  letter-spacing: .02em;
}
body.page-producto .product-card .product-cta {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color var(--t-fast);
  display: flex;
  align-items: center;
  gap: .5rem;
}
body.page-producto .product-card:hover .product-cta { color: var(--gold); }

/* Oculta el precio/botón de añadir al carrito de kza.css */
body.page-producto .product-card .product-footer { display: none; }
body.page-producto .product-card .product-price { display: none; }
body.page-producto .product-card .add-cart-btn { display: none; }

/* ── RELATED / CATALOG GRID ─────────────────── */
body.page-producto .related-grid,
body.page-producto .related-inner .related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--sand);
}
@media (max-width: 640px) {
  body.page-producto .related-grid { grid-template-columns: 1fr 1fr; }
}

/* ── SECCIÓN HISTORIA / STORY ───────────────── */
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}
@media (max-width: 768px) {
  .story-grid { grid-template-columns: 1fr; }
}

/* ── FEATURES ICONS ─────────────────────────── */
body.page-producto .features-strip {
  background: var(--cream);
  padding: 3rem var(--pad-x);
}
body.page-producto .features-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  text-align: center;
}

/* ── REVIEWS ────────────────────────────────── */
.product-reviews-section {
  background: var(--charcoal);
  padding: var(--section-gap) var(--pad-x);
}
.reviews-inner { max-width: var(--max-w); margin: 0 auto; }
.reviews-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.score-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1;
}
.score-stars { color: var(--gold); font-size: 1.1rem; letter-spacing: .1rem; }
.score-count { font-size: .75rem; color: var(--warm-grey); margin-top: .25rem; }
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.06);
}
@media (max-width: 768px) { .reviews-grid { grid-template-columns: 1fr; } }
.review-card {
  background: var(--charcoal);
  padding: 2rem 1.75rem;
}
.review-stars { color: var(--gold); font-size: .9rem; margin-bottom: .9rem; letter-spacing: .1rem; }
.review-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.review-author { font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; color: var(--warm-grey); }
.review-location { font-size: .7rem; color: rgba(255,255,255,.25); margin-top: .2rem; }

/* ── STICKY CTA MÓVIL ───────────────────────── */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(253,252,250,.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--sand);
  padding: .85rem var(--pad-x);
  z-index: 999;
  gap: .75rem;
}
@media (max-width: 768px) {
  .sticky-cta { display: flex; }
  .sticky-cta .btn-primary {
    flex: 1;
    justify-content: center;
    border-radius: 0;
    background: var(--dark);
    color: var(--white);
    border: 1px solid var(--dark);
  }
}

/* ── WHATSAPP FLOAT ─────────────────────────── */
.whatsapp-float-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  z-index: 9997;
  transition: transform .3s ease, box-shadow .3s ease;
}
.whatsapp-float-btn:hover {
  transform: scale(1.1) rotate(8deg);
  box-shadow: 0 6px 28px rgba(37,211,102,.6);
}
@media (max-width: 768px) {
  .whatsapp-float-btn { bottom: 90px; right: 16px; width: 48px; height: 48px; }
}

/* ── LIGHTBOX ───────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,13,12,.94);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
  border: none;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ── RESPONSIVE SPECS ───────────────────────── */
@media (max-width: 600px) {
  body.page-producto .product-spec-list { grid-template-columns: 1fr; }
  body.page-producto .product-spec { border-right: none !important; }
  body.page-producto .product-spec:last-child { border-bottom: none; }
}
@media (max-width: 480px) {
  body.page-producto .product-page-actions {
    flex-direction: column;
  }
  body.page-producto .product-page-actions .btn-primary,
  body.page-producto .product-page-actions .btn-ghost-dark {
    width: 100%;
    justify-content: center;
  }
}
