/**
 * Marketplace header — logo | arama | hesap | sepet + ikonlu kategori şeridi
 * Referans: yerel gıda e-ticaret header düzeni
 */

.site-header.hdr-mp {
    background: #fff;
    border-bottom: 1px solid #eceff1;
    box-shadow: none;
    position: relative !important;
    top: auto !important;
}

/* Logo büyüyünce satır kesilmesin */
.site-header.hdr-mp .header-top-wrap {
    max-height: none !important;
    overflow: visible !important;
}

/* Eski compact: logo satırını gizleme — hdr-mp'de kullanılmaz */
.site-header.hdr-mp.is-header-compact .header-top-wrap {
    max-height: none !important;
}

/* ── Ana satır ── */
.hdr-mp .header-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    min-height: 88px;
    height: auto;
    padding: 10px 0;
    box-sizing: border-box;
}

.hdr-mp .header-nav-bar {
    display: none !important;
}

.hdr-mp .header-logo {
    width: auto;
    max-width: var(--header-logo-max-width, 220px);
    min-height: 0;
    align-self: center;
    line-height: 0;
}

.hdr-mp .header-logo img {
    height: auto;
    width: auto;
    max-height: var(--header-logo-height, 56px);
    max-width: var(--header-logo-max-width, 220px);
    object-fit: contain;
    display: block;
}

.hdr-mp .logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-dark, #1b5e20);
}

/* ── Arama ── */
.hdr-mp .header-search-wrap.desktop-only {
    display: flex;
    flex: 1;
    max-width: none;
    min-width: 0;
    width: 100%;
}

.hdr-mp .search-form-v2 {
    width: 100%;
}

.hdr-mp .search-v2-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    border: 1.5px solid color-mix(in srgb, var(--accent, #2e7d32) 55%, #c8e6c9);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s;
}

.hdr-mp .search-form-v2.focused .search-v2-inner,
.hdr-mp .search-v2-inner:hover {
    border-color: var(--accent, #2e7d32);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2e7d32) 16%, transparent);
}

.hdr-mp .search-v2-category,
.hdr-mp .search-v2-divider,
.hdr-mp .search-v2-btn span {
    display: none !important;
}

.hdr-mp .search-v2-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 16px;
    min-width: 0;
}

.hdr-mp .search-v2-icon {
    display: none;
}

.hdr-mp .search-form-v2 .search-v2-input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text, #1f2937);
    min-width: 0;
    height: 100%;
    padding: 0;
}

.hdr-mp .search-v2-input::placeholder {
    color: #9ca3af;
}

.hdr-mp .search-v2-btn {
    flex-shrink: 0;
    width: 52px;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent-dark, #1b5e20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hdr-mp .search-v2-btn:hover {
    background: color-mix(in srgb, var(--accent, #2e7d32) 10%, #fff);
    color: var(--accent, #2e7d32);
}

.hdr-mp .search-v2-btn i {
    font-size: 22px;
}

/* ── Hesap + Sepet ── */
.hdr-mp .header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: 0;
}

.hdr-mp .hdr-account {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.hdr-mp .hdr-account__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #2e7d32) 14%, #fff);
    color: var(--accent-dark, #1b5e20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hdr-mp .hdr-account__icon i {
    font-size: 22px;
}

.hdr-mp .hdr-account__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 2px;
}

.hdr-mp .hdr-account__text strong {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent-dark, #1b5e20);
    text-transform: uppercase;
}

.hdr-mp .hdr-account__text small {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.hdr-mp .hdr-account:hover .hdr-account__icon {
    background: color-mix(in srgb, var(--accent, #2e7d32) 22%, #fff);
}

.hdr-mp .hdr-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-width: 72px;
    padding-top: 2px;
}

.hdr-mp .hdr-cart__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #e65100;
    margin-bottom: 2px;
    white-space: nowrap;
}

.hdr-mp .hdr-cart__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5d4037;
}

.hdr-mp .hdr-cart__icon > i {
    font-size: 34px;
    line-height: 1;
}

.hdr-mp .hdr-cart__badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef6c00;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.hdr-mp .hdr-cart:hover .hdr-cart__icon {
    color: #3e2723;
}

.hdr-mp .header-action-item.mobile-only {
    color: var(--accent-dark, #1b5e20);
}

.hdr-mp .hdr-mp-hide {
    display: none !important;
}

/* ── Kategori şeridi: sticky + tam genişlik ── */
.hdr-mp-cat-slot {
    position: relative;
    width: 100%;
}

.hdr-mp-cats.header-categories-bar {
    display: block !important;
    width: 100%;
    border-top: 1px solid #eef0f2 !important;
    border-bottom: 1px solid transparent !important;
    background: #fff !important;
    padding: 0;
    overflow: visible;
    position: relative;
    top: auto;
    z-index: 70;
    box-sizing: border-box;
}

.hdr-mp-cats.is-cat-compact {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    border-bottom-color: #e8eaed !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.hdr-mp-cat-slot.is-pinned {
    /* fixed menü yüksekliği kadar boşluk — sayfa zıplamasın */
}

.hdr-mp-cats .header-categories-inner {
    display: flex !important;
    align-items: stretch;
    gap: 0;
    width: 100% !important;
    max-width: 1470px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 32px !important;
    box-sizing: border-box;
    background: transparent;
    min-width: 0;
    overflow: visible;
}

.hdr-mp-cats .header-cat-scroll-btn {
    display: none !important;
}

.hdr-mp-cats .header-categories-scroller {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    cursor: default;
}

.hdr-mp-cats .header-categories-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 72px;
    padding: 8px 0 !important;
    background: transparent;
    box-sizing: border-box;
}

.hdr-mp-cats .header-cat-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.hdr-mp-cats .header-cat-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 18%;
    bottom: 18%;
    width: 1px;
    background: #e5e7eb;
}

.hdr-mp-cats .header-cat-pill {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #374151 !important;
    text-decoration: none;
    white-space: normal;
    transition: color .15s;
}

.hdr-mp-cats .header-cat-pill i {
    font-size: 28px !important;
    line-height: 1;
    color: #4b5563 !important;
    opacity: 1 !important;
    flex-shrink: 0;
}

.hdr-mp-cats .header-cat-pill i.is-fallback-hidden {
    display: none !important;
}

.hdr-mp-cats .header-cat-pill__img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    border-radius: 6px;
    background: transparent;
}

