/* ========================================
   RESPONSIVE STYLES
======================================== */

/* ========================================
   LARGE DESKTOP (1200px+)
======================================== */
@media (min-width: 1200px) {
    .custom-gallery-grid {
        height: 800px;
        grid-template-rows: repeat(5, 140px);
    }
}

/* ========================================
   DESKTOP RESPONSIVE (768px+)
======================================== */
@media (min-width: 768px) {
    .custom-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(5, 120px);
        height: 650px;
    }
    
    /* Reset and redefine for desktop */
    .img1, .img2, .img3, .img4, .img5, .img6 {
        grid-column: unset;
        grid-row: unset;
    }
    
    .img1 { grid-column: 1; grid-row: 1 / 4; }
    .img2 { grid-column: 1; grid-row: 4 / 6; }
    .img3 { grid-column: 2; grid-row: 1 / 3; }
    .img4 { grid-column: 2; grid-row: 3 / 6; }
    .img5 { grid-column: 3; grid-row: 1 / 4; }
    .img6 { grid-column: 3; grid-row: 4 / 6; }
    
    .find-room-icon { display: none; }
    .find-room-text { display: inline; }
    .mobile-nav-arrows { display: none; }
    
    .gallery-modal-body {
        max-height: 60vh;
    }

    .room-modal-thumbs {
        padding: 30px 8px !important;
    }
    
    .room-modal-thumb {
        width: 152px;
        height: 82px;
    }
    
    
    
    .room-modal-container .col-lg-8 {
        min-height: auto;
    }

    .modal-body > .row > .col-md-7 { 
        border-right: none !important; 
        border-bottom: 2px solid #f0f0f0 !important; 
        margin-bottom:18px;
    }
    
    .modal-body > .row > .col-md-5 { 
        padding-left: 0 !important;
    }
}

/* ========================================
   TABLET RESPONSIVE (max-width: 900px)
======================================== */
@media (max-width: 900px) {
    .custom-datepicker-wrap { 
        max-width: 98vw;
    }
    
    .calendar-month { 
        min-width: 200px;
    }

    .booking-box,.booking-box-detail {
        min-width: 320px;
        max-width: 99vw;
        flex-direction: column;
        gap: 12px;
        padding: 18px 10px;
    }
    
    .booking-fields {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .booking-where,
    .booking-checkin,
    .booking-checkout,
    .booking-guests {
        
        width: 100%;
        min-width: auto;
    }
    
    .booking-button {
        margin-left: 0;
        width: 100%;
    }
    
    .find-room-btn {
        width: 100%;
    }
    
    .overlay-menu {
        width: 50vw;
    }
    
    .gallery-modal-grid {
        column-count: 3;
    }
}

/* ========================================
   MOBILE RESPONSIVE (max-width: 768px)
======================================== */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.7rem;
    }
    
    
    
    .booking-fields {
        flex-direction: row;
        gap: 15px;
    }
    
    .booking-where {
        flex: 2;
    }
    
    .booking-guests {
        flex: 1;
    }
    
    .find-room-text {
        display: none;
    }
    
    .find-room-icon {
        display: inline-block;
    }
    
    .find-room-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }
    
    .booking-box, .booking-box-detail {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .booking-button {
        width: auto;
    }
    
    .city-tab-btn {
        padding: 0.5rem 1rem;
        font-size: 1.3rem;
    }
    
    .custom-gallery-grid {
        gap: 1rem;
    }
    
    .district-link {
        font-size: 1rem;
        padding: 0.25rem 0.5rem;
    }
    
    .ms-4.mb-4.d-flex {
        margin-left: 0 !important;
        margin-bottom: 1rem !important;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        flex-wrap: nowrap !important;
    }
    
    .ms-4.mb-4.d-flex::-webkit-scrollbar {
        display: none;
    }
    
    .ms-4.mb-4.d-flex a {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        white-space: nowrap;
        font-size: 0.875rem;
    }
    
    .btn-signup,
    .btn-download {
        padding: 0.4rem 1.5rem;
        font-size: 1rem;
        border-radius: 20px;
    }
    
    .mv-citizen-section h2 {
        font-size: 2rem !important;
    }
    
    .mv-citizen-section p {
        font-size: 1rem;
    }
    
    .mv-citizen-section .col-lg-6 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem;
    }
    
    .hotel-grid-mobile {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
    }
    
    .hotel-grid-mobile::-webkit-scrollbar {
        display: none;
    }
    
    .hotel-grid-mobile .row {
        flex-wrap: nowrap !important;
        width: max-content;
    }
    
    .hotel-grid-mobile .col-md-4 {
        flex: 0 0 85vw;
        max-width: 85vw;
        margin-right: 1rem;
    }
    
    .mobile-nav-arrows {
        display: flex;
        justify-content: center;
        gap: 2rem;
        margin-top: 2rem;
    }
    
    .mobile-nav-arrow {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 2px solid #ddd;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: #666;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-arrow:hover {
        border-color: var(--color-secondary);
        color: var(--color-secondary);
    }
    
    .mobile-nav-arrow.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    .gallery-modal-grid {
        column-count: 2;
        column-gap: 0.75rem;
    }
    
    .gallery-modal-grid > div {
        margin-bottom: 0.75rem;
    }
    
    .modal-img {
        min-height: 120px;
        max-height: 300px;
    }

    .datepicker-dropdown {
        width: 95vw;
        left: -50px;
        padding: 1rem;
    }

    .datepicker-dropdown-2 {
        width: 95vw;
        left: -50px;
        padding: 1rem;
    }

    .guest-selector-box {
        width: 320px;
        left: -50px;
        padding: 1rem;
    }
       .booking-box.sticky {
        position: fixed !important;
        top: 20%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 11;        
        box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
        border-radius: 40px !important;
        margin: 0 !important;
        animation: none !important;
    }
    .navbar-custom.navbar-scrolled {
        display: none !important;
    }

    .booking-box-detail.sticky {
        position: fixed !important;
        top: 40%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 11;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
        border-radius: 40px !important;
        margin: 0 !important;
        animation: none !important;
    }
}

