/**
 * Stacciolla — WooCommerce Single Product (v3)
 * Todos los estilos vía var(--fe-*). Cero valores hardcodeados.
 */

/* ============================================================
   RESET — Anular estilos WooCommerce por defecto
   ============================================================ */

.fe-product .price,
.fe-product .amount {
  all: unset;
}

/* ============================================================
   BASE
   ============================================================ */

.fe-product {
  padding-top: 0;
}


/* ============================================================
   ZONA 1: HERO 60/40
   ============================================================ */

.fe-product__hero {
  width: 100%;
  padding-top: 0;
  overflow: clip; /* clip contiene el overflow sin romper position:sticky en descendientes */
}

.fe-product__hero-inner {
  display: grid;
  grid-template-columns: 60fr 40fr;
  align-items: start;
  gap: 8px;          /* matches body margin so left/top/right borders are equal */
  min-height: 100vh;
}

/* Compensate the narrower grid gap with internal padding on the info panel */
.fe-product__panel {
  padding-left: 22px; /* 22 + 8 gap = 30px total breathing room for text */
}

/* ── Galería carrusel (columna izquierda) ── */

.fe-product__gallery {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--fe-nav-height) + 8px);   /* nav height + same gap as body margin on left/right */
  align-self: start;
}

.fe-product__images {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - var(--fe-nav-height) - 8px);
  overflow: hidden;
  background-color: var(--fe-white);
  cursor: grab;
  user-select: none;
  /* Permite swipe horizontal en la galería aunque body tenga touch-action: pan-y */
  touch-action: pan-x;
}

/* Film-strip track — sits in the grid cell, slides horizontally */
.fe-product__track {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  will-change: transform;
  transition: transform 0.65s ease-in-out;
}

/* Each image fills exactly one "frame" of the strip — edge to edge, no border.
   NOTE: WooCommerce loads ".woocommerce-page img { height: auto; max-width: 100% }"
   with specificity (0,1,1)=11. We use ".fe-product__images img.fe-product__image"
   with specificity (0,2,1)=21 to beat it without needing !important. */
.fe-product__images img.fe-product__image {
  flex: 0 0 100%;
  min-width: 0;
  width: 100%;
  max-width: none;   /* override WC max-width: 100% that can break flex basis */
  height: 100%;      /* override WC height: auto so the image fills the track */
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Each color's image set — stacks in the single grid cell of .fe-product__images.
   overflow:hidden clips the track so only the active frame is visible. */
.fe-product__gallery-set {
  grid-row: 1;
  grid-column: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.fe-product__thumbs {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  justify-self: start;
  z-index: 10;
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 16px;
  margin: 0;
}

.fe-product__thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  opacity: 0.65;
  border-radius: 3px;
  cursor: pointer;
  border: 1.5px solid transparent;
  padding: 0;
  background: none;
  overflow: hidden;
}

.fe-product__thumb--active {
  opacity: 1;
  border: 1.5px solid white;
}

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

/* ── Panel de compra (columna derecha) ── */

.fe-product__panel {
  background-color: var(--fe-white);
  position: relative;
  padding-top: var(--fe-nav-height); /* clear fixed header — gallery stays flush */
}

.fe-product__panel-inner {
  position: -webkit-sticky;
  position: sticky;
  top: var(--fe-nav-height);
  padding: 64px 48px 48px 30px; /* 64px top — clears header + adds breathing room above REF */
  display: flex;
  flex-direction: column;
  gap: var(--fe-space-5);
}

/* ── Wishlist heart ── */

.fe-product__wishlist {
  position: absolute;
  top: 48px;
  right: 48px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fe-warm-gray);
  transition: color var(--fe-transition);
}

.fe-product__wishlist:hover {
  color: var(--fe-gold-dark);
}

.fe-product__wishlist--active {
  color: var(--fe-gold-dark);
}

.fe-product__wishlist--active .fe-product__wishlist-icon path {
  fill: var(--fe-gold-dark);
}

/* ── SKU / Referencia ── */

.fe-product__sku {
  font-family: var(--fe-font-body);
  font-size: 0.65rem;
  color: var(--fe-warm-gray);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* Nombre */
.fe-product__title {
  font-family: var(--fe-font-display);
  font-size: 2.2rem;
  font-weight: var(--fe-weight-light);
  line-height: var(--fe-leading-tight);
  letter-spacing: var(--fe-tracking-tight);
  color: var(--fe-black);
  margin: 0 0 24px;
}

/* ── Rating estrellas ── */

.fe-product__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.fe-product__stars {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--fe-gold-dark);
  font-size: 14px;
}

.fe-product__star--empty {
  color: var(--fe-border-dark);
}

.fe-product__rating-text {
  font-family: var(--fe-font-body);
  font-size: 0.8rem;
  color: var(--fe-warm-gray);
}

