/* ===================================================
   THỦY LONG GROUP — RESPONSIVE DESIGN SYSTEM
   Chuẩn hóa tất cả nền tảng: Desktop → Mobile
   6 Breakpoints: 1440+ / 1024 / 768 / 480 / 360
   =================================================== */

/* ============ SAFE AREA (iPhone Notch) ============ */
@supports(padding:env(safe-area-inset-top)) {
    .breadcrumb {
        padding-top: calc(8px + env(safe-area-inset-top));
        padding-left: calc(5% + env(safe-area-inset-left));
        padding-right: calc(5% + env(safe-area-inset-right))
    }

    .nav {
        padding-left: calc(5% + env(safe-area-inset-left));
        padding-right: calc(5% + env(safe-area-inset-right))
    }

    .footer {
        padding-bottom: calc(36px + env(safe-area-inset-bottom))
    }

    .float-cta {
        bottom: calc(24px + env(safe-area-inset-bottom));
        right: calc(24px + env(safe-area-inset-right))
    }
}

/* ============ LARGE DESKTOP (≥1440px) ============ */
@media(min-width:1440px) {

    /* Container constraint for readability */
    .sec {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto
    }

    .ft-grid {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto
    }

    .ft-bottom {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto
    }

    .contact-grid {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto
    }

    /* Slightly larger type for big screens */
    .hero-h1 {
        font-size: clamp(3rem, 4.2vw, 4.5rem)
    }

    .sec-h2 {
        font-size: clamp(2.2rem, 3.5vw, 3.2rem)
    }

    /* More breathing room */
    .eco-grid,
    .feat-grid {
        gap: 28px
    }

    .testi-grid {
        gap: 24px
    }
}

/* ============ NAV OVERLAY BACKDROP ============ */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    -webkit-backdrop-filter: blur(0)
}

.nav-overlay.active {
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto
}

/* ============ BODY SCROLL LOCK ============ */
body.nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: var(--scroll-y, 0)
}

/* ============ TABLET LANDSCAPE (≤1024px) ============ */
@media(max-width:1024px) {

    /* NAV MOBILE */
    .nav::after {
        display: none
    }

    .nav-links>li.has-dropdown::after {
        display: none !important
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        height: 100dvh;
        background: rgba(255, 255, 255, .98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: flex-start;
        gap: 22px;
        padding: 100px 40px 40px;
        transition: right .5s cubic-bezier(.16, 1, .3, 1);
        box-shadow: -10px 0 40px rgba(0, 0, 0, .08);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 999
    }

    .nav-links.open {
        right: 0
    }

    .nav-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center
    }

    /* Nav links touch-friendly */
    .nav-links>li>a {
        font-size: .85rem;
        padding: 12px 4px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        white-space: normal
    }

    /* Mega dropdown mobile */
    .mega-dropdown {
        position: static;
        transform: none !important;
        width: 100%;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: none;
        border: 1px solid var(--brd, rgba(0,0,0,0.08));
        border-radius:0;
        padding: 0;
        margin-top: 8px;
        display: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, .98);
        overflow: visible
    }

    .mega-dropdown::before,
    .mega-dropdown::after {
        display: none
    }

    .nav-links>li.has-dropdown.open .mega-dropdown {
        display: block
    }

    .dd-grid {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        padding: 10px
    }

    .dd-card {
        opacity: 1 !important;
        transform: none !important;
        padding: 10px;
        background: rgba(0, 0, 0, .02)
    }

    .dd-card::before,
    .dd-card::after {
        display: none !important
    }

    .dd-card p,
    .dd-card .dd-card-link {
        display: none
    }

    .dd-card h4 {
        font-size: .72rem
    }

    .dd-card .dd-card-sub {
        font-size: .58rem
    }

    .mega-dropdown .dd-header {
        padding: 10px 12px 8px
    }

    .mega-dropdown .dd-header span {
        font-size: .6rem
    }

    .dd-card .dd-card-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 6px
    }

    .dd-card .dd-card-icon svg {
        width: 14px;
        height: 14px
    }

    /* HOMEPAGE LAYOUTS */
    .hero-split {
        grid-template-columns: 1fr
    }

    .hero-right {
        position: absolute;
        inset: 0;
        z-index: 0;
        opacity: .15
    }

    .hero-right::before,
    .hero-right::after {
        display: none
    }

    .hero-left {
        position: relative;
        z-index: 2;
        min-height: 100vh
    }

    .hero-slide-label,
    .hero-dots,
    .hero-arrows {
        display: none
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 36px
    }

    .eco-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .feat-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    /* SHARED LAYOUTS */
    .testi-grid {
        grid-template-columns: 1fr 1fr
    }

    .contact-grid {
        grid-template-columns: 1fr
    }

    .stats {
        grid-template-columns: repeat(2, 1fr)
    }

    .ft-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    /* SUB-PAGE HERO */
    .hero-grid {
        grid-template-columns: 1fr
    }

    /* SUB-PAGE LAYOUTS */
    .quality-grid,
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 36px
    }

    .svc-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .dept-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .prod-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .space-grid {
        grid-template-columns: 1fr
    }

    .flow-steps {
        grid-template-columns: repeat(2, 1fr)
    }

    .flow-step::after {
        display: none
    }
}

