/* =========================================
   MOBILE RESPONSIVE DESIGN (max-width: 768px)
   ========================================= */

/* Nút Hamburger mặc định ẩn trên Desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1e293b;
    cursor: pointer;
    margin-left: 15px;
}

@media (max-width: 992px) {
    /* Tablet & Mobile Breakpoint */

    /* ---- Responsive Text Display ---- */
    .mobile-break { display: inline !important; }
    .desktop-break { display: none !important; }

    /* ---- Header & Navigation ---- */
    .mobile-menu-btn {
        display: block;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        width: 100%;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #fff;
        z-index: 999;
        flex-direction: column;
        justify-content: flex-start !important; /* Fix huge whitespace (was vertically centered) */
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        padding: 20px 0;
        box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.show {
        left: 0;
    }

    /* Hide the active red line (::after) on mobile as it breaks layout */
    .nav-link::after {
        display: none !important;
    }
    
    /* Better active state for mobile menu */
    .nav-link.active {
        color: #d82b68 !important;
        background-color: #fdf2f8;
        font-weight: 700 !important;
        border-left: 4px solid #d82b68;
    }

    /* Hide username text in header to prevent squeezing */
    .user-name-text {
        display: none !important;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
        width: 100%;
    }

    .mega-menu {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        border-top: 1px solid #eee;
        padding: 10px 20px;
        background: #f8fafc;
    }

    .nav-item.has-mega-menu.active-mega .mega-menu {
        display: block;
    }

    .mega-menu-inner {
        flex-direction: column;
        gap: 20px;
    }

    .auth-buttons {
        gap: 15px;
    }

    /* ---- Banner Section ---- */
    .banner-background {
        background-position: center right;
        background-image: url('/bg-banner.png') !important;
        height: auto;
        min-height: 400px;
    }

    .banner-content {
        top: 20px;
        left: 5%;
        right: auto;
        max-width: 65%;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        text-align: left;
    }

    .banner-content h1 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .banner-content p {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .stats {
        gap: 10px;
        margin-top: 15px;
        justify-content: flex-start;
    }

    .stat-item {
        width: calc(50% - 10px);
        padding: 5px 0;
        background: transparent;
        border-radius: 0;
        margin-bottom: 0;
        font-size: 13px;
        justify-content: flex-start;
    }

    .stat-item .stat-text strong {
        font-size: 16px;
    }

    /* ---- Service Page Banner ---- */
    .service-page-banner {
        padding: 50px 0 !important;
        min-height: auto !important;
        background-position: center !important; 
    }
    .service-banner-content {
        max-width: 100% !important;
    }
    .service-banner-content h1 {
        font-size: 32px !important;
    }
    .service-banner-content h2 {
        font-size: 18px !important;
        margin-bottom: 20px !important;
    }
    .service-banner-content p {
        font-size: 14px !important;
        margin-bottom: 25px !important;
        max-width: 75% !important;
    }
    .service-features {
        flex-wrap: wrap !important;
        gap: 15px !important;
    }
    .service-features .feature-item {
        width: calc(50% - 10px) !important;
        gap: 10px !important;
    }
    .feature-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 15px !important;
    }
    .feature-text strong {
        font-size: 14px !important;
    }
    .feature-text span {
        font-size: 12px !important;
    }

    /* ---- Mobile Visibility Classes ---- */
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: flex !important;
    }
    
    .show-on-mobile-dropdown {
        display: block !important;
    }

    /* ---- Search Widget ---- */
    .search-widget-container {
        margin-top: -30px;
        position: relative;
        z-index: 10;
        padding: 0 15px;
    }

    .search-widget {
        padding: 15px;
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    .service-icons {
        gap: 10px;
        flex-wrap: wrap;
        padding-bottom: 5px;
    }

    .service-item {
        width: calc(33.333% - 7px);
        min-height: 85px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
        flex: 0 0 auto;
    }

    .service-item .icon-circle,
    .service-item .icon-img-box {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .service-item span {
        font-size: 11px;
    }

    .widget-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 15px;
    }

    .location-selector {
        width: calc(50% - 5px);
        height: 45px;
    }

    .loc-selector-btn {
        height: 100%;
        padding: 10px;
        font-size: 12px;
    }

    .btn-search {
        width: 100%;
        height: 45px;
        margin-top: 5px;
    }

    /* ---- Grids (Services, Facilities, Articles) ---- */
    .services-grid, 
    .facilities-grid, 
    .articles-grid, 
    .reviews-slider-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .services-grid::-webkit-scrollbar,
    .facilities-grid::-webkit-scrollbar,
    .articles-grid::-webkit-scrollbar,
    .reviews-slider-track::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    /* Keep section titles to 1 row on mobile */
    .section-header {
        margin-bottom: 15px;
    }

    /* ---- Articles Section Redo ---- */
    .articles-filter {
        gap: 10px !important;
        margin-top: 10px !important;
    }
    .articles-filter a {
        font-size: 12px !important;
        padding: 4px 0 !important;
    }
    .articles-grid {
        gap: 10px !important;
        padding-bottom: 15px !important;
    }
    .article-card {
        min-width: 220px !important; /* Smaller width for horizontal scroll */
        scroll-snap-align: start;
        flex: 0 0 auto;
        gap: 10px !important; /* Smaller gap between image and title */
    }
    .article-title {
        font-size: 15px !important;
    }
    .article-thumb {
        border-radius: 12px !important;
    }

    .facility-card {
        min-width: 280px !important;
        scroll-snap-align: start;
        flex: 0 0 auto;
    }

    /* ---- Latest Reviews specifically ---- */
    .review-card {
        min-width: 340px !important;
        scroll-snap-align: start;
        flex: 0 0 auto;
        flex-direction: row !important;
        padding: 15px !important;
        gap: 15px !important;
        align-items: center;
    }
    .review-content {
        flex: 1;
        min-width: 0;
    }
    .review-images {
        flex-direction: row !important;
        gap: 5px !important;
    }
    .review-images .image-box {
        width: 80px !important;
        height: 100px !important;
        border-radius: 8px;
    }
    .user-info {
        margin-bottom: 10px !important;
        gap: 10px !important;
    }
    .user-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    .user-name {
        font-size: 13px !important;
    }
    .verified {
        font-size: 10px !important;
    }
    .user-location {
        font-size: 11px !important;
    }
    .review-meta {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center !important;
        margin-bottom: 8px !important;
    }
    .review-meta .divider,
    .review-meta .facility-name {
        display: none !important;
    }
    .review-meta strong {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }
    .review-date {
        font-size: 11px !important;
        margin-left: 10px !important;
    }
    .review-rating {
        margin-bottom: 8px !important;
    }
    .review-rating .stars i {
        font-size: 10px !important;
    }
    .rating-score {
        font-size: 12px !important;
    }
    .review-text {
        font-size: 11px !important;
        line-height: 1.4 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Disable scroll-snap for facilities so JS auto-scroll works smoothly on mobile */
    .facilities-grid {
        scroll-snap-type: none !important;
        scrollbar-width: thin !important; /* Show scrollbar on Firefox */
    }
    /* Show scrollbar for Webkit */
    .facilities-grid::-webkit-scrollbar {
        display: block !important;
        height: 4px;
    }
    .facilities-grid::-webkit-scrollbar-track {
        background: #f8f9fa;
        border-radius: 4px;
    }
    .facilities-grid::-webkit-scrollbar-thumb {
        background: #d82b68;
        border-radius: 4px;
    }

    .facility-card {
        scroll-snap-align: none !important;
    }
    
    /* Truncate text to 1 line for facility cards on mobile */
    .facility-name,
    .facility-location {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100%;
        display: block;
    }

    /* Keep section titles to 1 row on mobile */
    .section-header {
        margin-bottom: 15px;
    }
    .section-header.text-center {
        display: block !important;
        text-align: center !important;
    }
    .section-title {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex: 1;
        min-width: 0; /* Required for text-overflow to work in flex items */
        margin-right: 10px;
        margin-bottom: 15px; /* Default for standalone titles */
    }
    .section-header .section-title {
        margin-bottom: 0 !important; /* Remove margin when inside flex header */
    }
    .section-header.text-center .section-title {
        white-space: normal !important;
        overflow: visible !important;
        flex: none !important;
        margin-right: 0 !important;
        margin-bottom: 5px !important;
    }
    .section-header.text-center .section-subtitle {
        font-size: 13px !important;
        display: block !important;
        margin-top: 5px;
    }
    .view-all, .view-all-link {
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ---- Exclusive Offers ---- */
    .exclusive-offers .offer-banner {
        flex-direction: row !important;
        text-align: left !important;
        padding: 15px !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .exclusive-offers .offer-text {
        flex: 1;
    }
    .exclusive-offers .offer-text h2 {
        font-size: 15px !important;
        margin-bottom: 5px !important;
    }
    .exclusive-offers .offer-text p {
        font-size: 11px !important;
    }
    .exclusive-offers .offer-action {
        flex-direction: column !important; /* Stack image and button on the right */
        gap: 8px !important;
        flex-shrink: 0;
    }
    .exclusive-offers .offer-image img {
        width: 60px !important;
        transform: none !important;
        margin: 0 auto;
    }
    .exclusive-offers .btn-offer {
        padding: 6px 12px !important;
        font-size: 11px !important;
        width: 100%;
        text-align: center;
    }

    /* ---- Popular Services specifically ---- */
    .popular-services {
        padding-top: 40px;
    }
    .popular-services .container {
        padding: 0 10px;
    }

    .popular-services .view-all-link {
        display: none !important;
    }

    .popular-services .services-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: visible;
        gap: 0;
        justify-content: space-between;
    }

    .popular-services .service-card {
        min-width: unset !important;
        width: 16% !important;
        padding: 0;
        scroll-snap-align: none;
        gap: 6px;
    }

    .popular-services .service-icon-box {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background-color: #fff0f5;
        margin: 0 auto;
    }

    .popular-services .service-icon-box i {
        font-size: 18px;
    }

    .popular-services .service-name {
        font-size: 9px;
        white-space: normal;
        line-height: 1.2;
        text-align: center;
        letter-spacing: -0.2px;
    }

    /* Hide 6th, 7th, 8th items on mobile so we only have 5 + Xem tat ca = 6 total */
    .popular-services .service-card:nth-child(n+6):not(:last-child) {
        display: none !important;
    }

    /* ---- Footer ---- */
    .site-footer {
        padding: 40px 0 90px !important; /* Extra bottom padding for the sticky banner */
        background-image: none !important; /* Remove background image on mobile */
        background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%) !important; /* Soft pink gradient */
    }

    .footer-top {
        flex-direction: column;
        gap: 30px;
        margin-bottom: 30px !important;
    }

    .footer-col {
        width: 100%;
    }
    
    .footer-logo {
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }
    
    .footer-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }
    
    .social-links {
        margin-top: 15px !important;
        gap: 12px !important;
    }
    
    .social-links a {
        width: 36px !important;
        height: 36px !important;
    }
    
    .footer-title {
        font-size: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .footer-links li {
        margin-bottom: 10px !important;
    }
    
    .footer-links li a {
        font-size: 13px !important;
    }
    
    .footer-contact li {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }
    
    .footer-contact i {
        font-size: 14px !important;
        margin-right: 10px !important;
    }

    /* ---- Header Actions (Login/Register buttons) ---- */
    .header-actions .btn-login,
    .header-actions .btn-register {
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 576px) {

    /* Small Mobile Breakpoint */
    .banner-background {
        background-position: center bottom;
        background-image: url('/bg-banner.png') !important;
        height: auto;
        min-height: 450px;
    }

    .banner-content {
        position: relative;
        padding-top: 20px;
        text-align: left;
        left: 5%;
        right: auto;
        max-width: 55%;
        margin: 0;
    }

    .banner-content h1 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .banner-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .stat-item {
        width: 100%;
        justify-content: flex-start;
        padding: 4px 0;
    }

    .search-widget-container {
        margin-top: -30px;
    }

    .service-item {
        /* let it use the width 75px from above instead of redefining as calc(33%) */
    }
    /* Removed conflicting grid styles since we now use horizontal scrolling */
}