/* /assets/css/product-modal.css (Versión Actualizada) */

.product-modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.product-modal-content {
    background-color: #ffffff;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 98vh;
    display: flex; flex-direction: column; position: relative;
    transform: scale(0.9); transition: transform 0.3s ease;
    overflow: hidden;
}

.product-modal-backdrop.visible .product-modal-content {
    transform: scale(1);
}

.modal-header-actions {
    position: absolute; top: 10px; right: 10px; z-index: 15;
}

.modal-header-actions .favorite-button {
    background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%; width: 48px; height: 48px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-header-actions .favorite-button:hover {
    transform: scale(1.1); background: rgba(0, 0, 0, 0.8);
}

.modal-header-actions .favorite-button svg {
    width: 28px; height: 28px; color: #ffffff;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-header-actions .favorite-button.active svg {
    color: var(--favorite-color, #FF0000); transform: scale(1.1);
}

.modal-close-button {
    position: absolute; top: 15px; left: 15px;
    background: rgba(0, 0, 0, 0.3); color: white; border: none;
    border-radius: 50%; width: 30px; height: 30px;
    font-size: 1.5rem; cursor: pointer; line-height: 1; z-index: 10;
}

.modal-image-container { width: 100%; height: 300px; background-color: #f0f0f0; }
.modal-image-container img { width: 100%; height: 100%; object-fit: cover; }
.modal-details { padding: 1.5rem; overflow-y: auto; }
.modal-details h2 { margin-top: 0; font-size: 1.8em; color: #212529; }
.modal-details .modal-description { color: #6c757d; line-height: 1.6; font-size: 0.9em; margin-bottom: 1.5rem; }

.modal-price-stock {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem;
}

.modal-price { font-size: 1.8em; font-weight: bold; color: #28a745; }
.modal-stock { font-size: 0.9em; font-weight: 500; color: #fff; padding: 0.3rem 0.8rem; border-radius: 20px; }
.modal-stock.available { background-color: #17a2b8; }
.modal-stock.out-of-stock { background-color: #6c757d; }

.combinations-container { margin-top: 1rem; }
.combinations-container h4 {
    font-size: 1em; color: #343a40; margin-bottom: 0.75rem;
    border-top: 1px solid #eee; padding-top: 1rem;
}

.combination-options { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.combo-option {
    padding: 0.5rem 1rem; border: 2px solid #e0e0e0;
    border-radius: 20px; cursor: pointer; font-size: 0.9em;
    font-weight: 500; transition: all 0.2s ease;
}
.combo-option:hover { background-color: #f0f0f0; }
.combo-option.selected { border-color: #007bff; background-color: #007bff; color: white; }
.combo-option.disabled { opacity: 0.5; cursor: not-allowed; background-color: #f8f9fa; text-decoration: line-through; }

.product-modal-content.disabled-modal { filter: grayscale(1); }
.product-modal-content.disabled-modal * { pointer-events: none; }
.product-modal-content.disabled-modal .modal-header-actions,
.product-modal-content.disabled-modal .modal-header-actions *,
.product-modal-content.disabled-modal .modal-close-button { pointer-events: auto; }

/* ▼▼▼ INICIO: ESTILOS NUEVOS ▼▼▼ */
.modal-actions-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    background-color: #111;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.quantity-selector button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.quantity-display {
    font-size: 1.5rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.modal-buttons-grid {
    display: flex; /* Cambiado de grid a flex */
    justify-content: center; /* Centra el botón horizontalmente */
    gap: 1rem;
}

.add-to-cart-button,
.modal-whatsapp-button {
    padding: 1rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.add-to-cart-button:hover,
.modal-whatsapp-button:hover {
    transform: scale(1.05);
}

.add-to-cart-button {
    background-color: #000;
    color: #fff;
    padding: 1rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s;
    width: 80%; /* Haz que el botón ocupe un buen espacio */
    max-width: 300px; /* Ponle un límite para que no sea excesivamente grande */
}

.modal-whatsapp-button {
    background-color: #25d366;
    color: #fff;
}
/* ▲▲▲ FIN: ESTILOS NUEVOS ▲▲▲ */
/* /assets/css/product-modal.css */

/* ... (TUS ESTILOS EXISTENTES VAN AQUÍ) ... */


/* ▼▼▼ AGREGA ESTOS NUEVOS ESTILOS AL FINAL DE TU ARCHIVO ▼▼▼ */

.combinations-container { 
    margin-top: 1rem; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variant-group {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.variant-group-title {
    font-size: 1em; 
    color: #343a40; 
    margin: 0 0 0.75rem 0;
}

.variant-options { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.75rem; 
}

.variant-option {
    padding: 0.6rem 1.2rem; 
    border: 2px solid #e0e0e0;
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.9em;
    font-weight: 500; 
    transition: all 0.2s ease;
    background-color: #fff;
    color: #333;
}

.variant-option:hover:not(:disabled) { 
    background-color: #f0f0f0;
    border-color: #b0b0b0;
}

.variant-option.selected { 
    border-color: #007bff; 
    background-color: #007bff; 
    color: white; 
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.variant-option:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    background-color: #f8f9fa; 
    text-decoration: line-through;
    color: #aaa;
}

.add-to-cart-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
    font-size: 1.1rem;
    color: #6c757d;
}

/* --- INICIO: ESTILOS PARA EL SLIDER DE IMÁGENES DEL MODAL --- */

.modal-image-container {
    position: relative; /* Clave para posicionar flechas y puntos */
    overflow: hidden;   /* Oculta las otras imágenes */
    width: 100%;
    height: 300px;
    background-color: #f0f0f0;
}

.modal-image-slider {
    display: flex; /* Permite que las imágenes se pongan en fila */
    height: 100%;
    transition: transform 0.4s ease-in-out; /* Animación de deslizamiento */
    /* overflow: visible !important; */ /* Puedes quitar esto si quieres, la clave es la visibilidad */
}

.modal-image-slider .slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    background-color: #e0e0e0;
    position: relative;
    
    /* --- ¡SOLUCIÓN DEFINITIVA! --- */
    /* Esto anula 'visibility: hidden' del archivo style.css */
    visibility: visible;
    opacity: 1;
}

.modal-image-slider .slide img {
    display: block; /* Asegura que se comporte como un bloque */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Estilos para el video */
.modal-image-slider .slide.video-slide {
    background-color: #000;
}

.modal-image-slider .slide iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex; /* <-- CORREGIDO: De vuelta a 'flex' */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-image-container:hover .modal-slider-nav {
    opacity: 1;
}

.modal-slider-nav.prev {
    left: 10px;
}

.modal-slider-nav.next {
    right: 10px;
}

.modal-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* <-- CORREGIDO: De vuelta a 'flex' */
    gap: 8px;
    z-index: 10;
}

.modal-slider-dots .dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-slider-dots .dot.active {
    background-color: white;
}

/* --- FIN: ESTILOS PARA EL SLIDER --- */
/* --- INICIO DE LA SOLUCIÓN (PARTE 3) --- */
/* Hacer que las imágenes del slider (que no sean videos)
   muestren un cursor de "puntero" para indicar que son clickeables */

.modal-image-slider .slide:not(.video-slide) img {
    cursor: pointer;
}