/* ============ TABLET PORTRAIT (≤768px) ============ */
@media(max-width:768px) {

    /* Typography boost for readability */
    :root {
        --fs-base: 0.92rem;
        --fs-sm: 0.82rem;
        --fs-xs: 0.72rem;
    }

    /* GRIDS → 1 column */
    .testi-grid {
        grid-template-columns: 1fr
    }

    .eco-grid {
        grid-template-columns: 1fr
    }

    .feat-grid {
        grid-template-columns: 1fr
    }

    .news-grid {
        grid-template-columns: 1fr
    }

    .svc-grid {
        grid-template-columns: 1fr
    }

    .dept-grid {
        grid-template-columns: 1fr
    }

    .prod-grid {
        grid-template-columns: 1fr
    }

    .menu-grid {
        grid-template-columns: 1fr
    }

    .flow-steps {
        grid-template-columns: 1fr
    }

    .about-vals {
        grid-template-columns: 1fr
    }

    .about-chips {
        grid-template-columns: 1fr
    }

    /* Stats bar — 2×2 grid (better than 1 col) */
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0
    }

    .stat {
        padding: 20px 16px
    }

    .stat:not(:last-child)::after {
        display: none
    }

    .stat:nth-child(1),
    .stat:nth-child(2) {
        border-bottom: 1px solid rgba(255, 255, 255, .08)
    }

    .stat:nth-child(odd) {
        border-right: 1px solid rgba(255, 255, 255, .08)
    }

    /* Trust section */
    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact form */
    .form-row {
        grid-template-columns: 1fr
    }

    /* Floating CTA */
    .float-cta {
        bottom: 16px;
        right: 16px
    }

    .float-btn {
        width: 48px;
        height: 48px
    }

    .float-btn svg {
        width: 20px;
        height: 20px
    }

    /* Footer */
    .ft-grid {
        grid-template-columns: 1fr
    }

    .ft-bottom {
        flex-direction: column;
        text-align: center
    }

    /* Hero buttons */
    .hero-btns {
        flex-direction: column;
        align-items: stretch
    }

    .hero-btns>a {
        justify-content: center;
        text-align: center
    }

    /* About */
    .about-float,
    .about-badge {
        display: none
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: .65rem;
        padding: 6px 4%;
        gap: 6px
    }

    .breadcrumb a svg {
        width: 10px;
        height: 10px
    }

    /* Section padding */
    .sec {
        padding: clamp(60px, 8vw, 100px) 5%
    }

    /* Space cards */
    .space-card {
        height: 260px
    }


}

/* ============ SMARTPHONE (≤480px) ============ */
@media(max-width:480px) {

    /* Typography for small screens */
    :root {
        --fs-base: 0.95rem;
        --fs-sm: 0.85rem;
        --fs-xs: 0.75rem;
        --fs-md: 1rem;
    }

    /* Nav panel narrower */
    .nav-links {
        width: min(280px, 85vw)
    }

    .dd-grid {
        grid-template-columns: 1fr
    }

    /* Hide tooltips */
    .float-btn .tooltip {
        display: none
    }

    /* Buttons full width */
    .hero-btns>a,
    .cta-btns>a {
        padding: 14px 24px !important;
        font-size: .78rem !important;
        width: 100%;
        justify-content: center;
        text-align: center
    }

    /* Cards padding */
    .eco-body {
        padding: 18px
    }

    .eco-img {
        height: 180px
    }

    .feat-card {
        padding: 28px 20px
    }

    .testi-card {
        padding: 22px
    }

    .v-card {
        padding: 16px
    }

    /* Sub-page specific */
    .prod-body,
    .menu-body,
    .dept-body,
    .svc-body {
        padding: 18px
    }

    .prod-img,
    .menu-img,
    .dept-img,
    .svc-img {
        height: 180px
    }

    /* Philosophy */
    .philo-content blockquote {
        font-size: 1.05rem
    }

    .philo {
        height: clamp(320px, 50vh, 420px)
    }

    /* Space cards */
    .space-card {
        height: 220px
    }

    /* Stats on phone */
    .stat-n,
    .stat-num {
        font-size: clamp(1.6rem, 8vw, 2rem)
    }

    /* Section padding */
    .sec {
        padding: clamp(48px, 8vw, 80px) 5%
    }

    /* Nav info */
    .nav-info .name {
        gap: 6px;
    }
    .nav-info .name .tl-text {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }

    .nav-info .slogan {
        font-size: .62rem;
        letter-spacing: 1px
    }

    .nav-brand .name {
        font-size: .78rem
    }

    .nav-brand .sub {
        font-size: .62rem
    }

    /* Demo tag */
    .demo-tag {
        font-size: .65rem;
        padding: 6px 12px;
        bottom: 12px;
        right: 12px
    }

    /* Footer spacing */
    .footer {
        padding: 48px 5% 24px
    }
}