/* Precio */
.fe-product__price {
  font-family: var(--fe-font-display);
  font-size: 1.4rem;
  font-weight: var(--fe-weight-regular);
  color: var(--fe-black);
  margin-bottom: 24px;
}

/* Short description */
.fe-product__short-desc {
  font-family: var(--fe-font-body);
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--fe-charcoal);
  margin-top: 16px;
  margin-bottom: 24px;
}

.fe-product__short-desc p {
  margin: 0 0 var(--fe-space-3);
}

.fe-product__short-desc p:last-child {
  margin-bottom: 0;
}

/* ── Option groups (color + size) ── */

.fe-product__option-group {
  display: flex;
  flex-direction: column;
  gap: var(--fe-space-3);
  margin-bottom: 24px;
}

.fe-product__option-label {
  font-family: var(--fe-font-body);
  font-size: 0.7rem;
  letter-spacing: var(--fe-tracking-widest);
  text-transform: uppercase;
  color: var(--fe-warm-gray);
}

.fe-product__option-value {
  color: var(--fe-black);
  font-weight: var(--fe-weight-medium);
}

/* ── Color swatches ── */

.fe-product__swatches {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.fe-product__swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color var(--fe-transition);
  outline: none;
}

/* Keyboard-only focus ring for accessibility */
.fe-product__swatch:focus-visible {
  outline: 2px solid var(--fe-gold-dark);
  outline-offset: 2px;
}

.fe-product__swatch:hover {
  border-color: var(--fe-border-dark);
}

.fe-product__swatch--active {
  border-color: var(--fe-gold-dark);
}

/* ── Unavailable color swatch ── */
.fe-product__swatch--unavailable {
  opacity: 0.42;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Diagonal line — visible on any background color via dual-layer gradient */
.fe-product__swatch--unavailable::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      transparent calc(50% - 0.75px),
      rgba(255, 255, 255, 0.75) calc(50% - 0.75px),
      rgba(255, 255, 255, 0.75) calc(50% + 0.75px),
      transparent calc(50% + 0.75px)
    ),
    linear-gradient(
      135deg,
      transparent calc(50% - 1.5px),
      rgba(0, 0, 0, 0.25) calc(50% - 1.5px),
      rgba(0, 0, 0, 0.25) calc(50% + 1.5px),
      transparent calc(50% + 1.5px)
    );
  border-radius: inherit;
  pointer-events: none;
}

/* Active unavailable swatch — keep gold ring, still dim it */
.fe-product__swatch--active.fe-product__swatch--unavailable {
  border-color: var(--fe-gold-dark);
  opacity: 0.55;
}

/* Hover on unavailable — very subtle lift so it doesn't feel broken */
.fe-product__swatch--unavailable:hover {
  border-color: rgba(0, 0, 0, 0.25);
  opacity: 0.55;
}

/* ── Size buttons ── */

.fe-product__sizes {
  display: flex;
  gap: var(--fe-space-2);
}

.fe-product__size {
  padding: 12px 20px;
  min-width: 72px;
  text-align: center;
  border: 1px solid var(--fe-border-dark);
  background: transparent;
  font-family: var(--fe-font-body);
  font-size: 0.7rem;
  font-weight: var(--fe-weight-regular);
  letter-spacing: 0.1em;
  color: var(--fe-black);
  cursor: pointer;
  transition: all var(--fe-transition);
  border-radius: var(--fe-radius);
}

.fe-product__size:hover {
  border-color: var(--fe-black);
}

.fe-product__size--active {
  background-color: var(--fe-black);
  color: var(--fe-white);
  border-color: var(--fe-black);
}

/* Formulario Add to Cart */
.fe-product__cart-form {
  display: flex;
  flex-direction: column;
  gap: var(--fe-space-4);
}

.fe-product__variation {
  display: none;
}

.fe-product__variation label {
  font-family: var(--fe-font-body);
  font-size: 0.7rem;
  letter-spacing: var(--fe-tracking-widest);
  text-transform: uppercase;
  color: var(--fe-warm-gray);
}

.fe-product__variation select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--fe-border-dark);
  background: transparent;
  font-family: var(--fe-font-body);
  font-size: var(--fe-size-base);
  color: var(--fe-black);
  padding: 0 var(--fe-space-4);
  border-radius: var(--fe-radius);
  -webkit-appearance: none;
}

.fe-product__add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background-color: var(--fe-black);
  color: var(--fe-white);
  font-family: var(--fe-font-body);
  font-size: 0.75rem;
  font-weight: var(--fe-weight-regular);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--fe-radius);
  transition: background-color var(--fe-transition);
}

.fe-product__add-btn:hover {
  background-color: var(--fe-black-soft);
}

.fe-product__add-btn:disabled {
  cursor: not-allowed;
}

/* ── Stock Indicator ── */