/* ========================================
   SMALL TABLET / LARGE MOBILE (max-width: 640px)
======================================== */
@media (max-width: 640px) {
    .custom-datepicker-calendar { 
        flex-direction: column; 
        align-items:center;
    }
    
    .calendar-arrow { 
        margin: 10px auto;
    }
}

/* ========================================
   SMALL MOBILE (max-width: 576px)
======================================== */
@media (max-width: 576px) {
    .booking-box,.booking-box-detail {
        width: 95vw;
        max-width: 95vw;
    }
    
    .booking-where {
        flex: 1.5;
        min-width: 120px;
    }
    
    .booking-guests {
        flex: 1;
        min-width: 100px;
    }
    
    .overlay-menu {
        width: 100vw;
    }

    .datepicker-dropdown {
        width: 100vw;
        left: -20px;
        margin-top: 4px;
        border-radius: 1rem 1rem 0 0;
    }

    .datepicker-dropdown-2 {
        width: 100vw;
        left: -20px;
        margin-top: 4px;
        border-radius: 1rem 1rem 0 0;
    }

    .guest-selector-box {
        width: 95vw;
        left: -20px;
        margin-top: 4px;
        border-radius: 1rem 1rem 0 0;
    }
}

/* ========================================
   EXTRA SMALL MOBILE (max-width: 480px)
======================================== */
@media (max-width: 480px) {
    .city-tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 1.3rem;
    }
    
    .city-tab-menu {
        margin-bottom: 1rem !important;
    }
    
    .custom-gallery-grid {
        gap: 0.75rem;
        grid-auto-rows: 120px;
        height: 600px;
    }
    
    .gallery-img {
        border-radius: 8px;
    }
    
    .member-title {
        font-size: 1.8rem;
    }
    
    .member-subtitle {
        font-size: 0.95rem;
    }
    
    .overview-tab {
        font-size: 1rem;
        padding: 8px 10px;
    }
    
    .gallery-modal-grid {
        column-count: 1;
        column-gap: 0.5rem;
    }
    
    .gallery-modal-grid > div {
        margin-bottom: 0.5rem;
    }
    
    .modal-img {
        min-height: 200px;
        max-height: 350px;
    }
    
    .gallery-modal-body {
        max-height: 50vh;
    }
    
    #room-modal-main-img {
        height: 218px !important;
    }
    
    .modal-dialog {
        margin: 8px;
    }
    
    .room-modal-thumbs {
        padding: 8px 4px !important;
        display: none;
    }
    
    .room-modal-thumb {
        width: 100px;
        height: 54px;
    }

    .guest-selector-box { 
        max-width:99vw; 
        padding:15px 6vw;
    }
    
    .guest-row { 
        min-height:42px; 
    }
    
    .guest-title { 
        font-size: 1.05rem; 
    }
    
    .guest-desc { 
        font-size: .93rem;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .no-print {
        display: none !important;
    }
    
    .breadcrumb-item a {
        color: var(--color-primary) !important;
        text-decoration: none;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        content: ">" !important;
        font-weight: normal !important;
        margin-left: 10px;
        margin-right: 10px;
        color: var(--color-primary) !important;
    }
    
    .booking-box,.booking-box-detail {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        z-index: auto;
        width: 100%;
        max-width: 100%;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .booking-fields {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .booking-where,
    .booking-checkin,
    .booking-checkout,
    .booking-guests {
        flex: 1 1 200px;
        min-width: 150px;
    }
    
    .booking-button {
        margin-left: 0;
        width: auto;
        flex: 1 1 150px;
    }
    
    .hero-top,
    .hero-slideshow,
    .navbar-custom,
    .explore-btn,
    .overlay-menu {
        display: none !important;
    }
    
    .print-section {
        display: block !important;
    }
}

/* ========================================
   MOBILE CAROUSEL (768px - 991.98px)
======================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .mobile-carousel {
        display: block !important;
    }
    
    .mobile-carousel-container {
        display: flex !important;
        
        scroll-behavior: smooth;
        gap: 0;
        transition: transform 0.3s ease;
    }
    
    .mobile-card-slide {
        flex: 0 0 50% !important; /* Show 2 cards (50% each) */
        width: 50% !important;
        opacity: 1 !important;
        display: block !important;
        padding: 0 0.5rem; /* Add spacing between cards */
        box-sizing: border-box;
    }
    
    .mobile-card-slide .card {
        margin: 0 !important;
        height: 100%;
    }
    
    /* Remove mx-3 margin for tablet */
    .mobile-card-slide .card.mx-3 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Adjust card proportions for tablet */
    .mobile-card-slide .card-img-fixed-2 {
        height: 180px;
        object-fit: cover;
    }
    
    .mobile-card-slide .card-body {
        padding: 1rem 0.8rem;
    }
    
    .mobile-card-slide .card-body h6 {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .mobile-card-slide .card-footer {
        padding: 0 0.8rem 0.8rem;
    }
    
    /* Navigation arrows styling for tablet */
    .mobile-nav-arrows {
        display: flex !important;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .mobile-nav-arrow {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid #ddd;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .mobile-nav-arrow:hover {
        background: #f8f9fa;
        border-color: #bbb;
    }
    
    .mobile-nav-arrow:disabled {
        opacity: 0.5 !important;
        cursor: not-allowed !important;
        pointer-events: none;
    }
    
    .mobile-nav-arrow:not(:disabled) {
        opacity: 1 !important;
        cursor: pointer !important;
        pointer-events: auto;
    }
    
    .mobile-nav-arrow:not(:disabled):hover {
        background: #f8f9fa !important;
        border-color: #bbb !important;
        transform: scale(1.05);
    }
    
    /* Ensure proper transition for tablet carousel */
    .mobile-carousel-container {
        transition: transform 0.3s ease !important;
    }
}

/* ========================================
   MOBILE CAROUSEL (max-width: 767.98px)
======================================== */
@media (max-width: 767.98px) {
    .mobile-carousel-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }
    
    .mobile-card-slide {
        scroll-snap-align: center;
    }
}
