/* =========================================================
   DSTCC Mobile CSS — Full Responsive Enhancement
   Breakpoints: xs(<480) | sm(<576) | md(<768) | lg(<992)
   ========================================================= */

/* ======================================================
   GLOBAL MOBILE RESETS
   ====================================================== */
@media (max-width: 991px) {
    html {
        font-size: 15px;
    }

    .section-pad {
        padding: 56px 0;
    }

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    .section-pad {
        padding: 48px 0;
    }
}

/* ======================================================
   1. NAVBAR — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .header-main {
        padding: 14px 0;
    }

    .header-main .container {
        padding: 0 16px;
    }

    .header-main .navbar-brand img {
        height: 70px;
    }

    .header-main.scrolled {
        margin-bottom: 31px !important; /* Bù trừ hao hụt layout trên mobile (70->55px logo, 14->6px padding) */
    }

    /* Hamburger button */
    .navbar-toggler {
        padding: 6px 10px;
        border: none !important;
        background: transparent;
        font-size: 1.6rem;
        color: var(--primary-dark);
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

    /* Mobile dropdown menu */
    #navbarResponsive {
        background: #fff;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-radius: 10px;
        margin: 10px -16px 0 -16px;
    }

    .navbar-nav {
        gap: 6px !important;
    }

    .nav-item {
        border-bottom: 1px solid rgba(0, 63, 127, 0.06);
    }

    .nav-item:last-child {
        border-bottom: none;
        margin-top: 10px;
        padding-top: 10px;
    }

    .nav-link {
        padding: 12px 0 !important;
        font-size: 1rem !important;
    }

    .nav-link::after {
        display: none !important;
    }

    .dropdown-menu {
        border: none !important;
        border-radius: 8px !important;
        background: var(--bg-light);
        box-shadow: none !important;
        padding: 4px 0 8px 16px;
        margin: 0 !important;
        border-top: none !important;
    }

    .dropdown-item {
        padding: 9px 14px;
        font-size: 0.88rem;
        border-radius: 6px;
    }

    /* CTA button full width in nav */
    .navbar-nav .btn-hero-primary {
        display: block;
        text-align: center;
        width: 100%;
        padding: 13px !important;
        border-radius: 6px !important;
        font-size: 1rem !important;
    }

    /* Hide Top Info Bar Right on Mobile */
    .top-info-right {
        display: none;
    }

    .top-info-left {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
}

/* ======================================================
   2. HERO SECTION — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .hero-banner {
        height: auto;
        min-height: 100svh;
        min-height: 100vh;
        padding: 100px 20px 100px;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .hero-inner {
        max-width: 100%;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-logo img {
        width: 100px;
    }

    .hero-eyebrow {
        justify-content: center;
    }

    .hero-eyebrow-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 3rem) !important;
        max-width: 100%;
    }

    .hero-sub {
        font-size: 1rem;
        max-width: 500px;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        gap: 10px;
    }

    .btn-hero-primary,
    .btn-hero-outline {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Hero stats */
    .hero-stats {
        max-width: 100%;
        flex-wrap: wrap;
        margin-top: 32px;
    }

    .hero-stat {
        flex: 0 0 50%;
        padding: 14px 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-stat:nth-child(odd) {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-stat-num {
        font-size: 1.6rem;
    }

    .hero-stat-lbl {
        font-size: 0.68rem;
    }

    .hero-stat-divider {
        display: none;
    }

    /* Scroll indicator */
    .hero-scroll {
        right: 50%;
        transform: translateX(50%);
        bottom: 24px;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        padding: 80px 16px 90px;
    }

    .hero-title {
        font-size: 1.85rem !important;
    }

    .hero-sub {
        font-size: 0.95rem;
    }
}

/* ======================================================
   3. TRUST BADGE BAR — Mobile Grid
   ====================================================== */
@media (max-width: 991px) {
    .trust-bar-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex-wrap: unset;
        overflow-x: unset;
        gap: 0;
    }

    .trust-badge {
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        padding: 14px 16px;
        gap: 10px;
        min-width: unset;
    }

    /* Remove right border from even items */
    .trust-badge:nth-child(even) {
        border-right: none;
    }

    /* Remove bottom border from last row */
    .trust-badge:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .trust-badge-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .trust-badge-text strong {
        font-size: 0.88rem;
    }

    .trust-badge-text span {
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .trust-badge {
        padding: 12px 12px;
        gap: 8px;
    }

    .trust-badge-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
}

/* ======================================================
   4. ABOUT SECTION — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .about-img-wrap img {
        height: 280px;
    }

    .about-img-badge .num {
        font-size: 2rem;
    }

    .section-title {
        font-size: clamp(1.7rem, 5vw, 2.4rem) !important;
    }

    .about-check li {
        font-size: 0.9rem;
    }
}

@media (max-width: 767px) {

    /* Stack image below text on very small screens */
    #gioi-thieu .row {
        flex-direction: column-reverse;
    }

    .about-img-wrap img {
        height: 240px;
    }
}

