
/* 
 * MOBILE OVERRIDES (RESPONSIVE FIXES)
 * Mandated Updates for UI/UX & Speed
 */

/* B) HORIZONTAL SCROLL RESET & GLOBAL SETTINGS */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
    touch-action: none;
}

/* F) TYPOGRAPHY & TOUCH TARGETS */
html {
    font-size: 16px; /* Base size */
}

/* E) IMAGES */
img {
    max-width: 100%;
    height: auto;
}

/* Touch Targets - Min 44px */
button, 
input, 
select, 
textarea,
.mobile-nav-list a,
.topbar-pill,
.lang-pill,
.btn {
    min-height: 44px; /* Ensure touchable area */
    min-width: 44px;
}

/* Fix for specific small elements that shouldn't be 44px visual height but touch area */
.topbar-pill {
    min-height: 32px; /* Visual height */
}

/* C) GRID & CARDS MOBILE OVERRIDES */
/* Force 1 column on small mobile (<576px) for cards if they are col-6 */
@media (max-width: 575.98px) {
    .home-shortcuts .col-6 {
        width: 100% !important; /* Force full width */
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .shortcut-card {
        margin-bottom: 10px;
    }
}

/* 576px - 991px: 2 Columns */
@media (min-width: 576px) and (max-width: 991.98px) {
    .home-shortcuts .col-md-3 {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* D) BRANDS LOGO MOBILE */
@media (max-width: 767.98px) {
    .brand-item {
        min-width: 100px; /* Smaller on mobile */
        padding: 8px 12px;
    }
    
    .brands-track {
        gap: 20px; /* Smaller gap */
    }
}

/* //FIX-DESKTOP-MOBILE: NAVBAR SEPARATION */

/* MOBILE NAVBAR (< 992px) */
@media (max-width: 991.98px) {
    /* Move Toggle to Left */
    .mobile-menu-toggle {
        margin-right: auto;
        order: 1; /* First element */
        display: flex;
        align-items: center;
        gap: 8px; /* Space between icon and text */
    }

    /* "MENÜ" Label next to Icon */
    .mobile-menu-toggle::after {
        content: "MENÜ";
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        color: #e5e7eb;
        display: block;
    }

    /* Topbar adjustments */
    .topbar-mobile-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .topbar-desktop-wrapper {
        display: none !important;
    }
}

/* DESKTOP NAVBAR (>= 992px) */
@media (min-width: 992px) {
    /* Ensure no hamburger in desktop via CSS as backup */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .topbar-mobile-wrapper {
        display: none !important;
    }
    
    .topbar-desktop-wrapper {
        display: flex !important;
    }
}

    /* Sticky adjustment: Ensure content doesn't jump */
    body {
        padding-top: 0; /* Let header overlay or push normally */
    }
.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ensure visibility on dark background */
    opacity: 1;
    visibility: visible;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* NEW MOBILE DRAWER STYLES */
.mobile-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85vw; /* Use viewport width percentage for better fit */
    max-width: 320px;
    background-color: #0f172a; /* Dark Blue Theme */
    z-index: 10000; /* Increased Z-index to be absolutely top */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    visibility: hidden; /* Hide when closed to prevent interaction */
}

.mobile-menu-container.is-active {
    transform: translateX(0);
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: #0b1220;
}

.mobile-menu-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    padding: 5px;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-menu-close:hover {
    color: #ef4444; /* Red on hover */
}

/* Fix for links not working - make sure they are on top */
.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
    z-index: 10;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Fix menu item visibility and interaction */
.mobile-nav-list > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s;
    opacity: 1; /* Ensure opacity */
    cursor: pointer; /* Ensure pointer cursor */
    background-color: transparent; /* Reset any transparent bg */
}

.mobile-nav-list > li > a:hover {
    background-color: rgba(255,255,255,0.05);
    color: #38bdf8;
    padding-left: 24px; /* Slide effect */
}

/* Submenu Styles for Mobile */
/* FORCE RESET BOOTSTRAP DROPDOWN STYLES */
.mobile-nav-list .dropdown-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: rgba(0,0,0,0.2) !important;
    display: none; /* Controlled by is-open class */
    opacity: 1 !important;
    visibility: visible !important;
    inset: auto !important;
}

.mobile-nav-list .has-submenu.is-open > .dropdown-menu {
    display: block !important;
    animation: slideDown 0.3s ease;
}

.mobile-nav-list .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ensure submenu links are also visible */
.mobile-nav-list .submenu li a {
    display: block;
    padding: 14px 20px 14px 40px; /* Indented */
    color: #94a3b8;
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    opacity: 1;
    cursor: pointer;
}

.mobile-nav-list .submenu li a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

