/* css/product-modal.css - Modal de productos Sumaq Express */

/* ============================================================================
   MODAL BASE
   ============================================================================ */

.sumaq-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sumaq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.sumaq-modal-content {
    background: white;
    border-radius: 8px;
    width: 95%;
    max-width: 1100px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: sumaqModalSlideIn 0.3s ease-out;
    
    /* Centrado perfecto */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes sumaqModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ============================================================================
   HEADER DEL MODAL (BOTÓN INTEGRADO)
   ============================================================================ */

.sumaq-modal-header {
    position: relative;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.sumaq-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sumaq-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ============================================================================
   BODY DEL MODAL
   ============================================================================ */

.sumaq-modal-body {
    padding: 25px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.sumaq-loading {
    text-align: center;
    padding: 60px 20px;
}

.sumaq-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: sumaqSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes sumaqSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   LAYOUT PRINCIPAL DEL MODAL (TU DISEÑO)
   ============================================================================ */

.sumaq-modal-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    min-height: 400px;
}

/* COLUMNA IZQUIERDA - IMAGEN */
.sumaq-modal-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sumaq-product-image-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
}

.sumaq-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.sumaq-main-image:hover {
    transform: scale(1.05);
}

/* Galería de miniaturas */
.sumaq-gallery-thumbs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.sumaq-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.sumaq-thumb:hover,
.sumaq-thumb.active {
    border-color: #FFD700;
    opacity: 1;
    transform: scale(1.1);
}

/* COLUMNA DERECHA - INFORMACIÓN */
.sumaq-modal-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.sumaq-product-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.3;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.sumaq-product-description {
    color: #666;
    line-height: 1.6;
    font-size: 16px;
    flex-grow: 1;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

/* ============================================================================
   PRECIOS (MINIMALISTAS)
   ============================================================================ */

.sumaq-price-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 3px solid #FFD700;
}

.sumaq-price-regular {
    font-size: 14px;
    color: #95a5a6;
    text-decoration: line-through;
    margin-bottom: 8px;
}

.sumaq-price-discount {
    font-size: 20px;
    font-weight: 600;
    color: #e74c3c;
}

/* ============================================================================
   CONTROLES DE CARRITO (ELEGANTES)
   ============================================================================ */

.sumaq-cart-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 25px 0 0;
    margin-top: auto;
}

/* Controles de cantidad */
.sumaq-quantity-container {
    display: flex;
    align-items: center;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.sumaq-qty-btn {
    background: #f8f9fa;
    border: none;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sumaq-qty-btn:hover {
    background: #FFD700;
    color: #333;
}

.sumaq-qty-input {
    border: none;
    width: 60px;
    height: 42px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    background: #fff;
    outline: none;
    color: #2c3e50;
}

/* Botón de agregar al carrito (solo "Agregar") */
.sumaq-add-to-cart-btn {
    background: #FFD700;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sumaq-add-to-cart-btn:hover {
    background: #FFC700;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.sumaq-add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   VARIACIONES DE PRODUCTOS
   ============================================================================ */

.sumaq-variations {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.sumaq-variations h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.sumaq-variation-group {
    margin-bottom: 15px;
}

.sumaq-variation-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.sumaq-variation-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease;
}

.sumaq-variation-select:focus {
    outline: none;
    border-color: #FFD700;
}

/* ============================================================================
   CARDS CLICKEABLES (ESPECÍFICO PARA #sumaq-listing-productos)
   ============================================================================ */

/* RESETEAR cursor en el contenedor principal primero */
#sumaq-listing-productos {
    cursor: default !important;
}

/* RESETEAR cursor en todos los contenedores intermedios */
#sumaq-listing-productos .elementor-section,
#sumaq-listing-productos .elementor-container,
#sumaq-listing-productos .elementor-column,
#sumaq-listing-productos .elementor-widget,
#sumaq-listing-productos .elementor-widget-container,
#sumaq-listing-productos .jet-listing-grid,
#sumaq-listing-productos .jet-listing-grid__slider,
#sumaq-listing-productos .jet-listing-grid__items {
    cursor: default !important;
}

/* ELIMINAR COMPLETAMENTE TODAS LAS ANIMACIONES */
#sumaq-listing-productos .jet-listing-grid__item,
#sumaq-listing-productos .jet-listing-grid__item *,
#sumaq-listing-productos .jet-listing-grid__item *::before,
#sumaq-listing-productos .jet-listing-grid__item *::after,
#sumaq-listing-productos .jet-listing-grid__item .elementor-172,
#sumaq-listing-productos .jet-listing-grid__item [data-elementor-id="172"],
#sumaq-listing-productos .jet-listing-grid__item button,
#sumaq-listing-productos .jet-listing-grid__item .single_add_to_cart_button {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    box-shadow: none !important;
}

/* ELIMINAR HOVER EFFECTS COMPLETAMENTE */
#sumaq-listing-productos .jet-listing-grid__item:hover,
#sumaq-listing-productos .jet-listing-grid__item:hover *,
#sumaq-listing-productos .jet-listing-grid__item .elementor-172:hover,
#sumaq-listing-productos .jet-listing-grid__item [data-elementor-id="172"]:hover,
#sumaq-listing-productos .jet-listing-grid__item button:hover,
#sumaq-listing-productos .jet-listing-grid__item .single_add_to_cart_button:hover {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    box-shadow: none !important;
}