/* ============ SMALL PHONE (≤360px) ============ */
@media(max-width:360px) {

    /* Tighter nav */
    .nav {
        padding: 12px 4%
    }

    .nav.scrolled {
        padding: 8px 4%
    }

    .nav-left img {
        height: 32px
    }

    .nav.scrolled .nav-left img {
        height: 28px
    }

    /* Stats ultra-compact */
    .stats {
        padding: 16px 4%
    }

    .stat {
        padding: 12px 8px
    }

    .stat-n,
    .stat-num {
        font-size: 1.4rem
    }

    .stat-l,
    .stat-lbl {
        font-size: .6rem;
        letter-spacing: 1px
    }

    /* Section spacing */
    .sec {
        padding: 40px 4%
    }

    /* Hero tighter */
    .hero-left {
        padding: 0 20px
    }

    .hero-h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem) !important
    }

    .hero-slogan,
    .hero-sub {
        font-size: clamp(.9rem, 4vw, 1.1rem)
    }

    /* Cards minimal */
    .eco-body {
        padding: 14px
    }

    .eco-body h3 {
        font-size: .95rem
    }

    .eco-body p {
        font-size: .8rem
    }

    /* Buttons */
    .btn-gold,
    .btn-ghost,
    .btn-blue,
    .btn-sage,
    .btn-teal,
    .btn-brown,
    .btn-outline {
        padding: 12px 20px !important;
        font-size: .72rem !important
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: .6rem;
        padding: 5px 3%
    }

    /* Contact form */
    .contact-form {
        padding: 20px
    }

    .info-card {
        padding: 14px
    }

    .contact-hours {
        padding: 14px 16px
    }

    /* Trust section */
    .cert-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer {
        padding: 36px 4% 20px
    }

    .ft-brand .ft-logo img {
        height: 32px
    }

    .ft-social a {
        width: 32px;
        height: 32px
    }
}

/* ============ TOUCH TARGET MINIMUM (44×44px) ============ */
@media(hover:none) and (pointer:coarse) {

    /* Mobile touch targets */
    .nav-links>li>a {
        min-height: 44px;
        display: inline-flex;
        align-items: center
    }

    .nav-cta {
        min-height: 44px !important
    }

    .nav-toggle {
        min-width: 44px;
        min-height: 44px
    }

    .float-btn {
        min-width: 48px;
        min-height: 48px
    }

    .btn-gold,
    .btn-ghost,
    .btn-blue,
    .btn-sage,
    .btn-teal,
    .btn-brown,
    .btn-outline,
    .btn-white,
    .btn-wire-w {
        min-height: 44px
    }

    .btn-submit {
        min-height: 48px
    }

    .eco-link,
    .prod-link,
    .menu-link,
    .dept-link,
    .svc-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center
    }

    .ft-social a {
        min-width: 38px;
        min-height: 38px
    }

    .ft-col ul a {
        min-height: 36px;
        display: inline-flex;
        align-items: center
    }

    .trust-badge {
        min-height: 44px
    }

    .chip {
        min-height: 44px
    }

    .info-card {
        min-height: 44px
    }

    /* Form inputs */
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px
    }

    /* Prevent iOS zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important
    }
}

/* ============ PRINT STYLES ============ */
@media print {

    .nav,
    .breadcrumb,
    .float-cta,
    .loader,
    .nav-overlay {
        display: none !important
    }

    .hero {
        min-height: auto
    }

    .rv {
        opacity: 1 !important;
        transform: none !important
    }

    body {
        font-size: 12pt;
        line-height: 1.5
    }

    .sec {
        padding: 24px 0;
        page-break-inside: avoid
    }
}

/* Wide presentation screens often have much less usable height than width.
   Keep the fixed navigation and the hero copy in separate vertical zones. */
@media (min-width:1025px) and (max-height:760px) {
    .nav {
        padding-top: 12px;
        padding-bottom: 12px
    }

    .nav-left img {
        height: 48px;
        margin-top: -4px;
        margin-bottom: -4px
    }

    .nav-info .name .tl-text {
        font-size: 1.25rem
    }

    .nav-info .slogan {
        font-size: .7rem;
        margin-top: 2px
    }

    .hero-left {
        padding-top: 100px;
        padding-bottom: 28px
    }

    .hero-eyebrow {
        margin-bottom: 14px
    }

    .hero-h1 {
        font-size: clamp(2.7rem, 4.2vw, 4rem);
        margin-bottom: 8px
    }

    .hero-slogan {
        margin-bottom: 10px
    }

    .hero-desc {
        line-height: 1.65;
        margin-bottom: 20px
    }
}
