/* =========================================================
   BIRIKIM ELEKTRIK
   MOBILE NAVBAR OVERRIDE
   public/css/mobile-navbar.css
========================================================= */

@media (max-width: 900px) {

    /* =====================================================
       GENEL
    ===================================================== */

    .main-header,
    .main-header *,
    .category-navbar,
    .category-navbar * {
        box-sizing: border-box;
    }

    .main-header {
        position: relative;
        z-index: 500;
        width: 100%;
        overflow: visible;
        background: #ffffff;
    }


    /* =====================================================
       TOPBAR
    ===================================================== */

    .topbar {
        width: 100%;
        background: #171516;
    }

    .topbar-inner {
        width: 100%;
        min-height: 34px;

        display: flex;
        align-items: center;
        justify-content: center;

        padding-top: 0;
        padding-bottom: 0;
    }

    .topbar-message {
        display: none !important;
    }

    .topbar-contact {
        display: flex;
        width: 100%;

        align-items: center;
        justify-content: center;

        gap: 15px;

        white-space: nowrap;

        font-size: 9px;
        font-weight: 700;
    }

    .topbar-contact a {
        color: #ffffff;
        text-decoration: none;
    }


    /* =====================================================
       HEADER CONTAINER

       1. SATIR: LOGO + HAMBURGER
       2. SATIR: ARAMA
       3. SATIR: HESAP / FAVORI / SEPET
    ===================================================== */

    .header-inner {
        display: grid !important;

        grid-template-columns:
            minmax(0, 1fr)
            44px !important;

        grid-template-areas:
            "brand menu"
            "search search"
            "actions actions" !important;

        width: 100%;
        min-width: 0;
        min-height: 0;

        align-items: center;

        gap: 11px 10px !important;

        padding-top: 13px !important;
        padding-bottom: 13px !important;

        overflow: visible;
    }


    /* =====================================================
       LOGO
    ===================================================== */

    .brand {
        grid-area: brand !important;

        display: flex !important;

        width: auto;
        min-width: 0;

        align-items: center;
        justify-content: flex-start !important;

        margin: 0;
        padding: 0;
    }

    .brand-logo {
        display: block;

        width: 175px !important;
        max-width: 75% !important;

        height: auto !important;

        margin: 0;
    }


    /* =====================================================
       ANA HAMBURGER
    ===================================================== */

    .mobile-menu-button {
        grid-area: menu !important;

        position: relative;
        z-index: 1600;

        display: flex !important;

        width: 44px !important;
        min-width: 44px !important;

        height: 44px !important;
        min-height: 44px !important;

        align-items: center;
        justify-content: center;

        justify-self: end;

        margin: 0 !important;
        padding: 0 !important;

        border: 1px solid #e3e3e3 !important;
        border-radius: 10px !important;

        background: #ffffff !important;

        color: #171717 !important;

        cursor: pointer;

        font-family: Arial, sans-serif;
        font-size: 23px !important;
        font-weight: 700;
        line-height: 1 !important;

        box-shadow:
            0 2px 8px
            rgba(0, 0, 0, 0.04);
    }

    .mobile-menu-button:hover {
        border-color: var(--brand-red) !important;

        color: var(--brand-red) !important;
    }


    /* =====================================================
       ARAMA
    ===================================================== */

    .search-form {
        grid-area: search !important;

        display: flex !important;

        width: 100% !important;
        min-width: 0 !important;

        height: 46px !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: hidden;

        border: 1px solid #dedede !important;
        border-radius: 10px !important;

        background: #ffffff !important;
    }

    .search-form:focus-within {
        border-color: var(--brand-red) !important;

        box-shadow:
            0 0 0 3px
            rgba(239, 43, 36, 0.07);
    }

    .search-form input {
        display: block;

        width: 0 !important;
        min-width: 0 !important;

        flex: 1 1 auto !important;

        height: 100%;

        margin: 0;
        padding: 0 14px !important;

        border: 0 !important;
        outline: 0 !important;

        background: transparent !important;

        color: #222222;

        font-family: inherit;
        font-size: 12px !important;
    }

    .search-form input::placeholder {
        color: #999999;
        opacity: 1;
    }

    .search-form button {
        display: flex !important;

        width: 48px !important;
        min-width: 48px !important;

        height: 100% !important;

        flex: 0 0 48px !important;

        align-items: center;
        justify-content: center;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;

        background: var(--brand-red) !important;

        color: #ffffff !important;

        cursor: pointer;

        font-size: 0 !important;
    }

    .search-form button svg {
        display: block !important;

        width: 20px !important;
        height: 20px !important;

        max-width: none !important;

        fill: currentColor !important;
    }


    /* =====================================================
       HESAP / FAVORILER / SEPET
    ===================================================== */

    .header-actions {
        grid-area: actions !important;

        display: grid !important;

        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;

        width: 100% !important;
        min-width: 0 !important;

        align-items: stretch;

        gap: 7px !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-account-area {
        display: block !important;

        width: 100%;
        min-width: 0;
    }

    .navbar-account-link,
    .navbar-favorites-link,
    .navbar-cart-link {
        position: relative;

        display: flex !important;

        width: 100% !important;
        min-width: 0 !important;

        height: 48px !important;
        min-height: 48px !important;

        align-items: center !important;
        justify-content: center !important;

        gap: 6px !important;

        margin: 0 !important;
        padding: 0 7px !important;

        border: 1px solid #e4e4e4 !important;
        border-radius: 9px !important;

        background: #ffffff !important;

        color: #222222 !important;

        text-decoration: none !important;

        overflow: visible;

        box-shadow: none !important;
    }


    /* =====================================================
       ACTION ICONS
    ===================================================== */

    .navbar-account-icon,
    .navbar-favorite-icon,
    .navbar-cart-link > .action-icon {
        display: flex !important;

        width: 25px !important;
        min-width: 25px !important;

        height: 25px !important;

        flex: 0 0 25px !important;

        align-items: center !important;
        justify-content: center !important;

        margin: 0 !important;
        padding: 0 !important;

        line-height: 1 !important;
    }

    .navbar-account-icon {
        border-radius: 50%;

        background:
            rgba(239, 43, 36, 0.09) !important;

        color: var(--brand-red) !important;

        font-size: 11px !important;
        font-weight: 900;
    }

    .navbar-favorite-icon {
        color: var(--brand-red) !important;

        font-family: Arial, sans-serif;

        font-size: 22px !important;
        font-weight: 400 !important;
    }

    .navbar-cart-link > .action-icon {
        font-size: 18px !important;
    }


    /* =====================================================
       ACTION TEXT
    ===================================================== */

    .navbar-account-link > span:last-child,
    .navbar-favorites-link .header-action-text,
    .navbar-cart-link > span:nth-child(2) {
        display: flex !important;

        min-width: 0;

        flex-direction: column;

        align-items: flex-start;
        justify-content: center;

        gap: 1px;
    }

    .navbar-account-link small,
    .navbar-favorites-link small,
    .navbar-cart-link small {
        display: block !important;

        margin: 0;

        color: #999999 !important;

        font-size: 7px !important;
        font-weight: 600;

        line-height: 1.1;

        white-space: nowrap;
    }

    .navbar-account-link strong,
    .navbar-favorites-link strong,
    .navbar-cart-link strong {
        display: block;

        max-width: 55px !important;

        overflow: hidden;

        color: #222222 !important;

        font-size: 9px !important;
        font-weight: 800 !important;

        line-height: 1.2;

        text-overflow: ellipsis;
        white-space: nowrap;
    }


    /* =====================================================
       FAVORI / SEPET SAYACI
    ===================================================== */

    .navbar-favorites-count,
    .navbar-favorites-link [data-favorite-total],
    .navbar-cart-link > b {
        position: absolute !important;

        z-index: 4;

        top: -5px !important;
        right: -4px !important;

        display: grid !important;

        width: auto !important;
        min-width: 18px !important;

        height: 18px !important;

        padding: 0 4px !important;

        place-items: center;

        border: 2px solid #ffffff !important;
        border-radius: 999px !important;

        background: var(--brand-red) !important;

        color: #ffffff !important;

        font-size: 7px !important;
        font-weight: 900 !important;

        line-height: 1 !important;
    }


    /* =====================================================
       ALT NAVBAR
       TÜM KATEGORILER + FIRSATLAR
    ===================================================== */

    .category-navbar {
        position: relative;

        z-index: 600;

        width: 100%;

        overflow: visible !important;

        border-top: 1px solid #eeeeee;

        background: #ffffff;
    }

    .category-navbar-inner {
        position: relative;

        display: grid !important;

        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr) !important;

        width: 100%;

        min-height: 48px !important;

        align-items: stretch !important;

        margin: 0 auto;

        overflow: visible !important;
    }

    .navbar-category-area {
        position: static !important;

        display: flex !important;

        width: 100%;
        min-width: 0;

        align-self: stretch;
    }

    .all-categories-button {
        display: flex !important;

        width: 100% !important;
        min-width: 0 !important;

        height: 48px !important;
        min-height: 48px !important;

        align-items: center;
        justify-content: center;

        gap: 7px !important;

        margin: 0;
        padding: 0 10px !important;

        border: 0 !important;
        border-radius: 0 !important;

        background: var(--brand-red) !important;

        color: #ffffff !important;

        font-size: 10px !important;
        font-weight: 850 !important;

        white-space: nowrap;
    }

    .all-categories-icon {
        display: flex !important;

        width: 18px;
        height: 18px;

        align-items: center;
        justify-content: center;

        font-size: 15px !important;
    }

    .all-categories-arrow {
        margin-left: 3px !important;

        font-size: 9px !important;
    }


    /* FIRSAT ÜRÜNLERİ */

    .category-navbar-inner > .campaign-link {
        display: flex !important;

        width: 100%;
        min-width: 0;

        height: 48px;

        align-items: center;
        justify-content: center;

        margin: 0 !important;
        padding: 0 8px;

        border-bottom: 2px solid transparent;

        background: #ffffff;

        color: var(--brand-red) !important;

        font-size: 10px !important;
        font-weight: 900 !important;

        text-align: center;
        text-decoration: none;

        white-space: nowrap;
    }

    .category-navbar-inner > .campaign-link:hover,
    .category-navbar-inner > .campaign-link.is-active {
        border-bottom-color: var(--brand-red);

        background:
            rgba(239, 43, 36, 0.035);
    }


    /* =====================================================
       HAMBURGER MENUSU

       mainMenu normalde category-navbar içinde.
       Mobilde açıldığında tam genişlik dropdown.
    ===================================================== */

    .main-menu {
        position: absolute !important;

        z-index: 2000 !important;

        top: calc(100% + 7px) !important;

        right: 10px !important;
        left: 10px !important;

        display: none !important;

        width: auto !important;

        flex-direction: column !important;

        align-items: stretch !important;

        gap: 2px !important;

        margin: 0 !important;
        padding: 8px !important;

        overflow: hidden;

        border: 1px solid #e5e5e5;
        border-radius: 12px;

        background: #ffffff;

        box-shadow:
            0 18px 50px
            rgba(0, 0, 0, 0.18);
    }

    .main-menu.is-open {
        display: flex !important;
    }

    .main-menu a {
        display: flex !important;

        width: 100%;

        min-height: 43px;

        align-items: center;

        margin: 0;

        padding: 0 13px !important;

        border-radius: 8px;

        color: #222222 !important;

        font-size: 12px !important;
        font-weight: 750 !important;

        text-decoration: none;
    }

    .main-menu a:hover,
    .main-menu a.is-active {
        background:
            rgba(239, 43, 36, 0.07);

        color: var(--brand-red) !important;
    }


    /* =====================================================
       MEGA MENU
    ===================================================== */

    .category-mega-menu {
        position: absolute !important;

        z-index: 2100 !important;

        top: 48px !important;

        right: 8px !important;
        left: 8px !important;

        width: auto !important;
        max-width: none !important;

        max-height: calc(100vh - 130px) !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        border-radius: 0 0 14px 14px !important;
    }

    .category-mega-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }


    /* =====================================================
       DARK MODE
    ===================================================== */

    html.is-dark .main-header,
    html.is-dark .category-navbar {
        background: #171516;
    }

    html.is-dark .mobile-menu-button,
    html.is-dark .navbar-account-link,
    html.is-dark .navbar-favorites-link,
    html.is-dark .navbar-cart-link {
        border-color: #393536 !important;

        background: #242122 !important;

        color: #ffffff !important;
    }

    html.is-dark .navbar-account-link strong,
    html.is-dark .navbar-favorites-link strong,
    html.is-dark .navbar-cart-link strong {
        color: #ffffff !important;
    }

    html.is-dark .search-form {
        border-color: #393536 !important;

        background: #242122 !important;
    }

    html.is-dark .search-form input {
        color: #ffffff !important;
    }

    html.is-dark .category-navbar-inner > .campaign-link {
        background: #171516;
    }

    html.is-dark .main-menu {
        border-color: #393536;

        background: #1c1a1b;
    }

    html.is-dark .main-menu a {
        color: #f2efef !important;
    }
}


