












/*! [SAHA] assets/css/components/quick-view.css | v2.6.3 | 2026-09-07 */
/* ============================================== 
   QUICK VIEW — All breakpoints
   Desktop base + Tablet + Mobile Bottom Sheet
   ============================================== */


/* ══════════════════════════════════════════════
   SECTION 1: DESKTOP BASE (Mouse + wide screens)
   ══════════════════════════════════════════════ */

/* ==============================================
   QUICK VIEW — Base (Desktop)
   ============================================== */
dialog.saha-dialog:has(.quick-view-popup) {
  width: 960px;
  max-width: 95vw;
}

.quick-view-popup .modal-dialog {
  background: #fff;
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 8px;
  position: relative;
  border: 4px solid #999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* Layout: 2 columnas horizontal */
.quick-view-popup .saha-row {
  display: flex;
  gap: 30px;
}
.quick-view-popup .saha-row .col.span_1_of_2 {
  width: 50%;
  float: none;
}

/* Imagen cuadrada */
/* Quick view image layout handled in badge section above */

/* Variaciones + cantidad en misma línea */
.quick-view-popup table.variations {
  width: 100%;
}
.quick-view-popup table.variations td,
.quick-view-popup table.variations th {
  padding: 6px 8px;
  vertical-align: middle;
}

.quick-view-popup .single_variation_wrap .single_variation {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-view-popup .single_variation_wrap .price,
.quick-view-popup .single_variation_wrap .stock {
  margin: 0;
}

.quick-view-popup .woocommerce-variation-add-to-cart,
.quick-view-popup .woocommerce-variation-availability {
  display: block;
}

/* Variations inline with quantity */
.quick-view-popup form.cart {
  margin-top: 15px;
}

/* Dynamic total (unit price × qty) — JS-driven, both breakpoints */
.quick-view-popup .qv-total {
  font-weight: 700;
  font-size: 1.05em;
  white-space: nowrap;
}
.quick-view-popup .qv-total .qv-total-label {
  font-weight: 500;
  font-size: 0.82em;
  color: #666;
}
/* Desktop: sits left of the qty in the add-to-cart row */
.quick-view-popup .woocommerce-variation-add-to-cart .qv-total,
.quick-view-popup form.cart > .qv-total {
  display: inline-block;
  margin-right: 12px;
  vertical-align: middle;
}

.quick-view-popup form.cart .quantity {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
}
.quick-view-popup form.cart table.variations + .single_variation_wrap .quantity {
  display: inline-flex;
}

/* Stock urgency */
.quick-view-popup .stock.urgent,
.quick-view-popup .stock:contains('quedan'),
.quick-view-popup .woocommerce-variation-availability .stock {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.85em;
}

/* Product info */
.quick-view-popup .product-name { font-size: 1.4em; margin-bottom: 10px; }
.quick-view-popup .price { font-size: 1.2em; margin-bottom: 15px; }
.quick-view-popup .stock { margin-bottom: 10px; }
.quick-view-popup .action-button { list-style: none; padding: 0; margin: 10px 0 0; display: flex; gap: 8px; }
.quick-view-popup .action-button li { display: inline-block; }

/* Hide add to cart when out of stock */
.quick-view-popup .single_add_to_cart_button.disabled {
  opacity: 0.5;
  pointer-events: none;
}
/* OOS variation: hide the price. Anchored to the .variation-is-oos class on
   .single_variation_wrap — WC 11 rebuilds the inner price node ~300ms AFTER
   found_variation fires, so JS inline hides on the price node don't survive.
   The class lives on the wrapper, which WC never replaces. */
.quick-view-popup .single_variation_wrap.variation-is-oos .woocommerce-variation-price {
  display: none !important;
}
.quick-view-popup .woocommerce-variation-add-to-cart .single_add_to_cart_button.disabled,
.quick-view-popup .woocommerce-variation-add-to-cart .single_add_to_cart_button[disabled] {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Back in Stock Notifier — out of stock behavior */
/* When avisarme button is present, hide quantity and add-to-cart */
form.cart:has(.cwg_popup_submit) .quantity,
form.cart:has(.cwg_popup_submit) .qty-label,
form.cart:has(.cwg_popup_submit) .single_add_to_cart_button {
  display: none !important;
}
/* In QUICK VIEW: hide original CWG in .woocommerce-variation-availability
   (JS clones it into .woocommerce-variation-add-to-cart for proper alignment) */
.quick-view-popup form.cart .woocommerce-variation-availability > .cwg_popup_submit {
  display: none !important;
}
/* Quick view: style the CWG clone in add-to-cart row */
.quick-view-popup form.cart .woocommerce-variation-add-to-cart .cwg-clone {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  border: 0;
  cursor: pointer;
  text-align: center;
  min-height: 40px;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
/* SINGLE PRODUCT PAGE: style CWG in its natural location */
.single-product .single_variation_wrap {
  display: flex;
  flex-direction: column;
}
/* When OOS: reorder so action-button (wishlist) appears right after availability */
.single-product form.cart:has(.cwg_popup_submit) .woocommerce-variation-add-to-cart {
  order: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.single-product form.cart:has(.cwg_popup_submit) .action-button {
  margin-left: 0;
  flex-shrink: 0;
}
.single-product form.cart:has(.cwg_popup_submit) .action-button .yith-wcwl-add-to-wishlist a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.single-product form.cart .woocommerce-variation-availability {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.single-product form.cart .woocommerce-variation-availability > .cwg_popup_submit {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  border: 0;
  cursor: pointer;
  text-align: center;
  min-height: 40px;
  line-height: 1;
  transition: all 0.3s ease;
}
form.cart .cwg_popup_submit:hover {
  background-color: #333;
  color: #fff;
}
/* Ensure CWG popover appears above quick view dialog */
.cwg-popover-modal {
  z-index: 100000 !important;
}
/* In quick view, also hide CWG subscribe form (shown in popover instead) */
.quick-view-popup .cwginstock-subscribe-form:not(.cwg-popover-content .cwginstock-subscribe-form) {
  display: none !important;
}



/* ══════════════════════════════════════════════
   SECTION 2: GROUPED / BUNDLE + NON-SHOP ADD TO CART
   ══════════════════════════════════════════════ */

/* ==============================================
   QUICK VIEW — Grouped / Bundle products
   ============================================== */
.grouped-quick-view-info {
  margin: 12px 0;
  padding: 12px 16px;
  background: #f7f7f7;
  border-radius: 8px;
  text-align: center;
}
.grouped-quick-view-info p {
  margin: 0;
  font-size: 0.88em;
  color: #555;
  line-height: 1.5;
}

/* Hide bundle item descriptions and images in quick view */
.quick-view-popup .yith-wcpb-product-bundled-item-data__description,
.quick-view-popup .yith-wcpb-product-bundled-item-image {
  display: none !important;
}
/* Style remaining bundle item title */
.quick-view-popup .yith-wcpb-product-bundled-item-data__title {
  font-size: 0.9em;
  margin: 0;
}
.quick-view-popup .yith-wcpb-product-bundled-item-data__title a {
  color: #555;
  text-decoration: none;
}
.quick-view-popup .yith-wcpb-product-bundled-item-data__title a:hover {
  color: #333;
  text-decoration: underline;
}
.quick-view-popup .yith-wcpb-product-bundled-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.quick-view-popup .yith-wcpb-product-bundled-item:last-child {
  border-bottom: none;
}

/* "Ver producto completo" button for grouped/bundle — inherits Saha .button styles */
.grouped-quick-view-info .grouped-view-full-link {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .grouped-quick-view-info {
    padding: 10px;
    margin: 8px 0;
  }
  .grouped-quick-view-info p {
    font-size: 0.82em;
  }
  .grouped-quick-view-info .grouped-view-full-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
  }
}

/* ==============================================
   QUICK VIEW — Add to cart from non-shop pages (cart, etc.)
   After adding, reload page to keep cart in sync
   ============================================== */

/* Desktop QV: simple OOS — WL next to CWG "Avisarme!" */
.quick-view-popup .product-details > .yith-wcwl-add-to-wishlist {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 8px;
}
.quick-view-popup .product-details > .yith-wcwl-add-to-wishlist a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Hide duplicate YITH wishlist outside form.cart on single product page */
.single-product .summary > .yith-wcwl-add-to-wishlist:not(.qv-wl-oos),
.single-product .product-details > .yith-wcwl-add-to-wishlist:not(.qv-wl-oos) {
  display: none !important;
}



/* ══════════════════════════════════════════════
   SECTION 3: TABLET (768-1024px) — Hybrid input
   Modal centrado, no bottom sheet
   ══════════════════════════════════════════════ */

/* ==============================================
   QUICK VIEW — Tablet (768-1024px)
   ============================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  dialog.saha-dialog:has(.quick-view-popup) {
    width: 95vw;
    max-width: 95vw;
  }
  .quick-view-popup .modal-dialog {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
  }
  .quick-view-popup .saha-row { gap: 20px; }
  .quick-view-popup .product-name { font-size: 1.2em; }
  .quick-view-popup .price { font-size: 1.1em; }
}



/* ══════════════════════════════════════════════
   SECTION 4: MOBILE BOTTOM SHEET (<768px, touch)
   Persiana que sube desde el borde inferior
   ══════════════════════════════════════════════ */

/* ==============================================
   QUICK VIEW — Mobile Bottom Sheet (<768px, touch)
   Bottom sheet que sube desde el borde inferior.
   Sin conflicto con showModal(): el dialog ya tiene
   position:fixed + inset:0 desde dialog.css base.
   ============================================== */
@media (max-width: 768px) {
  /* El dialog ocupa toda la pantalla, alinea contenido al fondo */
  dialog.saha-dialog:has(.quick-view-popup) {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
  }
  dialog.saha-dialog:has(.quick-view-popup)::backdrop {
    background: rgba(0,0,0,0.45);
  }

  /* Animación: sube desde abajo (bottom sheet) */
  dialog.saha-dialog:has(.quick-view-popup) .modal-dialog {
    animation: slideUpMobile 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;

    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 16px 16px 0 0;
    border: none;
    border-top: 4px solid #999;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.2) !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Sheet handle */
  .quick-view-popup .modal-dialog::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 8px auto 0;
    flex-shrink: 0;
  }

  /* Close button */
  dialog.saha-dialog:has(.quick-view-popup) .dialog-close-btn {
    top: 10px;
    right: 10px;
    z-index: 20;
    background: rgba(0,0,0,0.08);
    border-radius: 50%;
  }
  dialog.saha-dialog:has(.quick-view-popup) .dialog-close-btn svg { stroke: #666; }

  /* Header: image + title inline */
  .quick-view-popup .qv-mobile-header {
    display: flex;
    gap: 12px;
    padding: 12px 14px 0;
    flex-shrink: 0;
    align-items: flex-start;
  }
  .quick-view-popup .qv-mobile-header .product-images {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
  }
  .quick-view-popup .qv-mobile-header .product-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
  }
  .quick-view-popup .qv-mobile-header .qv-mobile-info {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
  }
  .quick-view-popup .qv-mobile-header .product-name {
    font-size: 1em;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .quick-view-popup .qv-mobile-rating .star-rating {
    font-size: 0.8em;
    margin: 4px 0 2px;
  }
  .quick-view-popup .qv-mobile-rating .star-rating span {
    color: #f59e0b;
  }
  /* Stock badge — own line below product name */
  .quick-view-popup .qv-stock-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
  }
  .quick-view-popup .qv-stock-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
  }
  .quick-view-popup .qv-stock-badge.oos {
    background: #ffebee;
    color: #c62828;
  }
  .quick-view-popup .qv-mobile-header .price {
    font-size: 1.1em;
    margin-bottom: 0;
  }
  /* Price row in content: inline [regular][sale][per-kg] */
  .quick-view-popup .qv-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
  }
  .quick-view-popup .qv-price-row .price {
    margin-bottom: 0;
  }

  /* Scrollable content */
  .quick-view-popup .qv-mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .quick-view-popup .qv-mobile-content .short-description,
  .quick-view-popup .qv-mobile-content .woocommerce-product-details__short-description {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
  }

  /* Variations + quantity inline */
  .quick-view-popup .qv-mobile-content table.variations,
  .quick-view-popup .qv-mobile-content .variations {
    margin-bottom: 8px;
  }
  .quick-view-popup .qv-mobile-content form.cart {
    margin-top: 8px;
  }
  .quick-view-popup .qv-mobile-content form.cart .quantity {
    display: inline-flex;
    align-items: center;
  }

  /* Mobile: hide ORIGINAL variation price under the qty input — the live
     clone above (.qv-price-row, includes $/kg) is the single price shown.
     Prevents the unit price from reading like a stale "total" next to qty. */
  .quick-view-popup .qv-mobile-content .single_variation_wrap .woocommerce-variation-price {
    display: none;
  }

  /* Dynamic total in the qty row: total left, qty pushed right */
  .quick-view-popup .qv-qty-wl-row .qv-total {
    margin-right: auto;
    align-self: center;
  }

  /* Sticky footer */
  .quick-view-popup .qv-mobile-footer {
    padding: 10px 14px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
  }
  .quick-view-popup .qv-mobile-footer .btn-clone,
  .quick-view-popup .qv-mobile-footer .cwg-clone {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 6px;
    text-align: center;
    display: block;
    position: relative;
  }
  /* Loading state for footer button */
  .quick-view-popup .qv-mobile-footer .btn-clone.loading {
    opacity: 0.7;
    pointer-events: none;
    color: transparent !important;
  }
  .quick-view-popup .qv-mobile-footer .btn-clone.loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: qv-spin 0.6s linear infinite;
  }
  @keyframes qv-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }
  /* Header price row removed — price now in content */
  /* Hide stock elements in content area on mobile (shown in header instead) */
  .quick-view-popup .qv-mobile-content .woocommerce-variation-availability .stock {
    display: none !important;
  }

  /* Qty + WL inline row — always own line */
  .quick-view-popup .qv-qty-wl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
    clear: both;
  }
  .quick-view-popup .qv-qty-wl-row .qty-label {
    font-size: 0.85em;
    white-space: nowrap;
  }
  .quick-view-popup .qv-qty-wl-row .quantity {
    display: inline-flex !important;
    align-items: center;
  }
  .quick-view-popup .qv-qty-wl-row .qv-wl-inline {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .quick-view-popup .qv-qty-wl-row .qv-wl-inline .wl-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #888;
  }
  .quick-view-popup .qv-qty-wl-row .qv-wl-inline .yith-wcwl-add-to-wishlist {
    margin: 0;
  }
  .quick-view-popup .qv-qty-wl-row .qv-wl-inline .add-to-wishlist-before-title,
  .quick-view-popup .qv-qty-wl-row .qv-wl-inline .yith-wcwl-add-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  /* Price row with ppk */
  .quick-view-popup .qv-price-row .qv-ppk {
    font-size: 0.85em;
    color: #666;
  }
  /* Simple product elements (OOS, no form.cart) */
  .quick-view-popup .qv-simple-price {
    margin-bottom: 8px;
  }
  .quick-view-popup .qv-stock-msg {
    margin-bottom: 8px;
  }

  /* Hide inline add-to-cart button on mobile (footer button only) */
  .quick-view-popup .qv-mobile-content .single_add_to_cart_button,
  .quick-view-popup .qv-mobile-content .woocommerce-variation-add-to-cart .button {
    display: none !important;
  }

  /* Hide CWG avisarme in content on mobile (shown in footer only) */
  .quick-view-popup .qv-mobile-content .cwg_popup_submit,
  .quick-view-popup .qv-mobile-content .cwg-clone,
  .quick-view-popup .qv-mobile-content .woocommerce-variation-add-to-cart .cwg-clone {
    display: none !important;
  }

  /* Hide desktop layout elements on mobile */
  .quick-view-popup .saha-row { display: none !important; }

  /* Hide original cart form in summary when mobile footer exists */
  .quick-view-popup .qv-mobile-footer ~ .saha-row form.cart { display: none; }

  /* ── "Ver ficha completa" link ── */
  .qv-detail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px 4px;
    font-size: 0.82em;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .qv-detail-link:active {
    color: var(--wc-primary, #dc9814);
  }
  .qv-detail-arrow {
    font-size: 1.1em;
    transition: transform 0.2s;
  }
  .qv-detail-link:active .qv-detail-arrow {
    transform: translateX(3px);
  }
}

