/**
 * Golden Wings - Dedicated Responsive Stylesheet
 * Explicitly optimizes:
 * 1. Mobile (< 576px & 576px - 767px)
 * 2. Tablet (768px - 991px)
 * 3. Desktop (>= 992px, 1200px, 1400px+)
 */

/* ==========================================================================
   1. MOBILE PHONES (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Viewport Horizontal Overflow Protection */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
    }

    /* Prevent any section from spilling past viewport */
    section, .hero, header, footer, .container, .stats-section, .marquee-wrapper {
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Touch Target Enforcement (Minimum 48px height) */
    .btn, 
    .form-control, 
    .form-select,
    .nav-link,
    .dropdown-item {
        min-height: 48px;
        font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    }

    /* Section & Container Padding Scaling */
    .container {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .section-padding {
        padding: 55px 0 !important;
    }

    .section-heading {
        font-size: 26px !important;
        margin-bottom: 16px;
    }

    /* CTA Section Mobile */
    .cta-section {
        padding: 60px 0 !important;
    }

    .cta-section h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
    }

    .cta-section p {
        font-size: 15px !important;
    }

    :root {
        --site-header-height: 88px;
    }

    /* Top Bar Mobile Optimization */
    .top-bar {
        padding: 6px 0;
        font-size: 12px;
    }

    .top-bar-item {
        margin-right: 12px;
    }

    .top-bar .d-none-mobile {
        display: none !important;
    }

    /* Mobile Brand & Navigation */
    .navbar {
        padding: 10px 0;
    }

    .navbar-brand {
        font-size: 19px;
        gap: 6px;
    }

    .navbar-brand-badge {
        font-size: 9.5px;
        padding: 2px 5px;
    }

    .mobile-nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(16, 28, 44, 0.05);
        border: 1px solid rgba(16, 28, 44, 0.14) !important;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        transition: var(--transition);
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:focus,
    .mobile-nav-toggle:active {
        background: rgba(201, 162, 39, 0.12);
        border-color: var(--gw-gold) !important;
        outline: none;
        box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
    }

    .mobile-nav-toggle i {
        font-size: 24px;
        color: var(--gw-navy);
        line-height: 1;
    }

    /* Mobile Offcanvas Drawer Customization */
    .offcanvas-mobile {
        background: linear-gradient(180deg, #0d1726 0%, #101c2c 100%) !important;
        color: var(--gw-white);
        width: 320px !important;
        max-width: 86vw !important;
        border-left: 2px solid var(--gw-gold);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
        z-index: 1050;
    }

    .offcanvas-mobile .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 18px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .btn-close-custom {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.85);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        cursor: pointer;
        transition: var(--transition);
        padding: 0;
    }

    .btn-close-custom:hover,
    .btn-close-custom:focus,
    .btn-close-custom:active {
        background: rgba(201, 162, 39, 0.25);
        border-color: var(--gw-gold);
        color: var(--gw-gold);
        outline: none;
    }

    .offcanvas-mobile .offcanvas-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        padding: 0 !important;
    }

    /* Mobile Drawer Navigation Links */
    .mobile-drawer-nav {
        flex: 1 0 auto;
        padding: 8px 0;
    }

    .drawer-nav-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px;
        color: rgba(255, 255, 255, 0.88);
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        font-size: 14.5px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .drawer-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--gw-gold);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .drawer-text {
        letter-spacing: 0.2px;
    }

    .drawer-badge-hot {
        background-color: var(--gw-gold) !important;
        color: var(--gw-navy) !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        padding: 2px 7px !important;
        border-radius: 20px !important;
        display: inline-block !important;
        line-height: 1.2 !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }

    .drawer-arrow {
        color: rgba(255, 255, 255, 0.25);
        font-size: 12px;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .drawer-nav-item:hover,
    .drawer-nav-item:focus {
        background: rgba(201, 162, 39, 0.08);
        color: var(--gw-gold);
        padding-left: 22px;
    }

    .drawer-nav-item:hover .drawer-icon {
        background: rgba(201, 162, 39, 0.2);
    }

    .drawer-nav-item:hover .drawer-arrow {
        color: var(--gw-gold);
        transform: translateX(3px);
    }

    .drawer-nav-item.active {
        background: rgba(201, 162, 39, 0.12);
        color: var(--gw-gold);
        border-left: 3px solid var(--gw-gold);
        font-weight: 600;
    }

    .drawer-nav-item.active .drawer-icon {
        background: var(--gw-gold);
        color: var(--gw-navy);
    }

    .drawer-nav-item.active .drawer-arrow {
        color: var(--gw-gold);
    }

    /* Mobile Drawer Footer Actions */
    .mobile-drawer-footer {
        margin-top: auto;
        padding: 16px 18px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        background: rgba(10, 18, 28, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }

    .mobile-drawer-footer .font-monospace {
        font-size: 10px !important;
        letter-spacing: 0.2px;
        white-space: nowrap;
    }

    /* Hero Mobile Adaptations */
    .hero {
        min-height: 580px;
        height: auto;
    }

    .hero-title {
        font-size: 32px !important;
        line-height: 1.25;
        margin-bottom: 18px;
    }

    .hero-eyebrow {
        font-size: 12px;
        padding: 4px 10px;
        margin-bottom: 15px;
    }

    .hero-text {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .hero-content {
        padding: 60px 0 40px;
    }

    .hero-cta-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-cta-group .btn {
        width: 100%;
    }

    /* Statistics Bar 2x2 Grid on Mobile */
    .stats-section {
        margin-top: -30px;
        padding: 10px;
        border-radius: 6px;
    }

    .stat-item {
        padding: 16px 10px !important;
    }

    .stat-item:not(:last-child)::after {
        display: none !important;
    }

    .stat-number {
        font-size: 34px !important;
    }

    .stat-text {
        font-size: 12px !important;
    }

    /* Process Timeline Mobile Vertical Stacking */
    .process-timeline {
        padding-left: 10px;
    }

    .process-step {
        padding-left: 55px;
        margin-bottom: 30px;
    }

    .process-step::before {
        content: '';
        position: absolute;
        left: 19px;
        top: 40px;
        bottom: -30px;
        width: 2px;
        background-color: rgba(201, 162, 39, 0.25);
    }

    .process-step:last-child::before {
        display: none;
    }

    .process-number {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    /* Split Section Stacking */
    .split-card {
        height: 380px !important;
        padding: 30px 20px !important;
        margin-bottom: 20px;
    }

    .split-title {
        font-size: 24px !important;
    }

    /* Mobile Floating Quick Action Bar - Rigidly Fixed with Zero Jitter */
    .mobile-quick-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--gw-navy);
        border-top: 2px solid var(--gw-gold);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 1025;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform;
    }

    .mobile-quick-btn {
        color: var(--gw-white);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px;
        font-weight: 500;
        gap: 3px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: var(--transition);
    }

    .mobile-quick-btn i {
        font-size: 18px;
        color: var(--gw-gold);
    }

    .mobile-quick-btn:hover,
    .mobile-quick-btn:active {
        color: var(--gw-gold);
        background: rgba(255, 255, 255, 0.08);
    }

    /* Pad body so mobile quick bar and fixed header don't obscure content */
    body {
        padding-top: var(--site-header-height);
        padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    }

    #backToTop {
        bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
        right: 20px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        z-index: 1050 !important;
    }

    body.offcanvas-open #backToTop,
    body.modal-open #backToTop {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Automatically hide bottom quick bar when offcanvas drawer or modal is open */
    body.offcanvas-open .mobile-quick-bar,
    body.modal-open .mobile-quick-bar,
    .offcanvas.show ~ .mobile-quick-bar,
    .offcanvas.showing ~ .mobile-quick-bar {
        transform: translateY(100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    /* Responsive Tables */
    .table-responsive-mobile {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Footer Mobile */
    .footer {
        padding: 50px 0 95px !important;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-top: 35px;
    }
}

/* ==========================================================================
   2. TABLET DEVICES (768px – 991.98px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .section-padding {
        padding: 70px 0;
    }

    .section-heading {
        font-size: 32px;
    }

    .cta-section {
        padding: 80px 0 !important;
    }

    .cta-section h2 {
        font-size: 34px !important;
    }

    .hero {
        min-height: 650px;
    }

    .hero-title {
        font-size: 44px;
    }

    .hero-text {
        font-size: 16px;
    }

    /* 2-Column Grid for Industries & Countries */
    .tablet-col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Process Timeline for Tablet */
    .process-timeline {
        display: flex;
        flex-wrap: wrap;
    }

    .process-step {
        width: 50%;
        padding-left: 60px;
        margin-bottom: 40px;
    }

    .stat-item {
        padding: 25px 12px;
    }

    .stat-number {
        font-size: 38px;
    }

    .stat-text {
        font-size: 13px;
    }

    .split-card {
        height: 420px;
        padding: 35px;
    }

    /* Hide Mobile Floating Bar on Tablets */
    .mobile-quick-bar {
        display: none !important;
    }

    :root {
        --site-header-height: 98px;
    }

    body {
        padding-top: var(--site-header-height);
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   3. DESKTOP & WIDESCREEN (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {
    /* Hide Mobile Floating Bar on Desktop */
    .mobile-quick-bar {
        display: none !important;
    }

    :root {
        --site-header-height: 104px;
    }

    body {
        padding-top: var(--site-header-height);
        padding-bottom: 0 !important;
    }

    /* 4-Step Horizontal Timeline Row */
    .process-timeline {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        position: relative;
        padding-top: 40px;
    }

    .process-step {
        width: 25%;
        padding-left: 0;
        padding-top: 45px;
        text-align: center;
        margin-bottom: 50px;
    }

    .process-step::after {
        content: '';
        position: absolute;
        top: 22px;
        left: 50%;
        width: 100%;
        height: 2px;
        background-color: rgba(201, 162, 39, 0.25);
        z-index: 1;
    }

    .process-step:nth-child(4n)::after {
        display: none;
    }

    .process-number {
        left: 50%;
        top: 0;
        transform: translate(-50%, -22px);
    }

    .process-title {
        font-size: 17px;
    }
}

/* ─────────────────────────────────────────────────────────────
   Client Logos Marquee Carousel Responsive Adjustments
   ───────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .marquee-wrapper {
        padding: 24px 0;
    }
    .marquee-wrapper::before,
    .marquee-wrapper::after {
        width: 80px;
    }
    .client-logo-card {
        width: 170px;
        height: 66px;
        padding: 8px 14px;
    }
    .client-logo-card img {
        max-width: 135px;
        max-height: 42px;
    }
}

@media (max-width: 575.98px) {
    .marquee-wrapper {
        padding: 18px 0;
    }
    .marquee-wrapper::before,
    .marquee-wrapper::after {
        width: 50px;
    }
    .marquee-content {
        gap: 12px;
        animation-duration: 42s;
    }
    .client-logo-card {
        width: 140px;
        height: 58px;
        padding: 6px 12px;
        border-radius: 9px;
    }
    .client-logo-card img {
        max-width: 110px;
        max-height: 34px;
    }
}