/* =========================================================
   TELEFON
========================================================= */

@media (max-width: 600px) {

    .category-mega-grid {
        grid-template-columns: 1fr !important;
    }

    .category-mega-group {
        padding: 7px !important;
    }

    .category-mega-footer {
        flex-direction: column !important;

        align-items: stretch !important;
    }

    .category-mega-footer > a {
        width: 100%;

        justify-content: center;
    }
}


/* =========================================================
   380PX VE ALTI
========================================================= */

@media (max-width: 380px) {

    .header-inner {
        grid-template-columns:
            minmax(0, 1fr)
            41px !important;
    }

    .brand-logo {
        width: 158px !important;
    }

    .mobile-menu-button {
        width: 41px !important;
        min-width: 41px !important;

        height: 41px !important;
        min-height: 41px !important;
    }

    .header-actions {
        gap: 5px !important;
    }

    .navbar-account-link,
    .navbar-favorites-link,
    .navbar-cart-link {
        height: 46px !important;
        min-height: 46px !important;

        gap: 4px !important;

        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .navbar-account-icon,
    .navbar-favorite-icon,
    .navbar-cart-link > .action-icon {
        width: 22px !important;
        min-width: 22px !important;

        height: 22px !important;

        flex-basis: 22px !important;
    }

    .navbar-account-link strong,
    .navbar-favorites-link strong,
    .navbar-cart-link strong {
        max-width: 47px !important;

        font-size: 8px !important;
    }

    .navbar-account-link small,
    .navbar-favorites-link small,
    .navbar-cart-link small {
        font-size: 6px !important;
    }

    .all-categories-button,
    .category-navbar-inner > .campaign-link {
        font-size: 9px !important;
    }
}


/* =========================================================
   OVERFLOW KORUMASI
========================================================= */

@media (max-width: 900px) {

    html,
    body {
        width: 100%;
        max-width: 100%;

        overflow-x: hidden !important;
    }

    .main-header,
    .header-inner,
    .category-navbar,
    .category-navbar-inner {
        max-width: 100%;
    }
}

/* =========================================================
   MOBILE - KAPALI ANA MENÜ ARTIKLARINI TEMİZLE
========================================================= */

@media (max-width: 900px) {

    /*
     * Hamburger menüsü kapalıyken içerisindeki
     * hiçbir link / pseudo element görünmesin.
     */
    .main-menu:not(.is-open) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .main-menu:not(.is-open) a,
    .main-menu:not(.is-open) a::before,
    .main-menu:not(.is-open) a::after {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        content: none !important;
    }

    /*
     * Mobil header içinde eski desktop menü dekorasyonlarının
     * yukarı taşmasını engelle.
     */
    .header-inner > .main-menu {
        display: none !important;
    }
}

/* =========================================================
   MOBILE LOGO FIX
   Light ve dark logonun aynı anda görünmesini engeller
========================================================= */

@media (max-width: 900px) {

    html:not(.is-dark) .brand-logo-light {
        display: block !important;
    }

    html:not(.is-dark) .brand-logo-dark {
        display: none !important;
    }

    html.is-dark .brand-logo-light {
        display: none !important;
    }

    html.is-dark .brand-logo-dark {
        display: block !important;
    }
}

/* =========================================================
   SEARCH BUTTON - ICON PERFECT CENTER
========================================================= */

.search-form button {
    position: relative !important;

    display: grid !important;
    place-items: center !important;

    width: 54px !important;
    min-width: 54px !important;
    height: 100% !important;

    padding: 0 !important;
    margin: 0 !important;

    line-height: 0 !important;
}

.search-form button svg {
    display: block !important;

    width: 22px !important;
    height: 22px !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;
    transform: none !important;
}


/* MOBIL */
@media (max-width: 900px) {

    .search-form button {
        width: 48px !important;
        min-width: 48px !important;
    }

    .search-form button svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* =========================================================
   NAVBAR MENU ICONS
========================================================= */

.main-menu a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.main-menu-icon {
    display: block;

    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.main-menu a:hover .main-menu-icon {
    transform: translateY(-1px);
}

.main-menu a.is-active .main-menu-icon {
    color: var(--brand-red);
}


/* =========================================================
   DESKTOP CAMPAIGN ICON
========================================================= */

.campaign-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.campaign-link-icon {
    display: block;

    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 0.2s ease;
}

.campaign-link:hover .campaign-link-icon {
    transform: translateY(-1px) scale(1.06);
}


/* =========================================================
   MOBILE MENU ICONS
========================================================= */

@media (max-width: 900px) {

    .main-menu a {
        display: flex;
        align-items: center;
        gap: 11px;
    }

    .main-menu-icon {
        width: 19px;
        height: 19px;

        flex-basis: 19px;
    }

    .main-menu a.is-active .main-menu-icon {
        color: var(--brand-red);
    }
}