/**
 * Verde Encanto — Product Page · Luxury Edition
 * Galería profesional: miniaturas a la izquierda, imagen principal optimizada
 * Diseño joyería de lujo: simetría, elegancia, atención al detalle
 */

/* ═══════════════════════════════════════════════════
   LAYOUT PRINCIPAL — Producto individual
   ═══════════════════════════════════════════════════ */

/* Contenedor principal del producto */
.single-product .ast-woocommerce-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ═══════════════════════════════════════════════════
   HERO DEL PRODUCTO — banner de Astra restilizado
   (mismo estilo que el hero de la tienda)
   ═══════════════════════════════════════════════════ */
.single-product .ast-single-entry-banner {
  position: relative;
  background: #0c2310;
  padding: 3rem 1.5rem 2.75rem;
  text-align: center;
  overflow: hidden;
}

.single-product .ast-single-entry-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 50% -10%, rgba(46, 125, 50, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.single-product .ast-single-entry-banner .entry-title {
  position: relative;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: capitalize;
}

/* Línea dorada decorativa bajo el título */
.single-product .ast-single-entry-banner .entry-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  background: #D4AF37;
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* Ocultar meta de blog (autor / comentarios / fecha) que no aplica a productos */
.single-product .ast-single-entry-banner .entry-meta {
  display: none;
}

.single-product .product {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: flex-start;
}

/* ═══════════════════════════════════════════════════
   GALERÍA — Miniaturas IZQUIERDA + Imagen principal
   ═══════════════════════════════════════════════════ */

.single-product .woocommerce-product-gallery {
  width: 46% !important;
  min-width: 340px;
  display: flex;
  flex-direction: row-reverse; /* Miniaturas a la izquierda, imagen principal a la derecha */
  gap: 1rem;
  align-items: flex-start;
  opacity: 1 !important;
}

/* El marco visual vive en .ve-product-main-image-col (style.css);
   el wrapper solo distribuye las columnas */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
  flex: 1;
  margin: 0 auto;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image {
  border-radius: 12px;
  overflow: hidden;
  background: #fdfdfc;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 520px;
  transition: transform 0.4s ease;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a {
  display: block;
  cursor: zoom-in;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a:hover img {
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════
   MINIATURAS (flex-control-thumbs) — Columna izquierda
   ═══════════════════════════════════════════════════ */

.single-product .woocommerce-product-gallery .flex-control-nav,
.single-product .woocommerce-product-gallery .flex-control-thumbs {
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.6rem !important;
  width: 80px !important;
  min-width: 80px !important;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.3rem;
  margin: 0 !important;
  list-style: none !important;
}

/* Scrollbar fina para miniaturas */
.single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar {
  width: 3px;
}
.single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-track {
  background: transparent;
}
.single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar-thumb {
  background: #d4c5a0;
  border-radius: 10px;
}

/* Cada miniatura */
.single-product .woocommerce-product-gallery .flex-control-thumbs li {
  width: 80px !important;
  height: 80px !important;
  flex-shrink: 0;
  float: none !important;
  margin: 0 !important;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafaf8;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li:hover {
  border-color: #d4c5a0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li:hover img {
  opacity: 0.9;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active {
  opacity: 1;
}

.single-product .woocommerce-product-gallery .flex-control-thumbs li img.flex-active,
.single-product .woocommerce-product-gallery .flex-control-thumbs li.flex-active {
  border-color: #1B5E20 !important;
  box-shadow: 0 0 0 2px rgba(27, 94, 32, 0.15);
}

/* Para productos con una sola imagen — ocultar contenedor de thumbs vacío */
.single-product .woocommerce-product-gallery .flex-control-thumbs:empty {
  display: none !important;
}

/* ═══════════════════════════════════════════════════
   FLECHA DE NAVEGACIÓN del slider (Astra/Woo)
   ═══════════════════════════════════════════════════ */
.single-product .woocommerce-product-gallery .flex-direction-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  z-index: 5;
  pointer-events: none;
}

.single-product .woocommerce-product-gallery .flex-direction-nav a {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.9) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.single-product .woocommerce-product-gallery:hover .flex-direction-nav a {
  opacity: 1;
}

.single-product .woocommerce-product-gallery .flex-direction-nav .flex-prev {
  left: 90px; /* Dejar espacio para miniaturas */
}

.single-product .woocommerce-product-gallery .flex-direction-nav .flex-next {
  right: 0.5rem;
}

/* ═══════════════════════════════════════════════════
   ZOOM — Ocultar lente desordenada
   ═══════════════════════════════════════════════════ */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
  display: none !important;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR DERECHA — Summary
   ═══════════════════════════════════════════════════ */

.single-product .summary.entry-summary {
  width: 44% !important;
  min-width: 340px;
  flex: 1;
  padding: 0.5rem 0 0;
}

/* Breadcrumb estilizado */
.single-product .ve-breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.single-product .ve-breadcrumb a {
  color: #9b8c7c;
  text-decoration: none;
  transition: color 0.2s;
}

.single-product .ve-breadcrumb a:hover {
  color: #D4AF37;
}

.single-product .ve-breadcrumb .ve-breadcrumb-current {
  color: #1B5E20;
}

/* Categoría del producto */
.single-product .single-product-category {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.single-product .single-product-category a {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #D4AF37;
  background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(212,175,55,0.03));
  border: 1px solid rgba(212,175,55,0.2);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.25s;
}

.single-product .single-product-category a:hover {
  background: linear-gradient(135deg, #D4AF37, #c9a030);
  color: #fff;
  border-color: #D4AF37;
}

/* Título del producto */
.single-product .product_title.entry-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(1.6rem, 2.2vw, 2rem) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #1a1a1a !important;
  margin: 0.5rem 0 1rem !important;
  letter-spacing: -0.2px;
}

/* Precio */
.single-product .price {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #1B5E20 !important;
  margin: 0 0 0.25rem !important;
}

.single-product .price .woocommerce-Price-currencySymbol {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b5e4f;
  margin-right: 0.3rem;
}

/* Envío */
.single-product .ast-shipping-text {
  display: inline-block;
  font-size: 0.72rem;
  color: #9b8c7c;
  font-weight: 500;
  margin-left: 0.3rem;
}

/* Stock */
.single-product .ast-stock-detail {
  margin: 0.75rem 0;
  font-size: 0.82rem;
}

.single-product .ast-stock-avail {
  color: #6b5e4f;
  font-weight: 500;
}

.single-product .stock.in-stock {
  color: #1B5E20 !important;
  font-weight: 700;
}

.single-product .stock.out-of-stock {
  color: #c0392b !important;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   FORMULARIO DE COMPRA — Elegante
   ═══════════════════════════════════════════════════ */

.single-product form.cart {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ede8dc;
}

/* Selector de cantidad */
.single-product .quantity {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e8e2d4;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 0.75rem;
}

.single-product .quantity .qty {
  width: 70px;
  border: none;
  background: #fafaf8;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  padding: 0.75rem 0.3rem;
  -moz-appearance: textfield;
}

.single-product .quantity .qty::-webkit-outer-spin-button,
.single-product .quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Botón Añadir al carrito */
.single-product .single_add_to_cart_button {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.25rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  background: #1B5E20 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: background 0.25s ease !important;
  box-shadow: none !important;
}

.single-product .single_add_to_cart_button:hover {
  background: #2E7D32 !important;
}

/* ═══════════════════════════════════════════════════
   BOTONES DE COMPARTIR EN REDES SOCIALES
   ═══════════════════════════════════════════════════ */

.ve-product-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ede8dc;
}

.ve-product-share-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #9b8c7c;
  margin-right: 0.35rem;
}

.ve-product-share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.ve-product-share-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.ve-product-share-btn--whatsapp  { background: #25D366; }
.ve-product-share-btn--facebook  { background: #1877F2; }
.ve-product-share-btn--instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ve-product-share-btn--tiktok    { background: #1a1a1a; }
/* compat: clases antiguas por si quedan en caché */
.ve-product-share-btn--x         { background: #1a1a1a; }
.ve-product-share-btn--pinterest { background: #E60023; }

/* ═══════════════════════════════════════════════════
   META DEL PRODUCTO
   ═══════════════════════════════════════════════════ */

.single-product .product_meta {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ede8dc;
  font-size: 0.78rem;
  color: #6b5e4f;
}

.single-product .product_meta > span {
  display: block;
  margin-bottom: 0.4rem;
}

.single-product .product_meta .sku_wrapper .sku {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  color: #1a1a1a;
  font-weight: 600;
}

.single-product .product_meta a {
  color: #1B5E20;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.single-product .product_meta a:hover {
  color: #D4AF37;
}

/* ═══════════════════════════════════════════════════
   TABS (Descripción / Reseñas)
   ═══════════════════════════════════════════════════ */

.single-product .woocommerce-tabs.wc-tabs-wrapper {
  clear: both;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ede8dc;
}

.single-product .woocommerce-tabs ul.tabs {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-bottom: 2px solid #f0ece0;
}

.single-product .woocommerce-tabs ul.tabs li {
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
}

.single-product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 0.85rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9b8c7c;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.single-product .woocommerce-tabs ul.tabs li a:hover {
  color: #1a1a1a;
  border-bottom-color: #d4c5a0;
}

.single-product .woocommerce-tabs ul.tabs li.active a {
  color: #1B5E20;
  border-bottom-color: #1B5E20;
}

.single-product .woocommerce-tabs .panel {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  border: 1px solid #f0ece0;
}

/* ═══════════════════════════════════════════════════
   PRODUCTOS RELACIONADOS
   ═══════════════════════════════════════════════════ */

.single-product .related.products {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ede8dc;
}

.single-product .related.products > h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  margin-bottom: 1.5rem !important;
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   PRODUCTO SIN IMÁGENES MÚLTIPLES — centrar una img
   ═══════════════════════════════════════════════════ */

/* Si no hay miniaturas (una sola imagen), centrar la imagen principal */
.single-product .ve-product-gallery-layout:not(:has(.ve-product-thumbnails-col)) .ve-product-main-image-col {
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Tablet
   ═══════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .single-product .product {
    gap: 2rem;
  }
  
  .single-product .woocommerce-product-gallery {
    width: 50% !important;
    min-width: 300px;
    flex-direction: column;
  }
  
  .single-product .woocommerce-product-gallery .flex-control-thumbs {
    flex-direction: row !important;
    width: 100% !important;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.4rem !important;
    padding: 0.3rem 0 0;
    order: 2;
  }
  
  .single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
  }
  
  .single-product .summary.entry-summary {
    width: 48% !important;
    min-width: 280px;
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .single-product .product {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .single-product .woocommerce-product-gallery {
    width: 100% !important;
    min-width: auto;
    flex-direction: column;
    position: static;
  }
  
  .single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
    max-width: 100%;
  }

  .single-product .ve-product-main-image-col {
    max-width: 100%;
    border-radius: 12px;
  }
  
  .single-product .woocommerce-product-gallery .flex-control-thumbs {
    flex-direction: row !important;
    width: 100% !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0 0;
    overflow-x: auto;
  }
  
  .single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
  }
  
  .single-product .summary.entry-summary {
    width: 100% !important;
    min-width: auto;
    position: static;
    padding: 0 0.5rem;
  }
  
  .single-product .single_add_to_cart_button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   LIGHTBOX DE PRODUCTO (ampliar imagen al clic)
   ============================================ */
.ve-main-product-image { cursor: zoom-in; }

.ve-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(8, 14, 11, 0.93);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.ve-lightbox.open { opacity: 1; }

.ve-lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  transform: scale(0.96);
  transition: transform 0.25s ease;
  cursor: default;
}
.ve-lightbox.open .ve-lightbox__img { transform: scale(1); }

.ve-lightbox__close,
.ve-lightbox__nav {
  position: absolute;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ve-lightbox__close:hover,
.ve-lightbox__nav:hover { background: rgba(255, 255, 255, 0.26); }

.ve-lightbox__close {
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 28px;
}
.ve-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 32px;
}
.ve-lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }
.ve-lightbox__prev { left: 20px; }
.ve-lightbox__next { right: 20px; }

.ve-lightbox__counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
}

@media (max-width: 768px) {
  .ve-lightbox { padding: 0; }
  .ve-lightbox__img { max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .ve-lightbox__nav { width: 44px; height: 44px; font-size: 26px; }
  .ve-lightbox__prev { left: 8px; }
  .ve-lightbox__next { right: 8px; }
  .ve-lightbox__close { top: 12px; right: 12px; }
}