/* ======================================================
   5. SERVICES — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .services-bg {
        background: var(--primary) !important;
        padding: 56px 0;
    }

    .service-intro {
        padding: 20px 16px 28px;
        text-align: center;
    }

    .service-intro h2 {
        font-size: 1.9rem;
        color: #fff;
    }

    .service-intro h2::after {
        margin: 12px auto 0;
        content: '';
        display: block;
        width: 40px;
        height: 3px;
        background: var(--accent);
        border-radius: 2px;
    }

    .service-intro p {
        color: rgba(255, 255, 255, 0.75);
    }

    .service-intro a {
        color: var(--accent) !important;
        border-color: var(--accent) !important;
        font-size: 0.88rem !important;
    }

    .service-scroller {
        display: flex !important;
        overflow-x: auto;
        padding: 8px 16px 20px;
        gap: 14px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .service-card {
        flex: 0 0 260px !important;
        scroll-snap-align: start;
    }

    .service-card img {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .service-card {
        flex: 0 0 240px !important;
    }

    .service-card img {
        height: 150px;
    }
}

/* Scrollbar hint for service scroller */
@media (max-width: 991px) {
    .service-scroller::after {
        content: '';
        flex-shrink: 0;
        width: 8px;
    }
}

/* ======================================================
   6. LAB CAPABILITIES TABS — Mobile
   ====================================================== */
@media (max-width: 991px) {

    /* Horizontal scrollable tabs */
    .lab-tabs .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        margin-bottom: 20px !important;
        gap: 8px !important;
    }

    .lab-tabs .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .lab-tabs .nav-item {
        flex-shrink: 0;
    }

    .lab-tabs .nav-link {
        white-space: nowrap;
        padding: 9px 16px !important;
        font-size: 0.84rem !important;
    }

    .equipment-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .equipment-item {
        padding: 14px 14px;
        gap: 10px;
    }

    .equipment-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .equipment-name {
        font-size: 0.83rem;
    }

    .equipment-spec {
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .equipment-grid {
        grid-template-columns: 1fr;
    }

    .equipment-item {
        padding: 12px 14px;
    }
}

/* ======================================================
   7. ADVISORS SWIPER — Mobile
   ====================================================== */
@media (max-width: 767px) {
    .advisors-section .row.mb-5 {
        margin-bottom: 24px !important;
    }

    .advisor-card-top {
        padding: 22px 18px 16px;
    }

    .advisor-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
    }

    .advisor-card-body {
        padding: 16px 18px 20px;
    }

    .advisor-name {
        font-size: 1rem;
    }

    .advisor-specialty {
        font-size: 0.82rem;
    }
}

/* ======================================================
   8. PROJECTS — Mobile Grid
   ====================================================== */
@media (max-width: 991px) {
    .project-filters {
        gap: 6px;
    }

    .filter-btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }

    .project-card {
        height: 280px;
    }
}

@media (max-width: 767px) {

    /* 2 columns on tablets */
    #projects-grid .col-xl-4.col-lg-4.col-md-6 {
        width: 50%;
        flex: 0 0 50%;
    }

    .project-card {
        height: 220px;
    }

    .project-info h4 {
        font-size: 1rem;
    }

    .project-meta {
        font-size: 0.74rem;
    }

    .project-cat {
        font-size: 0.66rem;
    }
}

