/* ============================================
   MODAL FLOTANTE DE PRODUCTO CON GALERÃA
   ============================================ */

/* Overlay del modal */
.product-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.product-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor del modal */
.product-modal-container {
    background: white;
    border-radius: 12px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* BotÃ³n cerrar */
.product-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.product-modal-close:hover {
    background: #dc3545;
    transform: rotate(90deg);
}

/* Contenido del modal */
.product-modal-content {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 30px;
    padding: 40px;
}

/* GalerÃ­a de imÃ¡genes */
.product-modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-modal-main-image {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f8f8f8;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.product-modal-main-image:hover img {
    transform: scale(1.03);
}

/* Botones de navegaciÃ³n en la imagen */
.product-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.2em;
}

.product-modal-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.product-modal-nav-prev {
    left: 15px;
}

.product-modal-nav-next {
    right: 15px;
}

/* Miniaturas */
.product-modal-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f0f0f0;
}

.product-modal-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.product-modal-thumbnails::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.product-modal-thumbnails::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.product-modal-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.product-modal-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: #f5f5f5;
}

.product-modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-thumbnail:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-modal-thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

/* InformaciÃ³n del producto */
.product-modal-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.product-modal-title {
    font-size: 1.75rem;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
}

.product-modal-price {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

.product-modal-description {
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.product-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-modal-meta-label {
    font-weight: bold;
    color: var(--dark);
    min-width: 100px;
}

.product-modal-colors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-modal-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.product-modal-color:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.product-modal-sizes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-modal-size {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.product-modal-size:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Botones de acciÃ³n */
.product-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.product-modal-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-modal-btn-primary {
    background: var(--primary);
    color: white;
}

.product-modal-btn-primary:hover {
    background: #b5584f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 87, 78, 0.3);
}

.product-modal-btn-secondary {
    background: #25D366;
    color: white;
}

.product-modal-btn-secondary:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Badge de destacado */
.product-modal-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #856404;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid #ffc107;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .product-modal-content {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .product-modal-title {
        font-size: 1.5rem;
    }
    
    .product-modal-price {
        font-size: 2rem;
    }
    
    .product-modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .product-modal-actions {
        flex-direction: column;
    }
}

/* Scrollbar personalizado */
.product-modal-container::-webkit-scrollbar {
    width: 8px;
}

.product-modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.product-modal-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.product-modal-container::-webkit-scrollbar-thumb:hover {
    background: #b5584f;
}

/* Indicador de foto actual */
.product-modal-photo-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   LIGHTBOX - VISOR DE IMÁGENES A PANTALLA COMPLETA
   ============================================ */

.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.5em;
    z-index: 100000;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev {
    left: 30px;
}

.lightbox-nav-next {
    right: 30px;
}

.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    z-index: 100000;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.2em;
    }
    
    .lightbox-nav-prev {
        left: 10px;
    }
    
    .lightbox-nav-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 0.95em;
    }
}
