:root {
    /* Primary Brand Colors - Overriding Yemeksepeti Pink with a Premium Indigo/Violet */
    --colorBrandPrimary: #e82c33 !important;
    --colorBrandPrimaryDark: #4f46e5 !important;
    --colorInteractionPrimary: #e82c33 !important;
    --colorInteractionPrimaryHover: #ce0009 !important;
    --colorLinearGradient1: #e82c33 !important;
    --colorLinearGradient2: #4338ca !important;
    --colorBrandHighlight: #f5f3ff !important;
    --colorBrandHighlightLvl1: #ede9fe !important;
    --colorGradientBrand: linear-gradient(90deg, #e82c33 0%, #a855f7 100%) !important;
    /* Resetting some background variables if needed */
    --bdsColorSurfacePromobanner: #e82c33 !important;
    --bdsColorIconSupervendor: #e82c33 !important;
    --bdsColorTextNotificationReversed: #e82c33 !important;
    /* Rating highlights - Green looks fine but let's make it a bit more modern emerald */
    --colorBrandPrimaryDark: #10b981 !important;
    --colorRatingHighlight: #34d399 !important;
    /* Typography - If the user wants a different font, we can add it here. */
}

/* Custom Branding Overrides */
[data-testid="brand-icon-yemeksepeti"] svg {
    display: none !important;
}

[data-testid="brand-icon-yemeksepeti"]::after {
    content: "EYemekPazarý";
    font-family: var(--bdsTypographyTitleLargeFontFamily), sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #e82c33;
    letter-spacing: -1px;
}

/* Removal of specific Yemeksepeti labels in UI if any remain */
footer div[style*="text-align: center"] {
    display: none !important;
}

/* Hide original KVKK banner and use our own if needed, or just style the one I found */
#kvkk-cookie-banner button[style*="background: #fa0050"] {
    background: #e82c33 !important;
}

#kvkk-cookie-banner a[style*="color: #fa0050"] {
    color: #e82c33 !important;
}

/* ============================================================
   REFINED RESPONSIVE / MOBILE FIXES
   ============================================================ */

/* Global protection */
html {
    width: 100%;
    height: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    min-height: 100%;
    -webkit-overflow-scrolling: touch; /* Better mobile momentum scroll */
}

/* ---- TABLET & PHONE (max-width: 768px) ---- */
@media screen and (max-width: 768px) {

    /* Header Surgical Fixes */
    .bds-c-navbar__header {
        flex-wrap: wrap !important;
        height: auto !important;
        min-height: 56px !important;
        padding: 12px 16px !important;
        gap: 12px 0 !important;
    }

    /* Logo stays left, login/menu stays right */
    .bds-c-navbar__brand {
        flex-shrink: 0 !important;
        margin-right: auto !important;
    }

    .bds-c-navbar__right {
        margin-left: 0 !important;
        gap: 12px !important;
    }

    /* Address section (Where) - force it to occupy its row when narrow */
    .bds-c-navbar__center--top {
        order: 3 !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        margin-top: 4px !important;
    }

    .where-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .address-content {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        background: #f7f7f7 !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
    }

    /* --- Bottom Navbar Row (Tabs + Search) --- */
    .bottom-content-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        padding: 16px 0 !important;
    }

    /* Tabs (Restoran, Market etc) */
    .vertical-switcher-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px !important;
    }

    .bds-c-tabs__list {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding: 0 16px !important;
    }

    /* SEARCH BAR VISIBILITY & WIDTH FIX */
    .layout-search-container {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        visibility: visible !important;
        min-height: 48px !important;
        margin: 0 !important;
        order: 2 !important; /* Move search below tabs */
        padding: 0 16px !important;
    }

    .layout-search-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .bds-c-search-input {
        width: 100% !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 1.5px solid #dcdcdc !important;
        border-radius: 999px !important;
        overflow: hidden !important;
    }

    /* Override potential hiding classes */
    .layout-search-box.inactive {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .bds-c-search-input__field {
        width: 100% !important;
        height: 48px !important;
        padding-left: 44px !important;
        font-size: 16px !important; /* Prevent iOS zoom on focus */
        border: none !important;
        background: transparent !important;
    }

    /* --- Grid & Content --- */
    .bds-c-grid {
        grid-template-columns: 1fr !important;
        padding: 0 16px !important;
        gap: 20px !important;
    }

    /* Vendor Cards */
    .vendor-list-revamp {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    .vendor-tile-new-l {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Banner adjustments */
    .rlp-nc-banner__content {
        padding: 20px !important;
    }

    .rlp-nc-banner-image-container {
        display: none !important;
    }

    /* Sections with fixed horizontal padding */
    [style*="padding: 0px 64px"],
    [style*="padding:0px 64px"] {
        padding: 0 16px !important;
    }
}

/* ---- SMALL PHONE (max-width: 480px) ---- */
@media screen and (max-width: 480px) {
    .vendor-list-revamp {
        grid-template-columns: 1fr !important;
    }

    .bds-c-navbar__header {
        padding: 6px 8px !important;
    }

    .address-content span {
        max-width: 160px !important;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