.hdr-mp-cats .header-cat-pill span {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: inherit;
}

.hdr-mp-cats .header-cat-pill:hover,
.hdr-mp-cats .header-cat-pill.active,
.hdr-mp-cats .header-cat-pill.is-parent-active {
    color: var(--accent-dark, #1b5e20) !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.hdr-mp-cats .header-cat-pill:hover i,
.hdr-mp-cats .header-cat-pill.active i,
.hdr-mp-cats .header-cat-pill.is-parent-active i {
    color: var(--accent, #2e7d32) !important;
}

.hdr-mp-cats .header-cat-pill--shop,
.hdr-mp-cats .header-cat-pill--shop:hover,
.hdr-mp-cats .header-cat-pill--shop.active {
    background: transparent !important;
    box-shadow: none !important;
}

.hdr-mp-cats .header-cat-pill--shop i {
    color: #ef6c00 !important;
}

.hdr-mp-cats .header-cat-pill--sub {
    display: none !important;
}

/* Kompakt: ikon solda; dış yükseklik sabit kalsın diye min-height korunur */
.hdr-mp-cats.is-cat-compact .header-categories-nav {
    min-height: 72px;
    padding: 8px 0 !important;
}

.hdr-mp-cats.is-cat-compact .header-cat-item:not(:last-child)::after {
    top: 22%;
    bottom: 22%;
}

.hdr-mp-cats.is-cat-compact .header-cat-pill {
    flex-direction: row;
    gap: 8px;
    padding: 6px 8px !important;
}

.hdr-mp-cats.is-cat-compact .header-cat-pill i {
    font-size: 18px !important;
}

.hdr-mp-cats.is-cat-compact .header-cat-pill__img {
    width: 22px;
    height: 22px;
}

.hdr-mp-cats.is-cat-compact .header-cat-pill span {
    font-size: 12px;
    text-align: left;
}

@media (max-width: 1100px) {
    .hdr-mp .header-main {
        gap: 16px;
        min-height: 76px;
        height: auto;
        padding: 8px 0;
    }
    .hdr-mp .hdr-account__text small {
        display: none;
    }
    .hdr-mp-cats .header-categories-inner {
        padding: 0 16px !important;
    }
    .hdr-mp-cats .header-cat-pill span {
        font-size: 11px;
    }
    .hdr-mp-cats .header-cat-pill i {
        font-size: 24px;
    }
}

@media (max-width: 1023px) {
    .hdr-mp .header-main {
        display: grid;
        grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
        align-items: center;
        column-gap: 8px;
        min-height: 56px;
        height: 56px;
        padding: 0;
        box-sizing: border-box;
    }

    .hdr-mp .header-search-wrap.desktop-only {
        display: none !important;
    }

    .hdr-mp .mobile-menu-btn {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        align-self: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        line-height: 1;
        color: #1f2937;
        border: 0;
        background: transparent;
        border-radius: 10px;
    }

    .hdr-mp .header-logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: min(148px, 42vw);
        min-height: 0;
        margin: 0;
        line-height: 0;
    }

    .hdr-mp .header-logo img {
        height: auto;
        width: auto;
        max-height: 40px;
        max-width: min(148px, 42vw);
        object-fit: contain;
        display: block;
    }

    .hdr-mp .header-logo .logo-text {
        font-size: 1rem;
        line-height: 1.1;
        text-align: center;
    }

    .hdr-mp .header-actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        margin: 0;
        min-height: 44px;
    }

    .hdr-mp .hdr-account__text,
    .hdr-mp .hdr-cart__label {
        display: none !important;
    }

    .hdr-mp .header-action-item.mobile-only {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        margin: 0;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0;
        border-radius: 10px;
        color: var(--accent, #2e7d32);
    }

    .hdr-mp .header-action-item.mobile-only i {
        font-size: 22px;
        line-height: 1;
    }

    .hdr-mp .hdr-cart {
        min-width: 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        margin: 0;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }

    .hdr-mp .hdr-cart__icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
    }

    .hdr-mp .hdr-cart__icon > i {
        font-size: 24px;
        line-height: 1;
    }

    .hdr-mp .hdr-cart__badge {
        top: -7px;
        right: -9px;
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        padding: 0 4px;
    }

    .hdr-mp-cat-slot,
    .hdr-mp-cats.header-categories-bar {
        display: none !important;
    }

    .hdr-mp .header-inner {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

@media (max-width: 380px) {
    .hdr-mp .header-logo {
        max-width: min(120px, 38vw);
    }
    .hdr-mp .header-logo img {
        max-height: 34px;
        max-width: min(120px, 38vw);
    }
    .hdr-mp .header-actions {
        gap: 0;
    }
}
