/* ============================================
   Room Information Modal
   ============================================ */
.room-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s 0.3s;
    /* Prevent scrolling beyond modal edges on mobile */
    overflow: hidden;
    /* Critical: modal must not block clicks when closed */
    pointer-events: none;
    touch-action: auto;
}

.room-info-modal.active {
    opacity: 1;
    visibility: visible;
    z-index: 10001;
    transition: opacity 0.3s ease, visibility 0.3s ease, z-index 0s;
    /* Prevent body scroll when modal is open */
    overflow: hidden;
    pointer-events: auto;
    touch-action: none;
}

.room-info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    /* Critical: overlay must not block when modal is closed */
    pointer-events: none;
}

.room-info-modal.active .room-info-modal-overlay {
    pointer-events: auto;
}

.room-info-modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.98);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    /* Prevent scrolling beyond content edges */
    touch-action: pan-y;
    /* Ensure content is visible immediately */
    opacity: 1;
    visibility: visible;
}

.room-info-modal.active .room-info-modal-content {
    transform: scale(1);
}

.room-info-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-white);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.room-info-close:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.room-info-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid var(--accent-color);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 5;
    flex-shrink: 0;
}

.room-info-title {
    font-size: 2rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    margin: 0;
}

.room-info-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.room-image-carousel {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: var(--bg-light);
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.carousel-images {
    width: 100%;
    min-height: auto;
    max-height: calc(85vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    width: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.carousel-image.active {
    display: flex;
    opacity: 1;
}

.carousel-image picture {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.carousel-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(85vh - 200px);
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: #fff;
}

.carousel-image img.portrait {
    max-width: min(70vw, 500px);
    max-height: calc(85vh - 180px);
}

.carousel-image img.square {
    max-width: min(80vw, 600px);
    max-height: calc(85vh - 180px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: var(--transition);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    min-width: 44px;
    min-height: 44px;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 1rem;
}

.carousel-btn-next {
    right: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-white);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    min-width: 12px;
    min-height: 12px;
}

.carousel-indicator.active {
    background: var(--text-white);
    transform: scale(1.2);
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.room-info-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.room-detail-section {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 165, 165, 0.2);
}

.room-detail-section h3 {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.room-detail-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.room-detail-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.room-detail-section ul li {
    padding: 0.35rem 0;
    padding-left: 0;
    position: relative;
    color: var(--text-light);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.amenity-icon {
    font-size: 1rem;
    line-height: 1.5;
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

/* Room Overview Section */
.room-overview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border: 2px solid var(--accent-color);
}

.room-overview-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.room-overview-item .room-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.room-overview-item h4 {
    font-size: 0.875rem;
    /* Increased from 0.75rem for better readability */
    color: var(--text-light);
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.room-overview-item p {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}


/* Make description and additional info span full width for better readability */
.room-description-section,
.room-additional-section {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {

    /* Ensure navbar stays fixed to viewport on mobile */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }

    /* Prevent body scroll when any modal/sidebar is open */
    body:has(.room-info-modal.active),
    body:has(.checkout-sidebar.active),
    body:has(.checkout-page.active),
    body:has(.custom-modal.active),
    body:has(.success-modal.active) {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        touch-action: none !important;
    }

    .room-overview {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .room-info-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .room-detail-section {
        padding: 0.875rem;
    }

    .room-info-body {
        padding: 1rem;
    }

    .room-info-modal-content {
        width: 95%;
        max-height: 95vh;
        max-height: 95dvh;
        border-radius: 15px;
    }

    .room-info-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .room-info-title {
        font-size: 1.5rem;
    }

    .room-info-body {
        padding: 1.5rem;
    }

    .carousel-images {
        min-height: 180px;
        max-height: calc(60vh - 120px);
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .carousel-btn-prev {
        left: 0.5rem;
    }

    .carousel-btn-next {
        right: 0.5rem;
    }

    .room-info-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .room-detail-section {
        padding: 1.25rem;
    }

    .room-info-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    /* Room image mobile */
    .pricing-room-image {
        height: 180px;
    }

    .room-image-hint {
        font-size: 0.875rem;
        /* Increased from 0.8rem for better readability */
        padding: 0.4rem 0.8rem;
    }
}

/* ============================================
   Customer Notes Modal Styles (Checkout)
   ============================================ */

.customer-notes-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010;
    /* Higher than checkout page (10002) and checkout footer (10005) */
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.customer-notes-modal {
    background: linear-gradient(135deg, #fff9f5 0%, #ffffff 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(184, 138, 138, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.customer-notes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 2px solid #f3e4d8;
}

.customer-notes-modal-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #8b6b5d;
}

.customer-notes-close-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-notes-close-btn .close-btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5ebe5;
    border: 2px solid #d9c5b8;
    color: #8b6b5d;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
}

.customer-notes-close-btn:hover .close-btn-circle {
    background: #efe3db;
    border-color: #c9a595;
    color: #6d5248;
    transform: scale(1.05);
}

.customer-notes-modal-body {
    padding: 1.25rem 1.75rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.customer-notes-intro {
    color: #7d6b63;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: #fff5ef;
    border-radius: 8px;
    border-left: 3px solid #d9a58e;
}

.customer-notes-field {
    margin-bottom: 1.25rem;
}

.customer-notes-field label {
    display: block;
    font-weight: 600;
    color: #5d4a45;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.customer-notes-field .required-indicator {
    color: #d47070;
    margin-left: 0.25rem;
    font-weight: bold;
}

.customer-notes-field .field-description {
    font-size: 0.85rem;
    color: #8a7a72;
    margin: 0 0 0.5rem;
    font-style: italic;
}

.customer-notes-field input[type="text"],
.customer-notes-field textarea,
.customer-notes-field select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid #e8dcd5;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #4a3f3a;
    transition: all 0.2s ease;
}

.customer-notes-field input[type="text"]:focus,
.customer-notes-field textarea:focus,
.customer-notes-field select:focus {
    outline: none;
    border-color: #c9a595;
    box-shadow: 0 0 0 3px rgba(201, 165, 149, 0.2);
}

.customer-notes-field textarea {
    resize: vertical;
    min-height: 80px;
}

.customer-notes-field .char-counter {
    font-size: 0.75rem;
    color: #a09080;
    text-align: right;
    margin-top: 0.25rem;
}

/* Checkbox field styling */
.customer-notes-field-checkbox {
    background: #faf5f2;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e8dcd5;
}

.customer-notes-field-checkbox .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: normal;
}

.customer-notes-field-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    accent-color: #b88a8a;
    cursor: pointer;
}

.customer-notes-field-checkbox .checkbox-text {
    color: #5d4a45;
    font-size: 0.95rem;
    line-height: 1.4;
}

.customer-notes-field-checkbox .field-description {
    margin-top: 0.5rem;
    padding-left: 1.85rem;
}

.required-indicator-text {
    font-size: 0.85rem;
    color: #a08070;
    margin-top: 1rem;
    text-align: center;
    font-style: italic;
}

.customer-notes-disclaimer {
    font-size: 0.85rem;
    color: #8a7b72;
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #faf8f6 0%, #f5f0eb 100%);
    border-radius: 8px;
    border: 1px solid #e8e0d8;
    text-align: center;
    line-height: 1.5;
}

.customer-notes-validation-error {
    background: #fff0f0;
    border: 1px solid #e8c0c0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #8b4545;
}

.customer-notes-validation-error strong {
    display: block;
    margin-bottom: 0.5rem;
}

.customer-notes-validation-error ul {
    margin: 0;
    padding-left: 1.25rem;
}

.customer-notes-validation-error li {
    margin: 0.25rem 0;
}

.customer-notes-modal-footer {
    display: flex;
    justify-content: stretch;
    gap: 0.75rem;
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid #f0e4dd;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fff9f5 0%, #ffffff 100%);
}

.customer-notes-modal-footer .btn-secondary {
    background: #f5ebe5;
    border: 2px solid #d9c5b8;
    color: #7d6b63;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.customer-notes-modal-footer .btn-secondary:hover {
    background: #efe3db;
    border-color: #c9b5a8;
}

.customer-notes-modal-footer .btn-primary,
.customer-notes-modal-footer .btn-save-notes {
    background: linear-gradient(135deg, #d9a58e 0%, #c48f79 100%);
    border: none;
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(212, 165, 142, 0.3);
    flex: 1;
    text-align: center;
}

.customer-notes-modal-footer .btn-primary:hover,
.customer-notes-modal-footer .btn-save-notes:hover {
    background: linear-gradient(135deg, #c48f79 0%, #b57a65 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 143, 121, 0.4);
}

/* Add Note Button in Checkout */
.checkout-add-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff9f5 0%, #fff4ed 100%);
    border: 2px dashed #d9c5b8;
    border-radius: 10px;
    color: #8b6b5d;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-add-note-btn:hover {
    background: linear-gradient(135deg, #fff4ed 0%, #ffede3 100%);
    border-color: #c9a595;
}

.checkout-add-note-btn.needs-attention {
    border-color: #e8a040;
    background: linear-gradient(135deg, #fffaf2 0%, #fff5e5 100%);
}

.checkout-add-note-btn.has-notes {
    border-style: solid;
    border-color: #7db97d;
    background: linear-gradient(135deg, #f5fff7 0%, #efffef 100%);
    color: #4a7a4a;
}

.note-status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

.note-status-indicator.has-notes {
    background: #7db97d;
    color: white;
}

.note-status-indicator.needs-attention {
    background: #e8a040;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Mobile responsive */
@media (max-width: 600px) {
    .customer-notes-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .customer-notes-modal-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .customer-notes-modal-header h2 {
        font-size: 1.25rem;
    }

    .customer-notes-modal-body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .customer-notes-modal-footer {
        padding: 0.75rem 1.25rem 1.25rem;
        flex-direction: column;
    }

    .customer-notes-modal-footer button {
        width: 100%;
    }
}