:root {
    --fde-qv-bg: #ffffff;
    --fde-qv-text: #4a4a4a;
    --fde-qv-border: #eaeaea;
    /* Colores adaptados a tu tienda (Verdes) */
    --fde-qv-primary: #e2f2e2; /* Fondo del botón */
    --fde-qv-primary-text: #2a7a30; /* Texto del botón y precio */
    --fde-qv-primary-hover: #d0e8d0;
    --fde-qv-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --fde-qv-zindex: 999999;
    
    /* Tipografía moderna por defecto */
    --fde-qv-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Utilities */
body.fde-no-scroll { overflow: hidden !important; }

/* Modal Shell */
#fde-quickview-v2.fde-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--fde-qv-zindex);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility var(--fde-qv-transition), opacity var(--fde-qv-transition);
    /* Forzar tipografía en todo el modal */
    font-family: var(--fde-qv-font);
    color: var(--fde-qv-text);
}

#fde-quickview-v2.fde-modal.is-active {
    visibility: visible;
    opacity: 1;
}

#fde-quickview-v2 .fde-modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

#fde-quickview-v2 .fde-modal__dialog {
    position: relative;
    background: var(--fde-qv-bg);
    width: 90%;
    max-width: 960px;
    max-height: 90vh;
    border-radius: 16px; /* Más redondeado, estilo moderno */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: transform var(--fde-qv-transition);
    overflow: hidden;
    z-index: 10;
}

#fde-quickview-v2.is-active .fde-modal__dialog {
    transform: translateY(0) scale(1);
}

#fde-quickview-v2 .fde-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--fde-qv-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
}

#fde-quickview-v2 .fde-modal__close:hover {
    background: #f5f5f5;
    color: #111;
    transform: rotate(90deg);
}

#fde-quickview-v2 .fde-modal__content {
    position: relative;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Loader */
#fde-quickview-v2 .fde-modal__loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#fde-quickview-v2 .fde-modal__loader.is-active {
    opacity: 1;
    pointer-events: all;
}

.fde-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--fde-qv-border);
    border-top-color: var(--fde-qv-primary-text);
    border-radius: 50%;
    animation: fde-spin 1s linear infinite;
}

@keyframes fde-spin { to { transform: rotate(360deg); } }

/* Layout Grid */
#fde-quickview-v2 .fde-qv-data {
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 32px;
}

#fde-quickview-v2 .fde-qv-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 768px) {
    #fde-quickview-v2 .fde-qv-data { padding: 48px; }
    #fde-quickview-v2 .fde-qv-layout { grid-template-columns: 1fr 1fr; gap: 56px; }
}

/* Galería */
#fde-quickview-v2 .fde-qv-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#fde-quickview-v2 .fde-qv-gallery__main {
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--fde-qv-border);
}

#fde-quickview-v2 .fde-qv-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Para que el producto se vea completo */
    transition: opacity 0.2s ease;
}

/* Typography & Info */
#fde-quickview-v2 .fde-qv-info { 
    display: flex; 
    flex-direction: column; 
}

#fde-quickview-v2 .fde-qv-meta {
    font-size: 13px; 
    color: #888; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 12px;
    font-weight: 600;
}

#fde-quickview-v2 .fde-qv-title {
    margin: 0 0 16px; 
    font-size: 26px; 
    font-weight: 700; 
    color: #111; 
    line-height: 1.3;
}

#fde-quickview-v2 .fde-qv-price {
    font-size: 22px; 
    font-weight: 700; 
    margin-bottom: 24px; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    color: var(--fde-qv-primary-text); /* Verde */
}

#fde-quickview-v2 .fde-qv-excerpt {
    font-size: 15px; 
    line-height: 1.6; 
    color: #666; 
    margin-bottom: 32px; 
    padding-bottom: 24px; 
    border-bottom: 1px solid var(--fde-qv-border);
}

/* WooCommerce Form y Botones */
#fde-quickview-v2 .fde-qv-actions form.cart {
    display: flex; 
    flex-wrap: wrap; 
    gap: 16px; 
    margin-bottom: 24px;
}

/* Estilizar el input de cantidad nativo */
#fde-quickview-v2 .fde-qv-actions form.cart .quantity input.qty {
    width: 70px;
    height: 48px;
    border: 1px solid var(--fde-qv-border);
    border-radius: 30px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #111;
    background: #fdfdfd;
}

#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button {
    flex: 1; 
    background: var(--fde-qv-primary); 
    color: var(--fde-qv-primary-text); 
    border: none; 
    padding: 0 24px;
    border-radius: 30px; /* Botón en forma de píldora */
    height: 48px; 
    font-weight: 700; 
    font-size: 15px;
    cursor: pointer; 
    transition: all 0.2s;
    display: flex; 
    justify-content: center; 
    align-items: center;
}

#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button:hover { 
    background: var(--fde-qv-primary-hover); 
}

#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button:active { 
    transform: scale(0.98); 
}

