:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --modal-bg: rgba(10, 10, 10, 0.85); /* Semitransparente oscuro */
    --modal-text: #ffffff;
    --accent-color: #ffffff;
    --transition-speed: 0.3s;
    --easing: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Evitar scroll cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* --- Estilos del Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition-speed) var(--easing), visibility var(--transition-speed);
}

.modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
}

/* Controles del Modal Base */
.modal-close, .nav-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--accent-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-close:hover, .nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #000;
    transform: scale(1.05);
}

.modal-close {
    top: 16px;
    right: 16px;
    background: #f1f3f5;
    color: #333;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-close:hover {
    background: #e9ecef;
    color: #000;
}

.nav-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.nav-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Modal Cardview Layout */
.modal-card {
    position: relative;
    z-index: 1005;
    width: 90vw;
    max-width: 1100px;
    height: 85vh;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-speed) var(--easing), opacity var(--transition-speed) var(--easing);
    opacity: 0;
}

.modal.active .modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Sección de la Imagen */
.modal-image-section {
    flex: 1; /* 60% approx */
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-section img {
    width: 100%;
    height: 100%;
    padding: 20px;
    border-radius: 30px;
    object-fit: cover; /* Cambiado a cover para llenar la tarjeta */
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.4s var(--easing);
}

/* Animación al cambiar de imagen (slide) */
.modal-image-section img.slide-out-left { opacity: 0; transform: translateX(-30px); }
.modal-image-section img.slide-out-right { opacity: 0; transform: translateX(30px); }
.modal-image-section img.slide-in-left { opacity: 0; transform: translateX(30px); }
.modal-image-section img.slide-in-right { opacity: 0; transform: translateX(-30px); }

.modal-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
}

/* Loader */
.modal-loader {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}
.modal.loading .modal-loader { display: block; }
.modal.loading img { opacity: 0; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sección de Detalles */
.modal-details-section {
    flex: 1; /* 40% approx */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: var(--text-color);
    position: relative;
}

.details-content {
    padding: 40px 32px 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.product-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f3f5;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-desc {
    display: inline-block;
    background: #f1f3f5;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 12px;
    color: #111827;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.rating-score { font-weight: 600; color: #111827; }
.rating-reviews { color: #6b7280; text-decoration: underline; cursor: pointer; }

.product-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 24px 0;
}
.product-duration {
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 700;
    margin-bottom: 32px;
}
.product-description {
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.product-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Itinerary Grid */
.itinerary-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    margin-top: 0;
}

.itinerary-days {
    display: grid;
    grid-template-columns: repeat(1fr, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.itinerary-day {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.day-header {
    color: #333;
    font-weight: 600;
    padding: 10px 16px;
    font-size: 1rem;
}

.day-activities {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
}

.day-activities li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 0.95rem;
}

.day-activities li:last-child {
    margin-bottom: 0;
}

.day-activities li::before {
    content: "•";
    color: #ffa900;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* Inclusions / Exclusions */
.inclusions-section {
    display: grid;
    grid-template-columns: 1fr ;
    gap: 16px;
    margin-bottom: 24px;
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
}

.inclusions-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: #111827;
}

.included ul, .not-included ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.included ul li, .not-included ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #4b5563;
}

.included ul li:last-child, .not-included ul li:last-child {
    margin-bottom: 0;
}

.included ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.not-included ul li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: bold;
}
/* Footer de Detalles */
.product-footer {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.price-container {
    display: flex;
    flex-direction: column;
    font-size: small;
    margin-top: 20px;
}

.price-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.btn-primary {
    background: #ffa900;
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: #ffa900;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 860px) {
    .modal-card {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
    
    .modal-image-section {
        flex: none;
        height: 45vh;
    }

    .modal-details-section {
        flex: 1;
    }

    .details-content {
        padding: 24px 24px 16px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        z-index: 1020;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    .nav-prev { left: 12px; }
    .nav-next { right: 12px; }

    .product-features {
        grid-template-columns: 1fr;
    }

    .itinerary-days,
    .inclusions-section {
        grid-template-columns: 1fr;
    }

    .tour-schedule .tour-schedule-list {
        display: flex;
    }
}

/* --- Promotional Modal Styles --- */
.promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
    background-color: rgba(0, 0, 0, 0.75);
}

.promo-modal.active {
    visibility: visible;
    opacity: 1;
}

.promo-modal-content {
    position: relative;
    width: 90vw;
    max-width: 520px; /* Poster width limit */
    background: transparent;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.promo-modal.active .promo-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.promo-close {
    position: absolute;
    top: -16px;
    right: -16px;
    background: #ffffff;
    color: #333;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2020;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.promo-close:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.promo-modal-content img {
    width: 100%;
    height: 100%;
    max-height: 85vh;
    object-fit: contain; /* Ensure the whole poster fits */
    display: block;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.promo-modal-content img.fade-out {
    opacity: 0;
}

.promo-prev, .promo-next {
    z-index: 2010;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: #000;
}

.promo-prev:hover, .promo-next:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.promo-prev {
    left: -18px;
}

.promo-next {
    right: -18px;
}

.promo-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    z-index: 2010;
}

@media (max-width: 600px) {
    .promo-prev { left: 8px; }
    .promo-next { right: 8px; }
    .promo-close { top: 8px; right: 8px; }
}