/* Chevron Rotation */
.mobile-nav-list .has-submenu > a::after {
    content: '\f078'; /* FontAwesome Chevron Down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.mobile-nav-list .has-submenu.is-open > a::after {
    transform: rotate(180deg);
}

/* Mobile Contact Info */
.mobile-contact-info {
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, #38bdf8, #0ea5e9);
    color: #0f172a;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    gap: 10px;
}

/* 15) Mobile Topbar Reorganization */
@media (max-width: 991.98px) {
    /* Adjust Header Layout */
    .header-inner {
        justify-content: space-between; 
        padding: 10px 16px;
    }

    /* Topbar Stacking */
    .topbar {
        position: relative;
        z-index: 35;
    }

    .topbar-inner {
        padding: 0 10px;
        height: 50px;
    }

    .topbar-left {
        display: flex;
        gap: 6px;
        width: auto;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .topbar-pill {
        padding: 0 8px;
        height: 32px;
        font-size: 0.75rem;
        min-width: auto;
        white-space: nowrap;
        flex: 0 0 auto;
        min-height: 32px; /* Override 44px global for this dense bar */
    }
    
    .topbar-pill-text {
        font-size: 0.7rem;
        line-height: 32px;
        display: inline-block;
        white-space: nowrap;
    }
    
    .topbar-pill-icon {
        font-size: 0.8rem;
        margin-right: 4px;
    }

    .topbar-right {
        width: auto;
        justify-content: flex-end;
        position: static;
    }

    .topbar-lang-wrapper {
        display: flex;
        gap: 4px;
        z-index: 102;
        top: 0 !important; /* Fix for cut-off */
        margin-top: 0 !important;
        align-items: center;
    }

    .lang-pill {
        width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        border-radius: 50%;
        min-height: 32px;
        min-width: 32px;
    }

    /* BRAND LOGO ADJUSTMENTS */
    .brand-row {
        height: 0;
        position: relative;
        z-index: 100;
    }

    .brand-logo {
        position: absolute;
        top: 38px;
        left: 50%;
        transform: translateX(-50%);
        width: 174px;
        height: 82px;
        border-radius: 0 0 24px 24px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 90;
    }
    
    .brand-logo-img {
        width: 138px;
        max-width: 138px;
        height: auto;
        max-height: 50px;
        object-fit: contain;
    }

    .nav-row {
        margin-top: 10px;
        min-height: 50px;
        position: relative;
        z-index: 30;
    }
}

@media (max-width: 575.98px) {
    /* Phone Specific Tweaks */
    .brand-logo {
        position: absolute;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 204px;
        height: 88px;
        border-radius: 0 0 26px 26px;
        padding: 25px 16px 10px 16px;
        box-shadow: 0 6px 15px rgba(0,0,0,0.25);
        z-index: 34; /* Above nav, below mobile topbar */
        background: #fff;
    }
    
    .brand-logo-img {
        width: 164px;
        max-width: 164px;
        height: auto;
        max-height: 48px;
        object-fit: contain;
    }

    /* Fix Topbar Layout */
    .topbar-inner {
        padding: 0 8px;
        height: 50px;
        position: relative;
        z-index: 95; /* Ensure topbar is above logo base but below logo content if needed */
    }

    .topbar-mobile-wrapper {
        align-items: center; /* Vertical center */
    }

    .topbar-left {
        gap: 6px;
        flex: 1; /* Take available space */
    }

    .topbar-pill {
        padding: 0 10px;
        font-size: 0.7rem;
        height: 34px;
        min-width: auto;
        flex: 0 1 auto; /* Don't stretch too much */
        justify-content: center;
        white-space: nowrap;
    }
    
    .topbar-pill-text {
        white-space: nowrap;
        line-height: 34px;
        font-size: 0.7rem;
    }

    /* Fix Language Pills Alignment */
    .topbar-right {
        flex: 0 0 auto;
        margin-left: 6px;
    }

    .lang-pill {
        width: 36px; /* Slightly larger to fit content */
        height: 36px;
        border-radius: 50%;
        font-size: 10px; /* Smaller font for text */
        font-weight: 700;
        padding: 0;
        display: flex;
        flex-direction: column; /* Stack Flag and Text */
        align-items: center;
        justify-content: center;
        line-height: 1;
        gap: 2px;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.25);
        text-align: center;
    }
    
    .lang-pill:hover, .lang-pill.is-active {
        background: #f97316;
        border-color: #f97316;
        color: #fff;
    }
}

@media (max-width: 400px) {
    .topbar-pill-text {
        font-size: 0.6rem;
    }
    .topbar-pill {
        padding: 0 6px;
    }
}

/* CONTACT PAGE MOBILE FIXES */
.contact-map iframe {
    width: 100%;
    height: 350px;
    border: 0;
    border-radius: 10px;
}

@media (max-width: 767.98px) {
    .contact-layout {
        display: grid;
        grid-template-columns: 1fr; /* Force single column */
        gap: 20px;
    }

    .contact-form, 
    .contact-info {
        padding: 20px 16px;
    }

    #contact-form-sms {
        width: 100%;
        min-width: 0;
    }

    #contact-form-sms .row {
        --bs-gutter-x: 0;
        margin-right: 0;
        margin-left: 0;
    }

    #contact-form-sms [class*="col-"] {
        padding-right: 0;
        padding-left: 0;
    }

    .contact-intake-strip .card,
    .page-content .card {
        min-width: 0;
    }

    .contact-google-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        margin-top: 6px;
    }

    .contact-google-action {
        width: 100%;
        min-width: 0;
        min-height: 54px;
        padding: 11px 12px;
        border-radius: 14px;
        text-align: left;
        white-space: normal;
    }

    .contact-google-action i {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .contact-google-action span {
        display: block;
        font-size: 0.92rem;
        line-height: 1.22;
    }

    .contact-map iframe {
        display: block;
        width: 100%;
        height: 250px; /* Smaller map on mobile */
    }
    
    /* Ensure form inputs are easy to tap */
    .form-control {
        min-height: 48px;
    }
    
    .btn-primary {
        width: 100%; /* Full width button on mobile */
        min-height: 50px;
    }

    .contact-submit-btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-right: 14px !important;
        padding-left: 14px !important;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }

    .contact-submit-btn span {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}