@media (max-width: 480px) {

    /* 1 column on phones */
    #projects-grid .col-xl-4.col-lg-4.col-md-6 {
        width: 100%;
        flex: 0 0 100%;
    }

    .project-card {
        height: 240px;
    }

    .project-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .project-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
    }
}

/* ======================================================
   9. NEWS CARDS — Mobile
   ====================================================== */
@media (max-width: 767px) {
    #tin-tuc .row.g-4 {
        gap: 16px !important;
    }

    .classic-card>img {
        height: 180px;
    }

    .classic-card-body {
        padding: 16px;
    }

    .classic-card-title {
        font-size: 0.97rem;
    }
}

@media (max-width: 480px) {
    .classic-card>img {
        height: 160px;
    }
}

/* ======================================================
   10. CONTACT FORM — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .contact-card {
        border-radius: 12px;
        overflow: visible;
        box-shadow: none;
    }

    /* Stack: sidebar BELOW form on mobile — show info more compact */
    .contact-card .row.g-0 {
        flex-direction: column;
    }

    .contact-sidebar {
        order: 2;
        padding: 28px 20px;
        border-radius: 0 0 12px 12px;
    }

    /* Compact sidebar on mobile */
    .contact-sidebar h3 {
        font-size: 1.4rem;
    }

    .contact-sidebar .subtitle {
        display: none;
    }

    /* Contact info items in a 2-col grid on tablet */
    .contact-sidebar .contact-info-item {
        margin-bottom: 14px;
    }

    .contact-sidebar .social-links {
        margin-top: 16px !important;
    }

    .form-area {
        order: 1;
        padding: 24px 20px;
        border-radius: 12px 12px 0 0;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0, 40, 100, 0.08);
    }

    .form-area h3 {
        font-size: 1.4rem;
    }

    .file-upload-wrapper {
        padding: 20px 14px;
    }

    .file-upload-wrapper i {
        font-size: 1.4rem;
    }

    .btn-submit-b2b {
        font-size: 1rem;
        padding: 13px 24px;
    }
}

@media (max-width: 480px) {
    .form-area {
        padding: 20px 16px;
    }

    /* Show key contact info inline on small phones */
    .contact-info-item:nth-child(n+4) {
        display: none;
    }

    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Prevents iOS zoom on focus */
        padding: 12px 14px;
    }
}

/* ======================================================
   11. FOOTER — Mobile
   ====================================================== */
@media (max-width: 991px) {
    .footer-main {
        padding: 48px 0 100px;
        /* Extra bottom padding for mobile nav */
    }

    .footer-main .row.g-5 {
        gap: 32px !important;
    }

    .footer-brand img {
        height: 40px;
    }

    .footer-main .col-lg-2 {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .footer-main {
        padding-bottom: 90px;
        /* Space for bottom nav */
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-main .col-lg-2 {
        width: 100%;
    }
}

/* ======================================================
   12. MOBILE BOTTOM NAVIGATION BAR ← NEW
   ====================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: #fff;
    border-top: 1px solid rgba(0, 63, 127, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 40, 100, 0.12);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav-inner {
    display: flex;
    align-items: stretch;
    height: 60px;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.mobile-nav-item:active {
    background: var(--bg-light);
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

/* CTA call button — highlighted */
.mobile-nav-item.cta-call {
    flex: 0 0 72px;
    position: relative;
}

.mobile-nav-item.cta-call .mobile-nav-cta-btn {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(245, 168, 0, 0.5);
    position: relative;
    top: -10px;
    transition: all 0.2s ease;
    animation: pulse-cta 2.5s infinite;
}

.mobile-nav-item.cta-call span {
    margin-top: -6px;
    color: var(--primary);
    font-size: 0.6rem;
}

@keyframes pulse-cta {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(245, 168, 0, 0.5);
    }

    50% {
        box-shadow: 0 4px 28px rgba(245, 168, 0, 0.8);
        transform: scale(1.05);
    }
}

.mobile-nav-item.cta-call:active .mobile-nav-cta-btn {
    transform: scale(0.93);
}

@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Push page content above the nav */
    body {
        padding-bottom: 0;
    }
}

