/* Shared modal styles (home + subpages). Mobile: overlay scroll + safe areas. */
@keyframes rlcModalFadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rlcContactModalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 10040;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    touch-action: pan-y;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: min(90vh, 90dvh);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: rlcModalFadeInUp 0.5s ease-out;
    position: relative;
    margin: auto;
    touch-action: pan-y;
}

#contactModal .modal-content.contact-modal-shell {
    padding: 0 !important;
    max-width: min(92vw, 920px) !important;
    animation: rlcContactModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
    max-height: min(92vh, 92dvh);
}

@media (prefers-reduced-motion: reduce) {
    #contactModal .modal-content.contact-modal-shell { animation: none !important; }
}

body.reduce-motion #contactModal .modal-content.contact-modal-shell {
    animation: none !important;
}

@media (max-width: 767px) {
    #contactModal .modal-content.contact-modal-shell {
        display: flex;
        flex-direction: column;
    }
    #contactModal .modal-content.contact-modal-shell > .grid {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

.contact-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #012a52;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-modal-close:hover {
    background: #ff0052;
    color: white;
    transform: scale(1.05);
}

.book-modal-responsive {
    max-width: 850px !important;
}

.book-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.info-section, .trip-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
}

.trip-section {
    background: #f0f9ff;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #012a52;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header {
    font-size: 28px;
    font-weight: 900;
    color: #012a52;
    margin-bottom: 10px;
}

.modal-subtext {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    color: white;
    background: #e40046;
    transform: rotate(90deg) scale(1.1);
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #012a52;
    font-size: 14px;
}

.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal .form-group input:focus,
.modal .form-group textarea:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: #e40046;
    box-shadow: 0 0 0 3px rgba(228, 0, 70, 0.1);
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e40046, #ff1a5e);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(228, 0, 70, 0.3);
}

@media (max-width: 768px) {
    .modal-content {
        width: min(95vw, 100%) !important;
        max-height: min(92vh, 92dvh) !important;
        max-width: 100% !important;
        padding: 24px !important;
        margin: 0 auto !important;
    }
    .book-modal-responsive {
        max-width: 100% !important;
    }
    .book-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .info-section, .trip-section {
        padding: 16px !important;
    }
    .section-title {
        font-size: 15px !important;
        margin-bottom: 12px !important;
    }
    .modal .form-group {
        margin-bottom: 12px !important;
    }
    .modal .form-group input,
    .modal .form-group select,
    .modal .form-group textarea {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
    }
    .modal .form-group label {
        font-size: 13px !important;
    }
    .modal-close {
        font-size: 32px !important;
        top: 12px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(0,0,0,0.05) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .modal-header {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }
    .modal-subtext {
        font-size: 13px !important;
    }
    .modal.show {
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px !important;
    }
    .modal .form-group {
        margin-bottom: 12px !important;
    }
}

/* “How would you like to reach us?” — comfortable taps on phones */
#contactChoiceModal .rlc-contact-choice-shell {
    padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.5rem) clamp(1.25rem, 4vw, 1.5rem);
    max-width: min(100%, 26rem) !important;
}

#contactChoiceModal .rlc-choice-tap {
    min-height: 48px;
    -webkit-tap-highlight-color: rgba(2, 42, 82, 0.08);
}

@media (max-width: 480px) {
    #contactChoiceModal .modal-content.rlc-contact-choice-shell {
        padding: clamp(1rem, 4vw, 1.25rem) clamp(0.875rem, 3vw, 1rem) !important;
        border-radius: 20px;
    }
}
