/* WC Advanced Variations - Frontend Styles */

/* Grid de productos */
.wc-adv-var-products-grid {
    margin: 20px 0;
}

.wc-adv-var-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.wc-adv-var-filters,
.wc-adv-var-sorting {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wc-adv-var-filters select,
.wc-adv-var-sorting select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.wc-adv-var-products-container {
    position: relative;
}

.wc-adv-var-products-row {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Tarjetas de producto - ACTUALIZADO */
.wc-adv-var-product-card {
    background: #005C3C; /* Color de fondo actualizado */
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.wc-adv-var-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,92,60,0.3); /* Sombra con el color de la tarjeta */
}

/* Imagen con proporción 1:1 y border - ACTUALIZADO */
.wc-adv-var-product-card .product-image {
    position: relative;
    overflow: hidden;
    padding: 5px; /* Espacio para el border */
    background: #005C3C; /* Fondo del border */
}

.wc-adv-var-product-card .product-image img {
    width: 100%;
    aspect-ratio: 1 / 1; /* Proporción 1:1 */
    object-fit: cover;
    transition: transform 0.3s ease;
    border: 5px solid #ffffff; /* Border blanco de 5px */
    border-radius: 8px;
    display: block;
}

.wc-adv-var-product-card:hover .product-image img {
    transform: scale(1.05);
}

.wc-adv-var-product-card .sale-badge {
    position: absolute;
    top: 15px; /* Ajustado para el padding */
    left: 15px; /* Ajustado para el padding */
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.wc-adv-var-product-card .product-actions {
    position: absolute;
    top: 15px; /* Ajustado para el padding */
    right: 15px; /* Ajustado para el padding */
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wc-adv-var-product-card:hover .product-actions {
    opacity: 1;
}

.wc-adv-var-product-card .product-actions button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.wc-adv-var-product-card .product-actions button:hover {
    background: #ffffff;
    color: #005C3C; /* Color del hover actualizado */
    transform: scale(1.1);
}

/* Información del producto - ACTUALIZADO */
.wc-adv-var-product-card .product-info {
    padding: 20px;
    background: #005C3C; /* Asegurar el fondo */
}

.wc-adv-var-product-card .product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.wc-adv-var-product-card .product-title a {
    color: #ffffff; /* Texto blanco para contraste */
    text-decoration: none;
    transition: color 0.3s ease;
}

.wc-adv-var-product-card .product-title a:hover {
    color: #cccccc; /* Color hover más claro */
}

.wc-adv-var-product-card .product-price {
    display: none;
}

.wc-adv-var-product-card .product-excerpt {
    color: #e0e0e0; /* Color claro para el texto */
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.wc-adv-var-product-card .product-rating {
    margin-bottom: 15px;
}

/* Rating stars - ACTUALIZADO para visibilidad */
.wc-adv-var-product-card .product-rating .star-rating {
    color: #ffd700; /* Estrellas doradas */
}

.wc-adv-var-product-card .product-variations-preview {
    border-top: 1px solid rgba(255,255,255,0.2); /* Border semi-transparente */
    padding-top: 15px;
}

.wc-adv-var-product-card .show-variations-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
}

.wc-adv-var-product-card .show-variations-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.wc-adv-var-product-card .variations-container {
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.wc-adv-var-product-card .variations-container.open {
    max-height: 200px;
}

/* Widget avanzado */
.wc-adv-var-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 20px 0;
}

.wc-adv-var-widget .widget-product-image {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
}

.wc-adv-var-widget .widget-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.wc-adv-var-widget .widget-product-info {
    padding: 30px;
}

.wc-adv-var-widget .widget-product-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.wc-adv-var-widget .widget-product-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.wc-adv-var-widget .widget-product-price {
    margin-bottom: 30px;
}

.wc-adv-var-widget .current-price {
    font-size: 28px;
    font-weight: bold;
    color: #007cba;
}

.wc-adv-var-widget .total-price {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    margin-left: 15px;
}

.wc-adv-var-widget .widget-variations-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wc-adv-var-widget .widget-variations-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.wc-adv-var-widget .attribute-group {
    margin-bottom: 20px;
}

.wc-adv-var-widget .attribute-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wc-adv-var-widget .attribute-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
}

.wc-adv-var-variations {
    margin-top: 20px;
}

.wc-adv-var-variation {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-adv-var-variation:hover {
    border-color: #005C3C;
    background: #f0f8f0;
}

.wc-adv-var-variation.selected {
    border-color: #005C3C;
    background: #e6f3e6;
}

.wc-adv-var-variation.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.wc-adv-var-variation .variation-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.wc-adv-var-variation .variation-info .price {
    font-weight: bold;
    color: #005C3C;
}

.wc-adv-var-variation .variation-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* Add-ons de YITH */
.yith-addons-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.yith-addons-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.yith-addon-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.yith-addon-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.yith-addon-group h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.yith-addon-group .required {
    color: #e74c3c;
    font-weight: bold;
}

.yith-addon-group .addon-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yith-addon-group .addon-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.yith-addon-group .addon-options label:hover {
    border-color: #005C3C;
    background: #f0f8f0;
}

.yith-addon-group .addon-options label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Acciones del widget */
.wc-adv-var-widget .widget-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.wc-adv-var-widget .btn {
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
}

.wc-adv-var-widget .btn-primary {
    background: #005C3C;
    color: white;
}

.wc-adv-var-widget .btn-primary:hover:not(:disabled) {
    background: #004a30;
    transform: translateY(-2px);
}

.wc-adv-var-widget .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wc-adv-var-widget .btn-secondary {
    background: #6c757d;
    color: white;
}

.wc-adv-var-widget .btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* Paginación */
.wc-adv-var-pagination {
    text-align: center;
    margin-top: 30px;
}

.wc-adv-var-load-more {
    background: #005C3C;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-adv-var-load-more:hover {
    background: #004a30;
    transform: translateY(-2px);
}

.wc-adv-var-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Estados de carga */
.wc-adv-var-loader {
    text-align: center;
    padding: 40px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #005C3C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.mini-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #005C3C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wc-adv-var-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

.wc-adv-var-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

/* Modal de vista rápida */
.wc-adv-var-quick-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wc-adv-var-quick-view-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.wc-adv-var-quick-view-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.wc-adv-var-quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.quick-view-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.quick-view-details h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.quick-view-price {
    font-size: 20px;
    font-weight: bold;
    color: #005C3C;
    margin-bottom: 15px;
}

.quick-view-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quick-view-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.quick-view-meta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.quick-view-meta span {
    display: block;
    margin-bottom: 5px;
}

/* Responsive - ACTUALIZADO */
@media (max-width: 768px) {
    .wc-adv-var-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wc-adv-var-filters,
    .wc-adv-var-sorting {
        justify-content: center;
    }
    
    .wc-adv-var-products-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    /* Mantener proporción 1:1 en móvil */
    .wc-adv-var-product-card .product-image img {
        aspect-ratio: 1 / 1;
        border: 3px solid #ffffff; /* Border más pequeño en móvil */
    }
    
    .wc-adv-var-product-card .product-info {
        padding: 15px;
    }
    
    .wc-adv-var-widget .widget-product-info {
        padding: 20px;
    }
    
    .wc-adv-var-widget .widget-actions {
        flex-direction: column;
    }
    
    .wc-adv-var-quick-view-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wc-adv-var-products-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Mantener proporción 1:1 en móvil pequeño */
    .wc-adv-var-product-card .product-image img {
        aspect-ratio: 1 / 1;
        border: 3px solid #ffffff;
    }
    
    .wc-adv-var-filters select,
    .wc-adv-var-sorting select {
        min-width: 120px;
        font-size: 13px;
    }
}

/* Estilos adicionales para integración con el carousel */
.wc-adv-var-no-images {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

/* Prevenir scroll del body cuando el zoom está abierto */
body.zoom-modal-open {
    overflow: hidden !important;
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .gallery-nav {
        opacity: 1;
        background: rgba(255, 255, 255, 0.8);
    }
    
    .zoom-indicator {
        opacity: 1;
    }
    
    .main-product-image:hover {
        transform: none;
    }
}

/* Animaciones suaves */
.main-product-image,
.zoom-image {
    transition: opacity 0.2s ease;
}

.thumbnail-item {
    transition: all 0.3s ease;
}

.thumbnails-container {
    scroll-behavior: smooth;
}

/* Placeholder de carga */
.wc-adv-var-loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #e0e0e0; /* Color claro para el fondo verde */
    font-style: italic;
    background: #005C3C;
    border-radius: 8px;
}

.wc-adv-var-loading-placeholder p {
    margin: 0;
    color: #ffffff;
}