/* ======================================================
   13. FLOATING CALL BUTTON (alternative when no bottom nav) ← NEW
   ====================================================== */
/* Removed — using bottom nav CTA instead */

/* ======================================================
   14. MOBILE SECTION TITLE ADJUSTMENTS
   ====================================================== */
@media (max-width: 767px) {
    .section-title {
        font-size: clamp(1.55rem, 6vw, 2.2rem) !important;
    }

    .section-title::after {
        width: 40px;
        height: 3px;
        margin-top: 10px;
    }
}

/* ======================================================
   15. SWIPER PAGINATION — Mobile Sizing
   ====================================================== */
@media (max-width: 767px) {
    .swiper-pagination {
        bottom: -4px !important;
    }

    .swiper-pagination-bullet {
        width: 7px !important;
        height: 7px !important;
    }

    .advisor-swiper {
        padding-bottom: 40px !important;
    }
}

/* ======================================================
   16. MOBILE HERO BOTTOM SECTION SPACING
   ====================================================== */
@media (max-width: 991px) {

    /* Reduce overlap of bottom nav */
    #lien-he {
        padding-bottom: 80px;
    }

    .footer-main {
        padding-bottom: 90px;
    }
}

/* ======================================================
   17. TAP TARGETS — Accessibility
   ====================================================== */
@media (max-width: 991px) {

    a,
    button,
    .filter-btn,
    .nav-link,
    .mobile-nav-item,
    .trust-badge {
        min-height: 44px;
    }

    .filter-btn {
        min-height: unset;
        height: auto;
    }
}

/* ======================================================
   18. TYPOGRAPHY REFINEMENTS — Mobile
   ====================================================== */
@media (max-width: 767px) {
    body {
        font-size: 14.5px;
        line-height: 1.65;
    }

    p {
        font-size: 0.95rem !important;
    }

    h2,
    .section-title {
        letter-spacing: 0.02em !important;
    }
}

/* ======================================================
   19. SMOOTH MOMENTUM SCROLLING
   ====================================================== */
@media (max-width: 991px) {

    .service-scroller,
    .lab-tabs .nav-tabs,
    .project-filters,
    .trust-bar-inner {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ======================================================
   20. REDUCE MOTION — Accessibility
   ====================================================== */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .marquee-content {
        animation: none;
    }

    .hero-scroll {
        animation: none;
    }

    .pulse-cta {
        animation: none;
    }
}

/* ======================================================
   21. iOS SAFE AREA SUPPORT
   ====================================================== */
.mobile-bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom), 8px);
}

@supports (padding-bottom: constant(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: constant(safe-area-inset-bottom);
    }
}

/* ======================================================
   22. CONTACT INFO GRID ON MOBILE (2 cols in sidebar)
   ====================================================== */
@media (max-width: 991px) {
    .contact-sidebar-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .contact-sidebar-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================================
   23. SCROLL INDICATOR ON HORIZONTAL SCROLLERS
   ====================================================== */
@media (max-width: 991px) {

    /* Fade hint on right side of service scroll */
    .service-scroll-hint {
        position: relative;
    }

    .service-scroll-hint::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 48px;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(0, 37, 84, 0.4));
        pointer-events: none;
        z-index: 5;
        border-radius: 0 12px 12px 0;
    }
}

/* ======================================================
   24. ABOUT SECTION — Better Mobile Layout  
   ====================================================== */
@media (max-width: 767px) {
    #gioi-thieu .about-img-badge {
        bottom: 16px;
        left: 16px;
        padding: 10px 16px;
    }

    #gioi-thieu .about-img-badge .num {
        font-size: 1.8rem;
    }

    #gioi-thieu .about-img-badge .lbl {
        font-size: 0.78rem;
    }

    #gioi-thieu .btn-hero-primary {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 13px 20px;
    }
}

/* ======================================================
   25. SECTION EYEBROW — Mobile
   ====================================================== */
@media (max-width: 767px) {
    .section-eyebrow {
        font-size: 0.78rem;
    }
}