/**
 * CSS para Vista Rápida de Productos
 * Estilo MercadoLibre consistente con el plugin
 * 
 * @package WC_Productos_Template
 */

/* ===== OVERLAY Y CONTENEDOR PRINCIPAL ===== */
.wc-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.wc-quick-view-overlay.active {
    display: flex;
}

.wc-quick-view-modal {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: wc-quick-view-fade-in 0.3s ease;
}

@keyframes wc-quick-view-fade-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== BOTÓN DE CIERRE ===== */
.wc-quick-view-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    transition: all 0.2s ease;
}

.wc-quick-view-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #e74c3c;
    transform: scale(1.05);
}

/* ===== CONTENIDO PRINCIPAL ===== */
.wc-quick-view-content {
    display: flex;
    padding: 20px;
    gap: 30px;
}

/* ===== GALERÍA DE IMÁGENES ===== */
.wc-quick-view-gallery {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wc-quick-view-main-image {
    position: relative;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-quick-view-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.wc-quick-view-main-image:hover img {
    transform: scale(1.05);
}

/* Badges sobre la imagen */
.wc-quick-view-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 3;
}

.wc-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-badge-instock {
    background-color: #00a650;
    color: white;
}

.wc-badge-outofstock {
    background-color: #f23c4c;
    color: white;
}

.wc-badge-danger {
    background-color: #ff6900;
    color: white;
    animation: pulse 2s infinite;
}

/* Thumbnails */
.wc-quick-view-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.wc-quick-view-thumbnail {
    flex: 0 0 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-quick-view-thumbnail.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.wc-quick-view-thumbnail:hover {
    border-color: #93c5fd;
}

.wc-quick-view-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== INFORMACIÓN DEL PRODUCTO ===== */
.wc-quick-view-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Referencias horizontales */
.wc-quick-view-references {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.wc-ref-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.wc-ref-label {
    font-weight: 700;
    color: #374151;
}

.wc-ref-value {
    font-weight: 500;
    color: #6b7280;
}

.wc-cas-number {
    font-family: 'Courier New', monospace;
    background: #dbeafe;
    padding: 2px 6px;
    border-radius: 3px;
    color: #1e40af;
}

.wc-purity-grade {
    background: #dcfce7;
    padding: 2px 6px;
    border-radius: 3px;
    color: #166534;
    font-weight: 600;
    text-transform: uppercase;
}

/* Título */
.wc-quick-view-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.2;
}

/* Fórmula molecular */
.wc-quick-view-formula {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
}

.wc-molecular-formula {
    font-family: 'Times New Roman', serif;
    font-size: 16px;
    font-weight: 500;
    color: #92400e;
}

/* Precio */
.wc-quick-view-price {
    font-size: 28px;
    font-weight: 700;
    color: #00a650;
}

.wc-quick-view-price .price-hidden {
    font-size: 16px;
    color: #6b7280;
    font-style: italic;
}

/* Rating */
.wc-quick-view-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-quick-view-rating-stars {
    position: relative;
    display: inline-block;
    font-size: 18px;
    color: #fbbf24;
}

.wc-rating-stars {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: #fbbf24;
}

.wc-rating-stars-bg {
    color: #e5e7eb;
}

.wc-quick-view-rating-count {
    font-size: 14px;
    color: #6b7280;
}

/* Descripción */
.wc-quick-view-description {
    color: #4b5563;
    line-height: 1.6;
    font-size: 14px;
}

/* Pictogramas de peligro */
.wc-quick-view-hazards {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.wc-hazard-pictograms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.wc-hazard-pictogram {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: white;
    border: 1px solid #dc2626;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.wc-hazard-pictogram:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.wc-pictogram-symbol {
    font-size: 14px;
}

.wc-pictogram-name {
    color: #dc2626;
    font-weight: 600;
}

/* Almacenamiento */
.wc-quick-view-storage {
    padding: 10px;
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    font-size: 14px;
}

.wc-storage-info {
    color: #0c4a6e;
    font-style: italic;
}

/* Variaciones */
.wc-quick-view-variations {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    background: #f9fafb;
}

.wc-quick-view-variations h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #374151;
}

.wc-quick-view-variation-attribute {
    margin-bottom: 12px;
}

.wc-quick-view-variation-attribute label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.wc-quick-view-attribute-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Cantidad */
.wc-quick-view-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-quick-view-quantity label {
    font-weight: 600;
    color: #374151;
}

.wc-quick-view-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.wc-quantity-minus,
.wc-quantity-plus {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    transition: background 0.2s ease;
}

.wc-quantity-minus:hover,
.wc-quantity-plus:hover {
    background: #e5e7eb;
}

.wc-quantity-input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-weight: 600;
    outline: none;
}

/* Botones de acción */
.wc-quick-view-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.wc-quick-view-add-to-cart,
.wc-quick-view-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 16px;
}

.wc-quick-view-add-to-cart:hover,
.wc-quick-view-login:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.wc-quick-view-add-to-cart:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wc-quick-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.wc-quick-view-details:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

/* Meta información */
.wc-quick-view-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 20px;
}

.wc-quick-view-sku,
.wc-quick-view-categories {
    display: flex;
    gap: 8px;
}

.wc-quick-view-categories a {
    color: #3b82f6;
    text-decoration: none;
}

.wc-quick-view-categories a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .wc-quick-view-overlay {
        padding: 10px;
    }
    
    .wc-quick-view-content {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
    }
    
    .wc-quick-view-gallery {
        flex: none;
    }
    
    .wc-quick-view-main-image {
        aspect-ratio: 4/3;
    }
    
    .wc-quick-view-references {
        flex-direction: column;
        gap: 8px;
    }
    
    .wc-quick-view-title {
        font-size: 20px;
    }
    
    .wc-quick-view-price {
        font-size: 24px;
    }
    
    .wc-hazard-pictograms {
        justify-content: center;
    }
    
    .wc-pictogram-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .wc-quick-view-modal {
        max-height: 95vh;
    }
    
    .wc-quick-view-content {
        padding: 10px;
    }
    
    .wc-quick-view-title {
        font-size: 18px;
    }
    
    .wc-quick-view-actions {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 15px 0 5px;
        margin: 15px -10px -10px;
        border-top: 1px solid #e5e7eb;
    }
}

/* ===== ESTADOS DE CARGA ===== */
.wc-quick-view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

.wc-quick-view-loading::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ===== ANIMACIONES ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ===== OVERRIDE PARA EVITAR CONFLICTOS ===== */
.wc-quick-view-overlay * {
    box-sizing: border-box;
}

.wc-quick-view-overlay a {
    color: inherit;
}

.wc-quick-view-overlay button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
.wc-quick-view-overlay[aria-hidden="true"] {
    display: none;
}

.wc-quick-view-modal[role="dialog"] {
    position: relative;
}

.wc-quick-view-close[aria-label] {
    position: relative;
}

/* ===== ESTILOS PARA EL BOTÓN EN EL GRID ===== */
.wc-productos-template .producto-vista-rapida {
    background-color: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wc-productos-template .producto-vista-rapida:hover {
    background-color: rgba(29, 78, 216, 0.95);
    transform: translateY(-1px);
}