/* Link de detalles */
#fde-quickview-v2 .fde-qv-footer { margin-top: auto; padding-top: 16px; }

#fde-quickview-v2 .fde-link {
    font-size: 14px; 
    color: #111; 
    text-decoration: underline; 
    font-weight: 600; 
    display: inline-flex; 
    align-items: center; 
    gap: 4px;
}
#fde-quickview-v2 .fde-link:hover { color: var(--fde-qv-primary-text); }

/* ==========================================================================
   Vista rapida — ajustes 29/09/2026
   ========================================================================== */

/* Misma tipografia que el resto del sitio (venia forzada a Inter). */
#fde-quickview-v2.fde-modal { --fde-qv-font: 'Nunito', system-ui, sans-serif; }

/* Categoria: era un enlace sin estilo y tomaba el violeta de "visitado".
   Queda como en las tarjetas de producto: verde, mayusculas, sin subrayar. */
#fde-quickview-v2 .fde-qv-meta { margin-bottom: 10px; }
#fde-quickview-v2 .fde-qv-meta a,
#fde-quickview-v2 .fde-qv-meta a:visited {
  color: var(--fde-green-text, #2e7d32);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-decoration: none;
}
#fde-quickview-v2 .fde-qv-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
#fde-quickview-v2 .fde-qv-meta a:focus-visible { outline: 3px solid rgba(76, 175, 80, .45); outline-offset: 2px; border-radius: 4px; }

#fde-quickview-v2 .fde-qv-title { color: var(--fde-ink, #1a1a2e); }
#fde-quickview-v2 .fde-qv-price { color: var(--fde-green-text, #2e7d32); }

/* Cantidad: "- 1 +" en una sola pastilla, botones de 44px (tactil), sin
   las flechitas nativas del navegador. Los botones los agrega quickview.js. */
#fde-quickview-v2 .fde-qv-actions form.cart .quantity.fde-qty {
  display: inline-flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--fde-line, #d8d8dc);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#fde-quickview-v2 .fde-qv-actions form.cart .quantity.fde-qty:focus-within {
  border-color: var(--fde-green, #4caf50);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, .2);
}
#fde-quickview-v2 .fde-qv-actions form.cart .quantity.fde-qty input.qty {
  width: 40px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  color: var(--fde-ink, #1a1a2e);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
#fde-quickview-v2 .fde-qty input.qty::-webkit-inner-spin-button,
#fde-quickview-v2 .fde-qty input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#fde-quickview-v2 .fde-qty input.qty:focus { outline: none; }

#fde-quickview-v2 .fde-qty__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fde-ink, #1a1a2e);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
#fde-quickview-v2 .fde-qty__btn svg { width: 16px; height: 16px; }
#fde-quickview-v2 .fde-qty__btn:hover:not(:disabled) { background: var(--fde-green-50, #e8f5e9); color: var(--fde-green-text, #2e7d32); }
#fde-quickview-v2 .fde-qty__btn:active:not(:disabled) { background: var(--fde-green-100, #c8e6c9); }
#fde-quickview-v2 .fde-qty__btn:disabled { color: #b9bcc0; cursor: not-allowed; }
#fde-quickview-v2 .fde-qty__btn:focus-visible { outline: 3px solid rgba(76, 175, 80, .45); outline-offset: -3px; border-radius: 999px; }

/* Boton: mismo alto que la cantidad y estado "agregado" en verde lleno. */
#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button { font-family: inherit; font-weight: 800; }
#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button.success { background: var(--fde-green, #4caf50); color: #fff; }
#fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button.loading { opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  #fde-quickview-v2 .fde-qty__btn, #fde-quickview-v2 .fde-qty { transition: none; }
}
/* Titulo sin palabras sueltas en la ultima linea. */
#fde-quickview-v2 .fde-qv-title { text-wrap: balance; }

/* Celular: cantidad y boton en una fila sin que el texto del boton se parta. */
@media (max-width: 480px) {
  #fde-quickview-v2 .fde-qv-actions form.cart { gap: 10px; }
  #fde-quickview-v2 .fde-qty__btn { width: 38px; }
  #fde-quickview-v2 .fde-qv-actions form.cart .quantity.fde-qty input.qty { width: 30px; }
  #fde-quickview-v2 .fde-qv-actions form.cart button.single_add_to_cart_button { padding: 0 12px; font-size: 14px; white-space: nowrap; }
}

/* Pantalla visible (29/09/2026): el fondo medía 100vh y la ventana 90vh.
   En Chrome del celular 100vh es la pantalla SIN la barra de abajo, asi que
   el final de la ventana quedaba debajo de esa barra: no se veia y al
   intentar deslizar ahi se tocaba la barra. Ahora ocupa solo lo visible. */
#fde-quickview-v2.fde-modal { width: auto; height: auto; inset: 0; }
#fde-quickview-v2 .fde-modal__dialog { max-height: calc(100% - 32px); }
#fde-quickview-v2 .fde-modal__content {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}