/*--------------------------------------------------------------
# Modal Components
--------------------------------------------------------------*/

/* Modal General Styles */
.modal-full-height {
    height: 100vh;
}

.modal-right {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 400px;
    max-width: 90vw;
    margin: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-right {
    transform: translateX(0);
}

/* Forzar que el modal se posicione a la derecha */
#sideModal .modal-dialog {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    margin: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

#sideModal.show .modal-dialog {
    transform: translateX(0);
}

.modal-backdrop.show {
    opacity: 0.5;
}

.modal-content {
    border-left: 3px solid #24b540;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    padding: 1rem;
}

/* Side Modal (Cart) */
#sideModal .modal-header {
    background-color: #24b540;
    color: white;
    border-bottom: 2px solid #1e9535;
}

#sideModal .modal-header .close {
    color: white;
    opacity: 1;
}

#sideModal .modal-footer {
    background-color: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

/* Modal Registro */
.modal-registro {
    background-color: #f5fff0;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    padding: 20px;
    color: #2d3e1e;
    font-family: Arial, sans-serif;
}

.modal-header-registro {
    background-color: #3a5f0b;
    color: white;
    padding: 15px;
    border-radius: 10px;
}

.modal-header-registro .modal-title {
    font-size: 18px;
    font-weight: bold;
}

.modal-header-registro .close {
    color: white;
    opacity: 0.8;
    font-size: 20px;
    transition: opacity 0.3s ease;
}

.modal-header-registro .close:hover {
    opacity: 1;
}

.modal-body-registro {
    padding: 20px;
}

.modal-footer-registro {
    background-color: #e5f4dc;
    padding: 15px;
    text-align: right;
    border-radius: 10px;
}

/* Modal Contact (Victor Modal) */
#victorModal .modal-content {
    background-color: #f5fff0;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    padding: 0px;
    font-family: Arial, sans-serif;
    color: #2d3e1e;
    height: 42rem;
}

#victorModal .modal-header {
    background-color: #3a5f0b;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 15px;
}

#victorModal .titulo_contacto {
    font-size: 18px;
    font-weight: bold;
}

#victorModal .btn-close-modal-contacto {
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    background-color: transparent;
    border: transparent;
    font-size: 2rem;
}

#victorModal .btn-close-modal-contacto:hover {
    opacity: 1;
}

#victorModal .modal-body {
    padding: 20px;
}

/* ============================================
   MODAL POPUP INICIO - Professional Design
   ============================================ */

/* Modal Overlay */
.modal-popup-inicio {
    z-index: 10000;
}

.modal-popup-inicio .modal-dialog {
    max-width: 500px;
    max-height: 85vh;
    margin: 2vh auto;
    display: flex;
    align-items: center;
}

.modal-popup-inicio .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    width: 100%;
}

.modal-popup-inicio .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

/* Swiper Container */
.modal-popup-inicio .swiper {
    width: 100%;
    height: calc(85vh - 70px);
    max-height: calc(85vh - 70px);
    background: #000000;
    position: relative;
}

.modal-popup-inicio .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: hidden;
}

.modal-popup-inicio .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Buttons - Modern Minimal */
.modal-popup-inicio .swiper-button-prev,
.modal-popup-inicio .swiper-button-next {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-popup-inicio .swiper-button-prev::before,
.modal-popup-inicio .swiper-button-next::before,
.modal-popup-inicio .swiper-button-prev::after,
.modal-popup-inicio .swiper-button-next::after {
    content: '' !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.modal-popup-inicio .swiper-button-prev svg,
.modal-popup-inicio .swiper-button-next svg {
    width: 24px;
    height: 24px;
    display: block;
    pointer-events: none;
}

.modal-popup-inicio .swiper-button-prev:hover,
.modal-popup-inicio .swiper-button-next:hover {
    background: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-popup-inicio .swiper-button-prev {
    left: 20px;
}

.modal-popup-inicio .swiper-button-next {
    right: 20px;
}

.modal-popup-inicio .swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Pagination - Instagram Style */
.modal-popup-inicio .swiper-pagination {
    bottom: 24px !important;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.modal-popup-inicio .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    margin: 0 !important;
}

.modal-popup-inicio .swiper-pagination-bullet-active {
    background: #ffffff;
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

/* Footer with Close Options */
.popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding: 12px 20px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
}

.popup-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.popup-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #24b540;
}

.popup-checkbox-label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.btn-cerrar-footer {
    padding: 10px 32px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
    letter-spacing: 0.5px;
}

.btn-cerrar-footer:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.35);
}

.btn-cerrar-footer:active {
    transform: translateY(0);
}

/* Modal Animation */
.modal-popup-inicio.fade .modal-dialog {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-out;
}

.modal-popup-inicio.show .modal-dialog {
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-popup-inicio .modal-dialog {
        max-width: 450px;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .modal-popup-inicio .modal-content {
        border-radius: 12px;
    }
    
    .modal-popup-inicio .swiper {
        height: calc(95vh - 65px);
        max-height: calc(95vh - 65px);
    }
    
    .modal-popup-inicio .swiper-button-prev,
    .modal-popup-inicio .swiper-button-next {
        width: 40px;
        height: 40px;
    }
    
    .modal-popup-inicio .swiper-button-prev svg,
    .modal-popup-inicio .swiper-button-next svg {
        width: 20px;
        height: 20px;
    }
    
    .modal-popup-inicio .swiper-button-prev {
        left: 12px;
    }
    
    .modal-popup-inicio .swiper-button-next {
        right: 12px;
    }
    
    .modal-popup-inicio .swiper-pagination {
        bottom: 16px !important;
    }
    
    .popup-footer {
        padding: 12px 16px;
        flex-direction: row;
        gap: 12px;
    }
    
    .btn-cerrar-footer {
        width: auto;
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .modal-popup-inicio .modal-dialog {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        height: 100vh;
    }
    
    .modal-popup-inicio .modal-content {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .modal-popup-inicio .swiper {
        height: calc(100vh - 70px);
        max-height: calc(100vh - 70px);
    }
    
    .modal-popup-inicio .swiper-button-prev,
    .modal-popup-inicio .swiper-button-next {
        width: 36px;
        height: 36px;
    }
    
    .modal-popup-inicio .swiper-button-prev svg,
    .modal-popup-inicio .swiper-button-next svg {
        width: 18px;
        height: 18px;
    }
    
    .modal-popup-inicio .swiper-button-prev {
        left: 8px;
    }
    
    .modal-popup-inicio .swiper-button-next {
        right: 8px;
    }
    
    .modal-popup-inicio .swiper-pagination {
        bottom: 12px !important;
    }
    
    .modal-popup-inicio .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }
    
    .modal-popup-inicio .swiper-pagination-bullet-active {
        width: 20px;
    }
    
    .popup-footer {
        padding: 12px;
    }
    
    .popup-checkbox-label {
        font-size: 0.85rem;
    }
    
    .btn-cerrar-footer {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-popup-inicio .swiper-slide {
        background: #1a1a1a;
    }
}
