.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 41, 59, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.light-modal {
    background: var(--light);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30,41,59,0.25);
    max-width: 900px; /* Wider for landscape */
    width: 90vw;
    padding: 1.5rem 1rem 1rem 1rem; /* Reduced padding */
    position: relative;
    text-align: center;
    animation: modalIn 0.4s cubic-bezier(.4,2,.6,1) both;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalIn {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 5px;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.7rem;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.modal-close:hover { color: var(--primary); }

.modal-image-container {
    position: relative;
    width: 100%;
    flex: 1; /* Take available space */
    min-height: 550px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Changed to cover to fill container */
    border-radius: 8px;
    transition: opacity 0.4s;
    position: absolute;
    opacity: 0;
}

.modal-image-container img.active {
    opacity: 1;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-light);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.85;
    transition: background 0.2s, opacity 0.2s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-nav-btn:hover { background: var(--primary); opacity: 1; }
.modal-nav-btn.left { left: 0.7rem; }
.modal-nav-btn.right { right: 0.7rem; }

.image-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0.8rem 0;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
    cursor: pointer;
    transition: background 0.3s;
}

.indicator.active {
    background: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions button {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.apply-btn {
    background: var(--primary);
    color: #fff;
}
.apply-btn:hover {
    background: var(--primary-light);
}

.pay-btn {
    background: var(--success);
    color: #fff;
}
.pay-btn:hover {
    background: #059669;
}

@media (max-width: 900px) {
    .light-modal {
        padding: 1.2rem 0.8rem 0.8rem 0.8rem;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }

    .modal-image-container {
        min-height: 300px;
    }

    .modal-nav-btn {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.8rem;
    }
    .modal-close {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .light-modal {
        padding: 1rem 0.6rem 0.6rem 0.6rem;
    }

    .modal-image-container {
        min-height: 250px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.7rem;
    }
    
    .modal-actions button {
        width: 100%;
    }
}