/**
 * QuickView Component Styles
 * 
 * Estilos para el modal de vista rápida de productos
 * Basado en el diseño de referencia con colores del tema profesional
 * 
 * @package OnlyCard Theme
 * @since 1.0.0
 */

/* ==========================================================================
   MODAL OVERLAY Y CONTENEDOR
   ========================================================================== */

.quickview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.quickview-modal.show {
    display: flex !important;
}

.quickview-modal.hide {
    display: flex !important;
}

.quickview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Más oscuro para debug */
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

.quickview-container {
    position: relative;
    background: var(--professional-bg-light, #ffffff);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    min-height: 500px;
    overflow-y: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quickview-modal {
        padding: 10px;
    }
    
    .quickview-container {
        max-width: 95vw;
        max-height: 95vh;
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .quickview-modal {
        padding: 5px;
    }
    
    .quickview-container {
        max-width: 100vw;
        max-height: 100vh;
        min-height: 350px;
        border-radius: 0;
    }
}

.quickview-modal.show .quickview-container {
    transform: translateY(0);
    opacity: 1;
}

.quickview-modal.hide .quickview-container {
    transform: translateY(-20px);
    opacity: 0;
}

.quickview-content {
    display: flex;
    flex: 1;
    min-height: 0; /* Permite que flex items se contraigan */
}

.quickview-product {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 20px;
    gap: 12px;
}



/* ==========================================================================
   ANIMACIONES ELIMINADAS - Se usan las del contenedor principal
   ========================================================================== */

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

.quickview-hidden {
    display: none !important;
}

.quickview-loading .quickview-product {
    display: none;
}

.quickview-product .quickview-loading {
    display: none;
}

/* ==========================================================================
   SPINNER DE CARGA
   ========================================================================== */

.quickview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--professional-primary, #5949ff);
}

.loading-spinner i {
    font-size: 32px;
    color: var(--professional-success, #00b894);
}

.loading-spinner span {
    font-size: 16px;
    font-weight: 500;
    color: var(--professional-primary, #5949ff);
}

/* ==========================================================================
   ESTADO DE CARGA DEL BOTÓN QUICK VIEW
   ========================================================================== */

.quick-view-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.quick-view-btn.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar personalizado */
.quickview-body::-webkit-scrollbar {
    width: 6px;
}

.quickview-body::-webkit-scrollbar-track {
    background: var(--professional-bg-light, #f8f9fa);
}

.quickview-body::-webkit-scrollbar-thumb {
    background: var(--professional-border-light, #dee2e6);
    border-radius: 3px;
}

 .quickview-body::-webkit-scrollbar-thumb:hover {
     background: var(--professional-text-muted, #adb5bd);
 }

/* ==========================================================================
   HEADER DEL MODAL - TOP BAR GRIS OSCURO
   ========================================================================== */

.quickview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--professional-bg-light, #ffffff);
    color: var(--professional-primary, #5949ff);
    flex-shrink: 0;
    border-bottom: 1px solid var(--professional-border-light, #dee2e6);
}

.quickview-product-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--professional-primary, #5949ff);
}

.quickview-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--professional-text-primary, #212121);
    margin: 0;
}

.quickview-product-link i {
    font-size: 14px;
    color: var(--professional-text-muted, #adb5bd);
}

.quickview-close {
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--professional-text-muted, #adb5bd); 
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 0;
}

.quickview-close:hover {
    opacity: 0.7;
}

/* ==========================================================================
   COLUMNAS DEL CONTENIDO
   ========================================================================== */

.quickview-product-left {
    flex: 0 0 40%;
    padding: 30px;
    border-radius: 8px;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--professional-border-light, #dee2e6);
}

.quickview-product-right {
    flex: auto;
    padding: 30px;
    border-radius: 8px;
    flex-direction: column;
    gap: 25px;
    justify-content: flex-start;
    border: 1px solid var(--professional-border-light, #dee2e6);
}

/* ==========================================================================
   IMÁGENES
   ========================================================================== */

/* ==========================================================================
   GALERÍA DE IMÁGENES - SLIDER CON THUMBNAILS
   ========================================================================== */

/* Wrapper de imagen principal con flechas */
.quickview-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.quickview-image-main {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    background: var(--professional-bg-light, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--professional-border-light, #dee2e6);
}

.quickview-image-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity 0.3s ease;
}

/* Flechas de navegación de imagen principal */
.quickview-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--professional-border-light, #dee2e6);
    color: var(--professional-text-primary, #212121);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quickview-gallery-arrow:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.quickview-gallery-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.quickview-gallery-arrow-prev {
    left: 10px;
}

.quickview-gallery-arrow-next {
    right: 10px;
}

/* Contador de imágenes */
.quickview-gallery-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Wrapper de thumbnails con flechas */
.quickview-thumbnails-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
    max-width: 400px;
}

/* Container de thumbnails (con overflow) */
.quickview-thumbnails-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Galería de thumbnails */
.quickview-gallery {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease-in-out;
}

.quickview-gallery-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--professional-border-light, #dee2e6);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background: var(--professional-bg-light, #ffffff);
}

.quickview-gallery-item:hover {
    border-color: var(--professional-primary, #5949ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(89, 73, 255, 0.2);
}

.quickview-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.quickview-gallery-item.active {
    border-color: var(--professional-primary, #5949ff);
    box-shadow: 0 0 0 1px var(--professional-primary, #5949ff);
}

/* Flechas de thumbnails */
.quickview-thumbnails-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--professional-bg-light, #ffffff);
    border: 1px solid var(--professional-border-light, #dee2e6);
    color: var(--professional-text-primary, #212121);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quickview-thumbnails-arrow:hover {
    background: var(--professional-primary, #5949ff);
    color: white;
    border-color: var(--professional-primary, #5949ff);
}

.quickview-thumbnails-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   INFORMACIÓN DEL PRODUCTO
   ========================================================================== */

.quickview-product-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--professional-text-primary, #212121);
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.quickview-product-meta {
    margin-bottom: 20px;
}

.quickview-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--professional-text-muted, #adb5bd);
}

.quickview-stars {
    display: flex;
    gap: 2px;
}

.quickview-star {
    font-size: 16px;
    color: var(--professional-border-light, #dee2e6);
}

.quickview-star.filled {
    color: var(--professional-warning, #fdcb6e);
}

.quickview-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--professional-primary, #5949ff);
    margin-bottom: 20px;
    line-height: 1.2;
}


quickview-stock in-stock{

    display: flex ; align-items: center; gap: 8px; margin-bottom: 30px;
}

/* ==========================================================================
   SELECTOR DE CANTIDAD
   ========================================================================== */

.quickview-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.quickview-quantity-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--professional-text-primary, #212121);
}

.quickview-quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--professional-success, #00b894);
    border-radius: 6px;
    overflow: hidden;
}

.quickview-quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: var(--professional-bg-light, #ffffff);
    color: var(--professional-primary, #5949ff);
}

.quickview-quantity-btn {
    width: 35px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--professional-primary, #5949ff);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quickview-quantity-btn:hover {
    background: var(--professional-bg-light, #f8f9fa);
    color: var(--professional-success, #00b894);
}

/* ==========================================================================
   PRECIO TOTAL
   ========================================================================== */

.quickview-total {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.quickview-total-label {
    font-weight: 500;
    color: var(--professional-text-primary, #212121);
    font-size: 16px;
}

.quickview-total-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--professional-primary, #5949ff);
}

.quickview-total-taxes {
    font-size: 14px;
    color: var(--professional-text-muted, #adb5bd);
}

/* ==========================================================================
   BOTONES DE ACCIÓN
   ========================================================================== */

.quickview-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
}

.quickview-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.quickview-btn-primary {
    background: var(--professional-primary, #5949ff);
    color: white;
    flex: 1.2;
}

.quickview-btn-primary:hover {
    background: var(--professional-success, #00b894);
}

.quickview-btn-secondary {
    background: var(--professional-secondary, #212529);
    color: white;
}

.quickview-btn-secondary:hover {
    background: var(--professional-primary, #5949ff);
}

.quickview-btn-whatsapp {
    background: #25d366;
    color: white;
    gap: 8px;
}

.quickview-btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-1px);
}

.quickview-btn-whatsapp i {
    font-size: 18px;
}

.quickview-wishlist {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: 1px solid var(--professional-border-light, #dee2e6);
    border-radius: 6px;
    background: var(--professional-bg-light, #ffffff);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: center;
}

.quickview-wishlist:hover {
    border-color: var(--professional-danger, #e74c3c);
    color: var(--professional-danger, #e74c3c);
}

.quickview-wishlist i {
    font-size: 16px;
    color: var(--professional-text-muted, #adb5bd);
}

.quickview-wishlist span {
    font-size: 14px;
    font-weight: 600;
    color: var(--professional-text-muted, #adb5bd);
}

.quickview-wishlist:hover i,
.quickview-wishlist:hover span {
    color: var(--professional-danger, #e74c3c);
}

/* ==========================================================================
   VARIATION SWATCHER STYLES
   ========================================================================== */

.variation-group {
    margin-bottom: 20px;
}

.variation-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--professional-text-primary, #2c3e50);
    margin-bottom: 8px;
}

.swatch-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.swatch-option {
    border: 2px solid var(--professional-border-light, #dee2e6);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.swatch-option:hover {
    border-color: var(--professional-primary, #5949ff);
    transform: translateY(-1px);
}

.swatch-option.selected {
    border-color: var(--professional-primary, #5949ff);
    box-shadow: 0 0 0 1px var(--professional-primary, #5949ff);
}

.swatch-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.swatch-option.unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 80%;
    background: var(--professional-danger, #e74c3c);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Color Swatches */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--professional-border-light, #dee2e6);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--professional-primary, #5949ff);
    box-shadow: 0 0 0 2px var(--professional-primary, #5949ff);
    position: relative;
}

/* Check icon solo para color swatches */
.color-swatch.selected::after {
    content: '\f00c'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Image Swatches */
.image-swatch {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-swatch span {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
}

/* Radio Swatches */
.radio-swatch {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--professional-text-primary, #2c3e50);
    background: white;
}

.radio-swatch:hover {
    background: var(--professional-primary, #5949ff);
    color: white;
}

.radio-swatch.selected {
    background: var(--professional-primary, #5949ff);
    color: white;
}

/* Select Swatches */
.swatch-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--professional-border-light, #dee2e6);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: var(--professional-text-primary, #2c3e50);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.swatch-select:focus {
    outline: none;
    border-color: var(--professional-primary, #5949ff);
}

.swatch-select option:disabled {
    color: var(--professional-text-muted, #adb5bd);
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .quickview-image-wrapper {
        max-width: 100%;
    }
    
    .quickview-thumbnails-wrapper {
        max-width: 100%;
    }
    
    .quickview-gallery-item {
        width: 60px;
        height: 60px;
    }
    
    .quickview-gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .quickview-thumbnails-arrow {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .quickview-gallery-item {
        width: 50px;
        height: 50px;
    }
    
    .quickview-gallery-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .quickview-gallery-counter {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* Responsive Swatches */
@media (max-width: 768px) {
    .swatch-options {
        gap: 6px;
    }
    
    .color-swatch {
        width: 28px;
        height: 28px;
    }
    
    .image-swatch {
        width: 45px;
        height: 45px;
    }
    
    .radio-swatch {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .variation-group {
        margin-bottom: 15px;
    }
    
    .variation-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .swatch-options {
        gap: 4px;
    }
    
    .color-swatch {
        width: 24px;
        height: 24px;
    }
    
    .image-swatch {
        width: 40px;
        height: 40px;
    }
    
    .radio-swatch {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .quickview-content {
        flex-direction: column;
    }
    
    .quickview-product {
        flex-direction: column;
        height: auto;
    }
    
    .quickview-product-left,
    .quickview-product-right {
        flex: none;
        width: 100%;
        padding: 20px;
        border: none;
        border-bottom: 1px solid var(--professional-border-light, #dee2e6);
    }
    
    .quickview-product-right {
        justify-content: flex-start;
        border-bottom: none;
    }
    
    .quickview-image-main {
        max-width: 100%;
        height: 300px;
    }
    
    .quickview-gallery {
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .quickview-header {
        padding: 15px 20px;
    }
    
    .quickview-product {
        flex-direction: column;
    }
    
    .quickview-product-left,
    .quickview-product-right {
        padding: 15px;
    }
    
    .quickview-image-main {
        height: 250px;
    }
    
    .quickview-gallery-item {
        width: 80px;
        height: 80px;
    }
    
    .quickview-product-title {
        font-size: 20px;
    }
    
    .quickview-price {
        font-size: 28px;
    }
    
    .quickview-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quickview-btn {
        width: 100%;
    }
}
