/* ============================================================
   SUV 4X4 CUSTOM — Mobile Menu (carid.com-style)
   Paleta oficial: #BD0C1C (vermelho) | #151515 (preto) | #FFFFFF (branco)
   Tipografia: Roboto (fallback: system-ui)
   UX/UI Premium — touch-optimized, acessível, performante
   ============================================================ */

/* --------------------------------------------------
   HIDE native Premium mobile menu — our overlay replaces it
   -------------------------------------------------- */
@media (max-width: 1023px) {
    .premium-nav-menu-container.premium-nav-menu-mobile,
    .premium-mobile-menu-container,
    .premium-nav-menu-container .premium-sub-menu-outer,
    .elementor-nav-menu--dropdown,
    #menu-mobile-menu,
    .menu-mobile-menu-container,
    ul[id*="mobile-menu"],
    ul[class*="mobile-menu"] {
        display: none !important;
    }

    /* Force Premium hamburger toggle visible on mobile */
    .premium-hamburger-toggle {
        display: inline-flex !important;
    }

    /* Hide our own trigger — we hook into Premium directly */
    .suv-mobile-trigger {
        display: none !important;
    }
}

/* --------------------------------------------------
   TRIGGER — Hamburger icon (3 lines → X)
   -------------------------------------------------- */
.suv-mobile-trigger {
    display: none;
    position: relative;
    width: 22px;
    height: 18px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 100001;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.suv-mobile-trigger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    transform-origin: center;
}

.suv-mobile-trigger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.suv-mobile-trigger.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.suv-mobile-trigger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

@media (max-width: 1023px) {
    .suv-mobile-trigger {
        display: flex;
    }
}

/* --------------------------------------------------
   OVERLAY — Backdrop
   -------------------------------------------------- */
.suv-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.suv-mobile-overlay.is-open {
    display: block;
}

.suv-mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(21, 21, 21, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: suvFadeIn 0.28s ease;
}

/* --------------------------------------------------
   PANEL — Slide-in from left
   -------------------------------------------------- */
.suv-mobile-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 88%;
    max-width: 420px;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(21, 21, 21, 0.25);
    animation: suvSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

/* --------------------------------------------------
   HEADER — Vermelho oficial #BD0C1C
   -------------------------------------------------- */
.suv-mobile-panel-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #BD0C1C;
    color: #fff;
    flex-shrink: 0;
    min-height: 52px;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(189, 12, 28, 0.3);
}

.suv-mobile-btn-back,
.suv-mobile-btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    border-radius: 8px;
    color: #fff;
    transition: background 0.18s ease, transform 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.suv-mobile-btn-back:hover,
.suv-mobile-btn-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.suv-mobile-btn-back:active,
.suv-mobile-btn-close:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.35);
}

.suv-mobile-btn-back {
    display: none;
}

.suv-mobile-panel-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* --------------------------------------------------
   SEARCH BAR — FiboSearch integration
   -------------------------------------------------- */
.suv-mobile-search {
    padding: 14px 16px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.suv-mobile-search .dgwt-wcas-search-wrapp {
    max-width: 100% !important;
    min-width: auto !important;
}

.suv-mobile-search .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
    font-size: 15px !important;
    padding: 12px 14px 12px 44px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e0e0e0 !important;
    background: #fff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.suv-mobile-search .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:focus {
    border-color: #BD0C1C !important;
    box-shadow: 0 0 0 3px rgba(189, 12, 28, 0.1) !important;
    outline: none !important;
}

/* --------------------------------------------------
   NAVIGATION BODY — Scrollable
   -------------------------------------------------- */
.suv-mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background: #fff;
}

/* Custom scrollbar (WebKit) */
.suv-mobile-nav-body::-webkit-scrollbar {
    width: 5px;
}
.suv-mobile-nav-body::-webkit-scrollbar-track {
    background: transparent;
}
.suv-mobile-nav-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}
.suv-mobile-nav-body::-webkit-scrollbar-thumb:hover {
    background: #BD0C1C;
}

.suv-mobile-panel-container {
    position: relative;
    width: 100%;
    min-height: 100%;
}

/* --------------------------------------------------
   PANELS — Individual slide states
   -------------------------------------------------- */
.suv-mobile-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    background: #fff;
    opacity: 0;
    transform: translateX(28px);
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.suv-mobile-nav-panel.is-active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.suv-mobile-nav-panel.is-exit-left {
    opacity: 0;
    transform: translateX(-28px);
    pointer-events: none;
}

/* --------------------------------------------------
   NAV LIST
   -------------------------------------------------- */
.suv-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.suv-mobile-nav-item {
    margin: 0;
    padding: 0;
}

.suv-mobile-nav-item + .suv-mobile-nav-item {
    border-top: 1px solid #f2f2f2;
}

.suv-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #151515;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}

.suv-mobile-nav-link:hover {
    background: #fff5f5;
    color: #BD0C1C;
}

.suv-mobile-nav-link:active {
    background: #ffeaea;
    transform: scale(0.995);
}

.suv-mobile-nav-link .suv-mobile-nav-text {
    flex: 1;
}

.suv-mobile-nav-link .suv-mobile-nav-chevron {
    flex-shrink: 0;
    color: #ccc;
    transition: color 0.18s ease, transform 0.2s ease;
}

.suv-mobile-nav-link:hover .suv-mobile-nav-chevron {
    color: #BD0C1C;
    transform: translateX(3px);
}

/* Active / selected state */
.suv-mobile-nav-link--parent {
    -webkit-appearance: none;
    appearance: none;
}

/* --------------------------------------------------
   SUB-PANEL HEADER — Category title + "Voir tout"
   -------------------------------------------------- */
.suv-mobile-sub-header {
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.suv-mobile-sub-title {
    font-size: 12px;
    font-weight: 700;
    color: #BD0C1C;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.suv-mobile-view-all {
    font-size: 13px;
    color: #151515;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(189, 12, 28, 0.08);
    transition: background 0.18s ease, color 0.18s ease;
}

.suv-mobile-view-all:hover {
    background: #BD0C1C;
    color: #fff;
}

/* --------------------------------------------------
   FOOTER — Mon Compte, Favoris, Panier
   -------------------------------------------------- */
.suv-mobile-footer {
    display: flex;
    justify-content: space-around;
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    gap: 4px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.suv-mobile-footer-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
    white-space: nowrap;
    flex: 1;
    max-width: 100px;
}

.suv-mobile-footer-link:hover {
    background: #fff5f5;
    color: #BD0C1C;
    transform: translateY(-1px);
}

.suv-mobile-footer-link:active {
    transform: scale(0.96);
}

.suv-mobile-footer-link svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    stroke: #BD0C1C;
    transition: stroke 0.18s ease;
}

.suv-mobile-footer-link:hover svg {
    stroke: #BD0C1C;
}

/* --------------------------------------------------
   RESPONSIVE
   -------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .suv-mobile-panel {
        max-width: 420px;
        width: 55%;
    }

    .suv-mobile-nav-link {
        padding: 16px 24px;
        font-size: 16px;
    }

    .suv-mobile-search .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
        font-size: 16px !important;
    }

    .suv-mobile-footer-link {
        font-size: 12px;
        padding: 10px 16px;
    }
}

/* Desktop — hide everything */
@media (min-width: 1024px) {
    .suv-mobile-overlay,
    .suv-mobile-trigger {
        display: none !important;
    }
}

/* --------------------------------------------------
   ANIMATIONS
   -------------------------------------------------- */
@keyframes suvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes suvSlideIn {
    from { transform: translateX(-105%); }
    to   { transform: translateX(0); }
}
