/* ============================================================================
   Duratex — Página de producto individual.
   Se carga solo en is_product() (WooCommerce) para no pesarle a las demás
   páginas. Complementa woocommerce.css / duratex-shop.css.
   ==========================================================================*/

body.single-product .dx-product-layout { column-gap: 3.5rem; align-items: flex-start; }

/* ---- El bloque de columnas queda limitado por el contentSize global
   (820px) del layout "constrained". Lo liberamos SOLO aquí para que la
   galería + info aprovechen todo el ancho disponible (~1259px) en desktop,
   sin tocar el contentSize global que gobierna el ancho de texto del sitio. */
body.single-product .dx-product-layout {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* ---- Columna de galería: se queda visible mientras se hace scroll a la
   info del producto, como en las tiendas grandes ------------------------- */
@media (min-width: 1000px) {
  body.single-product .dx-product-gallery-col { position: sticky; top: 120px; }
}

/* ---- Galería (markup clásico de WooCommerce, usado por el bloque para
   conservar zoom/lightbox/slider) ----------------------------------------- */
body.single-product .dx-product-gallery,
body.single-product .woocommerce-product-gallery {
  background: #fff; border-radius: 20px; padding: .5rem;
  border: 1px solid var(--dx-border, #e2e8f0);
}
body.single-product .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery__wrapper .zoomImg {
  border-radius: 14px; overflow: hidden;
}
/* Imagen del producto GRANDE: ocupa todo el ancho de la columna, sin caja
   cuadrada forzada que la dejaba pequeña. */
body.single-product .woocommerce-product-gallery__image img,
body.single-product .wc-block-product-gallery__image img {
  border-radius: 14px; width: 100%; height: auto; aspect-ratio: auto;
  object-fit: contain; background: #fff; display: block;
}
body.single-product .flex-control-nav,
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
  display: flex !important; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none;
}
body.single-product .flex-control-nav li { width: 64px; height: 64px; }
body.single-product .flex-control-nav img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; opacity: .65; transition: all .18s ease;
}
body.single-product .flex-control-nav img:hover { opacity: 1; }
body.single-product .flex-control-nav .flex-active img { opacity: 1; border-color: var(--dx-primary, #16a34a); }

/* ---- Título, rating, precio, resumen ------------------------------------ */
body.single-product .dx-product-title {
  font-size: clamp(1.3rem, 2vw, 1.75rem) !important; line-height: 1.25 !important;
  margin: 0 0 .6rem !important; font-weight: 800 !important;
}
body.single-product .dx-product-rating { margin: 0 0 .75rem; }
body.single-product .dx-product-rating .star-rating { font-size: .95rem; color: #f59e0b; }
body.single-product .dx-product-price {
  font-size: 1.4rem !important; font-weight: 800 !important; color: var(--dx-primary-dark, #15803d) !important;
  margin: 0 0 1rem !important;
}
body.single-product .dx-product-price del { color: #94a3b8; font-weight: 600; font-size: 1.05rem; margin-right: 8px; }
body.single-product .dx-product-excerpt {
  color: var(--dx-contrast-2, #475569); font-size: 1rem; line-height: 1.7; margin: 0 0 1.5rem !important; max-width: 60ch;
}

/* ---- Formulario de compra: cantidad + botón ----------------------------- */
body.single-product .dx-product-atc { margin: 0 0 1.5rem !important; }
body.single-product .dx-product-atc form.cart {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
body.single-product .dx-product-atc .quantity {
  display: inline-flex; align-items: stretch; border: 1.5px solid var(--dx-border, #e2e8f0);
  border-radius: 100px; overflow: hidden; background: #fff;
}
body.single-product .dx-product-atc .quantity input.qty {
  width: 52px; border: none; text-align: center; font-family: "DM Sans", sans-serif;
  font-weight: 700; font-size: 15px; -moz-appearance: textfield;
}
body.single-product .dx-product-atc .quantity input.qty::-webkit-inner-spin-button,
body.single-product .dx-product-atc .quantity input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.single-product .dx-product-atc .dx-qty-btn {
  width: 42px; border: none; background: var(--dx-surface, #f8fafc); color: var(--dx-contrast, #0f172a);
  font-size: 18px; cursor: pointer; transition: background .15s, color .15s;
}
body.single-product .dx-product-atc .dx-qty-btn:hover { background: var(--dx-soft, #f0fdf4); color: var(--dx-primary, #16a34a); }
body.single-product .dx-product-atc button.single_add_to_cart_button,
body.single-product .dx-product-atc .wc-block-components-button {
  flex: 1; min-width: 200px; font-size: 1rem !important; padding: 1rem 2rem !important;
  box-shadow: 0 10px 26px rgba(22, 163, 74, .28) !important;
}
body.single-product .dx-product-meta {
  font-family: "DM Sans", sans-serif; font-size: .85rem; color: var(--dx-muted, #64748b);
  padding-top: 1rem; margin-top: .5rem; border-top: 1px solid var(--dx-border, #e2e8f0);
}
body.single-product .dx-product-meta a { color: var(--dx-primary-dark, #15803d); text-decoration: none; }
body.single-product .dx-product-meta a:hover { text-decoration: underline; }
body.single-product .dx-product-trust {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1rem !important;
  color: var(--dx-muted, #64748b) !important;
}

/* ---- Barra fija de compra en móvil (aparece al bajar del botón real) ---- */
.dx-sticky-atc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none;
  align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border-top: 1px solid var(--dx-border, #e2e8f0);
  padding: 12px clamp(1rem, 4vw, 1.5rem); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .10);
}
.dx-sticky-atc.is-visible { display: flex; animation: dtxStickyIn .22s ease; }
@keyframes dtxStickyIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.dx-sticky-atc__price { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--dx-primary-dark, #15803d); white-space: nowrap; }
.dx-sticky-atc__btn {
  flex: 1; max-width: 220px; text-align: center; border: none; cursor: pointer;
  background: var(--dx-primary, #16a34a); color: #fff; font-family: "DM Sans", sans-serif;
  font-weight: 700; font-size: .92rem; padding: .85rem 1.2rem; border-radius: 100px;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .28);
}
@media (min-width: 1000px) { .dx-sticky-atc { display: none !important; } }

/* ---- Pestañas de detalle (descripción / info adicional / reseñas) ------ */
body.single-product .dx-product-tabs { margin-top: 3rem !important; }
body.single-product .woocommerce-tabs ul.tabs,
body.single-product .wc-block-product-details ul.tabs {
  display: flex; gap: 6px; list-style: none; margin: 0 0 1.75rem; padding: 0 0 0;
  border-bottom: 1.5px solid var(--dx-border, #e2e8f0); flex-wrap: wrap;
}
body.single-product .woocommerce-tabs ul.tabs li { margin: 0; }
body.single-product .woocommerce-tabs ul.tabs li a {
  display: inline-block; padding: .8rem 1.1rem; font-family: "DM Sans", sans-serif; font-weight: 700;
  font-size: .92rem; color: var(--dx-muted, #64748b); text-decoration: none; border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px; transition: color .15s, border-color .15s;
}
body.single-product .woocommerce-tabs ul.tabs li:hover a { color: var(--dx-contrast, #0f172a); }
body.single-product .woocommerce-tabs ul.tabs li.active a {
  color: var(--dx-primary-dark, #15803d); border-color: var(--dx-primary, #16a34a);
}
body.single-product .woocommerce-tabs .panel {
  font-family: "DM Sans", sans-serif; color: var(--dx-contrast-2, #334155); line-height: 1.75; max-width: 72ch;
}
body.single-product .woocommerce-tabs table.shop_attributes { border: 1px solid var(--dx-border, #e2e8f0); border-radius: 12px; overflow: hidden; border-collapse: collapse; width: 100%; }
body.single-product .woocommerce-tabs table.shop_attributes th,
body.single-product .woocommerce-tabs table.shop_attributes td { padding: .7rem 1rem; border: 1px solid var(--dx-border, #e2e8f0); font-size: .9rem; }
body.single-product .woocommerce-tabs table.shop_attributes th { background: var(--dx-surface, #f8fafc); font-weight: 700; width: 220px; }

/* ---- Productos relacionados --------------------------------------------- */
body.single-product .dx-product-related { margin-top: 4rem !important; }
body.single-product .dx-product-related > h2,
body.single-product .related.products > h2 {
  font-family: "Sora", sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--dx-contrast, #0f172a);
  margin: 0 0 1.25rem;
}

@media (max-width: 781px) {
  body.single-product .dx-product-layout { row-gap: 1.75rem; }
  body.single-product .dx-product-atc form.cart { flex-direction: row; }
}

/* ============================================================================
   Variaciones de producto (Estampado / Acabado) — v0.9.14
   Selector de variaciones del bloque add-to-cart en productos variables.
   ==========================================================================*/
body.single-product .dx-product-atc .variations {
  width: 100%; border-collapse: collapse; margin: 0 0 1rem;
}
body.single-product .dx-product-atc .variations tr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
body.single-product .dx-product-atc .variations td { padding: 0; border: 0; }
body.single-product .dx-product-atc .variations td.label {
  flex: 0 0 auto; min-width: 92px; font-family: "DM Sans", sans-serif;
  font-weight: 700; color: var(--dx-contrast, #0f172a); font-size: .95rem;
}
body.single-product .dx-product-atc .variations td.label label { margin: 0; }
body.single-product .dx-product-atc .variations td.value { flex: 1 1 200px; position: relative; }
body.single-product .dx-product-atc .variations select {
  width: 100%; appearance: none; -webkit-appearance: none;
  font-family: "DM Sans", sans-serif; font-size: 15px; font-weight: 600;
  color: var(--dx-contrast, #0f172a); background: #fff;
  border: 1.5px solid var(--dx-border, #e2e8f0); border-radius: 100px;
  padding: 12px 44px 12px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
body.single-product .dx-product-atc .variations select:hover { border-color: var(--dx-primary, #16a34a); }
body.single-product .dx-product-atc .variations select:focus {
  outline: none; border-color: var(--dx-primary, #16a34a); box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
body.single-product .dx-product-atc .reset_variations {
  display: inline-block; margin: 2px 0 0 4px; font-family: "DM Sans", sans-serif;
  font-size: .82rem; color: var(--dx-muted, #64748b); text-decoration: none;
}
body.single-product .dx-product-atc .reset_variations:hover { color: var(--dx-primary, #16a34a); text-decoration: underline; }
body.single-product .dx-product-atc .single_variation_wrap { margin-top: 6px; }
body.single-product .dx-product-atc .single_variation .price,
body.single-product .dx-product-atc .woocommerce-variation-price .price {
  display: block; font-size: 1.55rem; font-weight: 800;
  color: var(--dx-primary-dark, #15803d); margin: 6px 0 10px;
}
body.single-product .dx-product-atc .woocommerce-variation-availability { margin-bottom: 10px; }
body.single-product .dx-product-atc .woocommerce-variation-availability .stock {
  font-family: "DM Sans", sans-serif; font-size: .9rem; font-weight: 600; color: var(--dx-primary, #16a34a);
}
body.single-product .dx-product-atc .woocommerce-variation-description { color: var(--dx-contrast-2, #475569); font-size: .95rem; margin-bottom: 10px; }
/* Botón deshabilitado hasta elegir variación */
body.single-product .dx-product-atc .single_add_to_cart_button.disabled,
body.single-product .dx-product-atc .single_add_to_cart_button.wc-variation-selection-needed { opacity: .5; cursor: not-allowed; box-shadow: none !important; }


/* ============================================================================
   Galeria mas grande y con menos relleno — v0.9.15
   La imagen principal ocupa todo el ancho de la columna.
   ==========================================================================*/
body.single-product .dx-product-gallery,
body.single-product .woocommerce-product-gallery {
  background: #fff; padding: 0; border: 1px solid var(--dx-border, #e2e8f0); border-radius: 18px; overflow: hidden;
}
body.single-product .woocommerce-product-gallery__image,
body.single-product .wc-block-product-gallery-large-image {
  border-radius: 0; margin: 0;
}
body.single-product .woocommerce-product-gallery__image img,
body.single-product .wc-block-product-gallery__image img,
body.single-product .wc-block-product-gallery-large-image img {
  width: 100% !important; height: auto !important; aspect-ratio: 1 / 1;
  object-fit: contain; background: #fff; border-radius: 0; display: block;
}
/* Miniaturas dentro de la caja, con aire */
body.single-product .flex-control-nav,
body.single-product .woocommerce-product-gallery .flex-control-thumbs,
body.single-product .wc-block-product-gallery-thumbnails {
  padding: 10px 12px 12px; margin: 0; background: #fff;
}
body.single-product .flex-control-nav li { width: 72px; height: 72px; }