.fe-product__stock-indicator {
  /* Base — collapsed and invisible when empty */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin-bottom 0.35s ease;

  font-family: var(--fe-font-body), sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-left: 0.9rem;
  position: relative;
}

.fe-product__stock-indicator::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Visible states — JS adds one of these classes */
.fe-product__stock-indicator--low {
  max-height: 2rem;
  opacity: 0.5;
  margin-bottom: var(--fe-space-3);
  color: var(--fe-black);
}

.fe-product__stock-indicator--very-low {
  max-height: 2rem;
  opacity: 0.9;
  margin-bottom: var(--fe-space-3);
  color: var(--fe-gold-dark); /* warm amber — luxury, not alarming */
}

/* ── Secondary actions — Save for Later + Specialist ── */

.fe-product__secondary-actions {
  display: flex;
  flex-direction: row;
  gap: var(--fe-space-4);
  align-items: center;
  margin-bottom: var(--fe-space-4);
}

.fe-product__wishlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  flex: 1;
  justify-content: center;
  padding: 10px var(--fe-space-4);
  background: transparent;
  border: 1px solid var(--fe-border-dark);
  border-radius: var(--fe-radius);
  font-family: var(--fe-font-body);
  font-size: 0.68rem;
  font-weight: var(--fe-weight-regular);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fe-black);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--fe-transition), color var(--fe-transition);
  white-space: nowrap;
}

.fe-product__wishlist-btn:hover {
  border-color: var(--fe-black);
  color: var(--fe-black);
}

/* ── Inline cart error ── */

.fe-product__cart-error {
  display: block;
  font-family: var(--fe-font-body);
  font-size: 0.78rem;
  color: var(--fe-black);
  margin-top: 12px;
  line-height: 1.6;
  padding: 10px 14px;
  border-left: 2px solid var(--fe-gold);
  background: rgba(184, 152, 106, 0.06);
}

.fe-product__cart-error a {
  color: var(--fe-black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Trust badges ── */

.fe-product__trust-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: var(--fe-space-4);
  border-top: 1px solid var(--fe-border);
}

.fe-product__trust-badge {
  display: flex;
  align-items: center;
  gap: var(--fe-space-3);
}

.fe-product__trust-icon {
  flex-shrink: 0;
  color: var(--fe-warm-gray);
}

.fe-product__trust-badge span {
  font-family: var(--fe-font-body);
  font-size: 0.7rem;
  color: var(--fe-warm-gray);
  line-height: var(--fe-leading-normal);
}


/* ── The Perfect Pair ── */

.fe-product__pair {
  padding-top: var(--fe-space-4);
  border-top: 1px solid var(--fe-border);
}

.fe-product__pair-label {
  display: block;
  font-family: var(--fe-font-body);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fe-warm-gray);
  margin-bottom: 16px;
}

.fe-product__pair-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fe-product__pair-img-link {
  flex-shrink: 0;
}

.fe-product__pair-img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
}

.fe-product__pair-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fe-product__pair-name {
  font-family: var(--fe-font-body);
  font-size: 0.75rem;
  color: var(--fe-black);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--fe-transition);
}

.fe-product__pair-name:hover {
  color: var(--fe-warm-gray);
}

.fe-product__pair-price {
  font-family: var(--fe-font-display);
  font-size: 0.9rem;
  color: var(--fe-warm-gray);
}

.fe-product__pair-add {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--fe-black);
  background: transparent;
  font-family: var(--fe-font-body);
  font-size: 0.65rem;
  font-weight: var(--fe-weight-regular);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fe-black);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--fe-radius);
  transition: background-color var(--fe-transition), color var(--fe-transition);
}

.fe-product__pair-add:hover {
  background-color: var(--fe-black);
  color: var(--fe-white);
}


/* ============================================================
   STICKY BOTTOM BAR
   ============================================================ */

.fe-product__sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background-color: var(--fe-black);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--fe-space-8);
  transform: translateY(100%);
  transition: transform var(--fe-transition-slow);
}

.fe-product__sticky-bar--visible {
  transform: translateY(0);
}

.fe-product__sticky-name {
  font-family: var(--fe-font-display);
  font-size: var(--fe-size-base);
  font-weight: var(--fe-weight-light);
  color: var(--fe-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.fe-product__sticky-price {
  font-family: var(--fe-font-display);
  font-size: var(--fe-size-base);
  color: var(--fe-gold-dark);
  flex-shrink: 0;
  padding-right: 32px;
}

.fe-product__sticky-cta {
  flex-shrink: 0;
  height: 40px;
  padding: 0 32px;
  background-color: var(--fe-gold);
  color: var(--fe-black);
  font-family: var(--fe-font-body);
  font-size: 0.7rem;
  font-weight: var(--fe-weight-medium);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  border-radius: var(--fe-radius);
  transition: background-color var(--fe-transition);
}

.fe-product__sticky-cta:hover {
  background-color: var(--fe-gold-muted);
}


