/* Header düzeni — sabit header, logo üstte, anasayfa banner çakışması yok */

:root {
    --site-header-h: 88px;
    --mobile-header-h: 62px;
    --desktop-header-h: 88px;
}

/* Eski tema body padding'i (40px) tüm sayfalarda kaldır */
html,
body {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.header__logo,
.header__menu {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Sabit header — banner ve içerik üstünde */
.header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    height: var(--site-header-h);
    min-height: var(--site-header-h);
    isolation: isolate;
}

.header .container-fluid,
.header__bar {
    height: 100%;
}

.header__logo {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
}

.header__logo a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    position: relative;
    z-index: 2;
}

/* İçerik header yüksekliği kadar aşağıdan başlar */
.main-wrapper {
    padding-top: var(--site-header-h) !important;
    margin-top: 0 !important;
    position: relative;
    z-index: 1;
}

/* Anasayfa koleksiyon vitrini header altında kalsın */
.main-wrapper > .categories.home-categories,
.main-wrapper > .home-categories,
.main-wrapper > section.categories:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative;
    z-index: 1;
}

.home-categories {
    margin-top: 0 !important;
}

/* ── Masaüstü ── */
@media (min-width: 992px) {
    :root {
        --site-header-h: var(--desktop-header-h);
    }

    .header__bar {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        margin-left: 0;
        margin-right: 0;
    }

    .header__bar > .header__logo {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
        padding-left: 15px;
        padding-right: 15px;
        height: 100%;
    }

    .header__bar > .header__menu-col {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding-left: 15px;
        padding-right: 15px;
        height: 100%;
    }

    .header__bar > .header__menu-col .header__menu {
        padding: 0 !important;
    }

    .header__bar > .header__right-col {
        flex: 0 0 25%;
        max-width: 25%;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        padding-left: 15px;
        padding-right: 15px;
        height: 100%;
    }

    .header__right {
        display: flex !important;
    }

    .header__mobile-tools {
        display: none !important;
    }

    .header .canvas__open {
        display: none !important;
    }
}

/* ── Mobil ── */
@media (max-width: 991px) {
    :root {
        --site-header-h: var(--mobile-header-h);
    }

    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .header .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header__bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: var(--site-header-h);
        min-height: var(--site-header-h);
        margin: 0 !important;
    }

    .header__bar > .header__logo,
    .header__bar > .header__menu-col,
    .header__bar > .header__right-col,
    .header__bar > .header__mobile-tools {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto;
        padding: 0 !important;
        margin: 0 !important;
    }

    .header__logo {
        flex: 1 1 auto !important;
        min-width: 0;
        height: 100%;
    }

    .header__menu-col,
    .header__right-col {
        display: none !important;
    }

    .header__mobile-tools {
        display: flex !important;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        height: 100%;
    }

    .header__mobile-tools .header-search-trigger,
    .header__mobile-tools .header-mobile-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: none;
        background: transparent;
        color: #111;
        font-size: 17px;
        text-decoration: none;
        position: relative;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }

    .header__mobile-tools .header-search-trigger:hover,
    .header__mobile-tools .header-mobile-icon:hover {
        background: #f5f5f5;
        color: #ca1515;
    }

    .header__mobile-tools .header-mobile-badge {
        position: absolute;
        top: 2px;
        right: 0;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #ca1515;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
    }

    .header__mobile-tools .header-mobile-badge.is-hidden {
        display: none;
    }

    .header .canvas__open {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: static !important;
        width: 38px;
        height: 38px;
        line-height: 1;
        font-size: 18px;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 0;
        flex-shrink: 0;
    }

    .offcanvas-menu-overlay {
        top: var(--site-header-h) !important;
        height: calc(100% - var(--site-header-h)) !important;
    }

    .offcanvas-menu-wrapper {
        top: var(--site-header-h) !important;
        width: min(280px, 88vw) !important;
        height: calc(100% - var(--site-header-h)) !important;
        padding: 12px 16px 24px !important;
        left: calc(-1 * min(280px, 88vw)) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        border-top: 1px solid #eee;
    }

    .offcanvas-menu-wrapper.active {
        left: 0 !important;
    }

    .offcanvas__close {
        right: 12px !important;
        top: 10px !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 20px !important;
    }

    .offcanvas__logo {
        display: none !important;
    }

    .offcanvas__widget {
        text-align: left !important;
        margin-bottom: 12px !important;
        padding-bottom: 12px;
        border-bottom: 1px solid #eee;
    }

    .offcanvas__widget li {
        margin-right: 14px !important;
    }

    .offcanvas__auth {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 12px;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #eee;
    }

    .offcanvas__auth a {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #111 !important;
        text-decoration: none;
        margin-right: 0 !important;
    }

    .offcanvas__auth a::after {
        display: none !important;
    }

    .offcanvas__auth a:hover {
        color: #ca1515 !important;
    }

    .offcanvas__auth-name {
        width: 100%;
        font-size: 13px;
        font-weight: 700;
        color: #333;
        margin-bottom: 2px;
    }

    #mobile-menu-wrap {
        overflow-x: hidden;
        max-width: 100%;
        margin-top: 0;
    }

    .slicknav_menu {
        margin-bottom: 0 !important;
        padding-top: 0 !important;
    }

    .slicknav_nav {
        overflow-x: hidden;
        margin: 0 !important;
    }

    .slicknav_nav ul {
        overflow: hidden;
        margin: 0 !important;
    }

    .slicknav_nav a,
    .slicknav_nav .slicknav_row {
        padding: 10px 0 !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.4;
        border-bottom: 1px solid #f3f3f3;
    }

    .slicknav_nav ul ul a {
        padding-left: 12px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        color: #555 !important;
    }

    .slicknav_nav ul ul ul a {
        padding-left: 24px !important;
        font-size: 12px !important;
        color: #777 !important;
    }

    .slicknav_arrow {
        float: right;
        font-size: 12px;
        color: #999;
    }

    .header__menu .dropdown {
        display: none !important;
    }

    body.offcanvas-open {
        overflow: hidden;
    }
}

@media (max-width: 380px) {
    .header__mobile-tools {
        gap: 2px;
    }

    .header__mobile-tools .header-search-trigger,
    .header__mobile-tools .header-mobile-icon,
    .header .canvas__open {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
}