/* Solo cursor pointer para las cards INDIVIDUALES */
#sumaq-listing-productos .jet-listing-grid__item {
    cursor: pointer !important;
    position: relative !important;
}

/* Clase JavaScript - solo cursor en cards */
#sumaq-listing-productos .sumaq-card-clickable {
    cursor: pointer !important;
}

/* ============================================================================
   ARREGLAR CARRITO TACHADO - SIN INTERFERIR CON SHORTCODE
   ============================================================================ */

/* Arreglar SOLO el carrito lateral/mini-cart */
.woocommerce-mini-cart-item .woocommerce-Price-amount,
.widget_shopping_cart_content .woocommerce-Price-amount,
.cart_list .woocommerce-Price-amount {
    text-decoration: none !important;
}

/* También para el carrito completo */
.woocommerce-cart-form .woocommerce-Price-amount,
.cart-subtotal .woocommerce-Price-amount,
.order-total .woocommerce-Price-amount {
    text-decoration: none !important;
}

/* Pero NO interferir with el shortcode del listing */
.elementor-shortcode .woocommerce-Price-amount {
    text-decoration: inherit !important;
}

/* Estado de loading para cards */
.sumaq-loading-card {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.sumaq-loading-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #FFD700;
    border-radius: 50%;
    animation: sumaqSpin 1s linear infinite;
    z-index: 10;
}

/* ============================================================================
   NOTIFICACIONES
   ============================================================================ */

.sumaq-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.sumaq-notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.sumaq-notification.error {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

/* ============================================================================
   RESPONSIVE DESIGN (SIEMPRE CENTRADO)
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .sumaq-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .sumaq-modal-container {
        gap: 25px;
    }
    
    .sumaq-product-title {
        font-size: 22px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sumaq-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .sumaq-modal-body {
        padding: 25px 20px;
    }
    
    .sumaq-modal-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .sumaq-modal-right {
        order: 1;
    }
    
    .sumaq-modal-left {
        order: 2;
    }
    
    .sumaq-product-title {
        font-size: 20px;
    }
    
    .sumaq-cart-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .sumaq-quantity-container {
        align-self: center;
        max-width: 180px;
    }
    
    .sumaq-add-to-cart-btn {
        padding: 16px 25px;
        font-size: 14px;
    }
    
    .sumaq-product-image-container {
        min-height: 250px;
        max-height: 300px;
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .sumaq-modal-content {
        width: 98%;
        max-height: 98vh;
    }
    
    .sumaq-modal-body {
        padding: 20px 15px;
    }
    
    .sumaq-product-title {
        font-size: 18px;
    }
    
    .sumaq-product-description {
        font-size: 14px;
    }
}

/* ============================================================================
   PREVENIR SCROLL DEL BODY
   ============================================================================ */

body.sumaq-modal-open {
    overflow: hidden;
    padding-right: 0;
}

/* ============================================================================
   MEJORAS DE ACCESIBILIDAD
   ============================================================================ */

.sumaq-modal-close:focus,
.sumaq-qty-btn:focus,
.sumaq-qty-input:focus,
.sumaq-add-to-cart-btn:focus,
.sumaq-variation-select:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* ============================================================================
   ESTILOS PARA ELEMENTOS INTERNOS DE CARDS
   ============================================================================ */

/* Asegurar que elementos internos de cards mantengan su funcionalidad */
.sumaq-card-clickable button,
.sumaq-card-clickable a,
.sumaq-card-clickable input,
.sumaq-card-clickable select,
.sumaq-card-clickable textarea {
    position: relative;
    z-index: 2;
}

/* Prevenir que textos dentro de cards interfieran con el click */
.sumaq-card-clickable h1,
.sumaq-card-clickable h2,
.sumaq-card-clickable h3,
.sumaq-card-clickable h4,
.sumaq-card-clickable h5,
.sumaq-card-clickable h6,
.sumaq-card-clickable p,
.sumaq-card-clickable span,
.sumaq-card-clickable div:not([class*="button"]) {
    pointer-events: none;
}

/* ============================================================================
   OPTIMIZACIONES DE PERFORMANCE
   ============================================================================ */

.sumaq-card-clickable {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.sumaq-main-image {
    will-change: transform;
}

.sumaq-add-to-cart-btn {
    will-change: transform, box-shadow;
}

/* ============================================================================
   CLASES UTILITARIAS
   ============================================================================ */

/* Para deshabilitar el modal en cards específicas */
.no-modal-click,
.sumaq-no-modal {
    cursor: default !important;
    pointer-events: auto !important;
}

.no-modal-click:hover,
.sumaq-no-modal:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Para elementos que NO deben abrir el modal */
.no-modal-click {
    pointer-events: auto !important;
}

/* Scrollbar personalizado para el modal */
.sumaq-modal-body::-webkit-scrollbar {
    width: 8px;
}

.sumaq-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sumaq-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.sumaq-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}