/* ============================================================
   Site Header — Ellaithy Auto
   front.blade.php layout styles
   ============================================================ */

/* ── Prevent horizontal scroll on all pages ── */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Base ── */
#header.defualt {
    background: #ffffff !important;
    /* border-bottom: 1px solid rgba(219, 45, 46, 0.22); */
    /* box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5); */
    position: sticky;
    top: 0;
    z-index: 9999;
    transition: background 0.3s, box-shadow 0.3s;
}

#header .menu,
#header .mega-menu,
#header .menu-list-items {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.mega-menu img {
    margin: 0;
    padding: 0;
    max-width: 60% !important;
}

/* ── Logo size cap ── */
#logo_img {
    max-height: 90px;
    max-width: 180px;
    width: auto;
    height: auto;
}

.menu-list-items .container {
    max-width: 1600px;
}

.mega-menu .menu-links > li {
    line-height: initial;
}

/* ── 3-column row ── */
.hdr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;  /* needed for absolute nav centering */
}

/* ── 1. Brand ── */
.hdr-brand {
    flex: 0 0 auto;
    width: auto !important;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hdr-brand a {
    display: flex;
    align-items: center;
    line-height: 1;
}

/* ── 2. Nav links ── */
.hdr-nav-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.hdr-nav-list > li > a {
    display: flex;
    padding: 8px 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #333;
    text-decoration: none;
    position: relative;
    transition: color 0.22s;
    min-height: 44px;
    align-items: center;
}

.hdr-nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 2px;
    background: #db2d2e;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
    border-radius: 2px;
}

.hdr-nav-list > li > a:hover {
    color: #db2d2e;
}

.hdr-nav-list > li > a:hover::after,
.hdr-nav-list > li.active > a::after {
    transform: scaleX(1);
}

.hdr-nav-list > li.active > a {
    color: #db2d2e;
}

/* ── 3. Actions ── */
.hdr-actions {
    flex: 0 0 auto;
    width: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    position: relative;
    z-index: 2;
}

/* Lang switcher */
.hdr-lang {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.hdr-lang a {
    color: rgba(0, 0, 0, 0.38);
    text-decoration: none;
    transition: color 0.2s;
    padding: 6px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.hdr-lang a:hover,
.hdr-lang a.lang-active {
    color: #db2d2e;
}

.hdr-lang-sep {
    color: rgba(0, 0, 0, 0.2);
    font-weight: 300;
    font-size: 12px;
}

/* Auth button */
.hdr-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    background: #db2d2e;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 3px;
    line-height: 1;
    min-height: 36px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(219, 45, 46, 0.3);
}

.hdr-btn:hover {
    background: #c42526;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(219, 45, 46, 0.45);
}

.hdr-btn--icon {
    padding: 8px 14px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
}

/* Scrolled state */
#header.defualt.scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

/* ── Hamburger ── */
.hdr-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 10px;
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    transition: border-color 0.2s;
}

.hdr-hamburger:hover {
    border-color: rgba(219, 45, 46, 0.6);
}

.hdr-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #000000;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
    transform-origin: center;
}

#header.menu-open .hdr-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#header.menu-open .hdr-hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#header.menu-open .hdr-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */

/* ── Desktop: absolutely center the nav ── */
@media (min-width: 992px) {
    .hdr-nav-list {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: max-content !important;
        flex: none !important;
    }
}

/* ── Large tablet (≤ 1199px) ── */
@media (max-width: 1199px) {
    .hdr-nav-list > li > a {
        padding: 8px 7px;
        font-size: 11px;
        letter-spacing: 0.4px;
    }
}

/* ── Tablet / Mobile (≤ 991px) ── */
@media (max-width: 991px) {
    /* Logo size inside mega-menu on mobile */
    .mega-menu img {
        max-width: 43% !important;
    }

    .hdr-hamburger {
        display: flex;
    }

    .hdr-row {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }

    /* override inline and desktop widths */
    .hdr-brand {
        width: auto !important;
        flex: 1 !important;
    }

    .hdr-nav-list {
        position: static !important;
        transform: none !important;
        display: none !important;
        width: 100% !important;
        flex: none !important;
        white-space: normal;
        order: 4;
    }

    .hdr-actions {
        display: none !important;
        width: 100% !important;
        flex: none !important;
        order: 3;
    }

    /* ── Open state ── */
    #header.defualt {
        position: absolute;
    }

    #header.menu-open .hdr-nav-list {
        display: flex !important;
        flex-direction: column-reverse;
        gap: 0;
        padding: 4px 0;
        border-top: 1px solid rgba(219, 45, 46, 0.08);
        align-items: flex-start;
        animation: hdrSlideDown 0.28s ease forwards;
    }

    #header.menu-open .hdr-nav-list > li {
        width: 100%;
    }

    #header.menu-open .hdr-nav-list > li > a {
        padding: 13px 8px;
        font-size: 14px;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        min-height: 48px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #header.menu-open .hdr-nav-list > li:last-child > a {
        border-bottom: none;
    }

    #header.menu-open .hdr-nav-list > li > a::after {
        display: none;
    }

    #header.menu-open .hdr-nav-list > li.active > a {
        color: #db2d2e;
        padding-left: 14px;
        border-left: 3px solid #db2d2e;
    }

    #header.menu-open .hdr-actions {
        display: flex !important;
        padding: 10px 0;
        border-top: 1px solid rgba(219, 45, 46, 0.2);
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        animation: hdrSlideDown 0.22s ease forwards;
    }

    .hdr-lang {
        font-size: 13px;
    }

    .hdr-btn {
        font-size: 12px;
        padding: 10px 18px;
    }
}

/* ── Mobile (≤ 575px) ── */
@media (max-width: 575px) {
    .hdr-row {
        padding: 8px 0;
    }

    #header.menu-open .hdr-nav-list > li > a {
        padding: 12px 8px;
        font-size: 13px;
    }

    .menu-list-items .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .hdr-lang {
        font-size: 14px;
        gap: 8px;
    }

    .hdr-btn {
        padding: 10px 14px;
    }
}

/* ── Slide-down animation for mobile menu ── */
@keyframes hdrSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
