/**
 * ChaCha Home
 * Utility Bar v2.0
 * TICKET-02 / Patch-02B.1
 *
 * Ownership:
 * - Kadence: top header row shell
 * - ChaCha Home: commercial message presentation
 */


/* ==========================================================
   01. TOP ROW FOUNDATION
   ========================================================== */

.site-top-header-wrap {
    position: relative;
    z-index: var(--chacha-z-header, 100);
    background: var(--chacha-onyx, #201A17) !important;
    color: var(--chacha-ivory, #FFFDFC);
}


.site-top-header-wrap
.site-header-row-container-inner {
    background: transparent !important;
}


.site-top-header-wrap
.site-top-header-inner-wrap {
    min-height: 32px;
    align-items: center;
}


.site-top-header-wrap
.site-header-top-section-left,

.site-top-header-wrap
.site-header-top-section-right {
    align-items: center;
}


/*
 * The Customizer HTML item held the old hard-coded
 * "1.000 TL ... | 6 Taksit" copy. Utility Bar v2.0 replaces
 * that content while leaving Kadence's top-row shell intact.
 */
.site-top-header-wrap
.site-header-item[data-section*="html"] {
    display: none !important;
}


/* ==========================================================
   02. COMMERCIAL MESSAGE
   ========================================================== */

.chacha-utility-bar__message {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 32px;
    margin: 0;
    color: var(--chacha-ivory, #FFFDFC);
    font-family: var(--chacha-font-body, "Inter", sans-serif);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.025em;
    white-space: nowrap;
}


.chacha-utility-bar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--chacha-brass, #B08D57);
}


.chacha-utility-bar__icon svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.chacha-utility-bar__text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================================
   03. NARROW DESKTOP / TABLET
   ========================================================== */

@media (max-width: 1180px) {

    .chacha-utility-bar__message {
        font-size: 10.5px;
    }

}


/* ==========================================================
   04. MOBILE
   ========================================================== */

@media (max-width: 1024px) {

    #mobile-header
    .site-top-header-wrap
    .site-top-header-inner-wrap {
        min-height: 34px;
    }


    #mobile-header
    .site-top-header-wrap
    .site-header-top-section-center {
        width: 100%;
        justify-content: center;
    }


    #mobile-header
    .chacha-utility-bar__message {
        width: 100%;
        min-height: 34px;
        justify-content: center;
        gap: 6px;
        padding: 0 10px;
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.015em;
        text-align: center;
    }


    #mobile-header
    .chacha-utility-bar__icon,

    #mobile-header
    .chacha-utility-bar__icon svg {
        width: 14px;
        height: 14px;
    }

}


@media (max-width: 390px) {

    #mobile-header
    .chacha-utility-bar__message {
        font-size: 9.5px;
    }

}


/* ==========================================================
   05. DESKTOP HELPER NAVIGATION
   TICKET-02 / PATCH-02B
   ========================================================== */

@media (min-width: 1025px) {

    .site-top-header-wrap
    .site-header-top-section-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
    }


    .chacha-utility-bar__nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: clamp(12px, 1.1vw, 20px);
        min-width: 0;
        min-height: 32px;
        margin: 0;
        color: var(--chacha-ivory, #FFFDFC);
        font-family: var(--chacha-font-body, "Inter", sans-serif);
        font-size: 10.5px;
        font-weight: 400;
        line-height: 1;
        letter-spacing: 0.018em;
        white-space: nowrap;
    }


    .chacha-utility-bar__link,
    .chacha-utility-bar__stores > summary {
        color: rgba(255, 253, 252, 0.88);
    }


    .chacha-utility-bar__link {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 32px;
        margin: 0;
        text-decoration: none;
        transition:
            color 160ms ease,
            opacity 160ms ease;
    }


    a.chacha-utility-bar__link:hover,
    a.chacha-utility-bar__link:focus-visible,
    .chacha-utility-bar__stores > summary:hover,
    .chacha-utility-bar__stores > summary:focus-visible {
        color: var(--chacha-brass-light, #D0B07B);
    }


    .chacha-utility-bar__link:focus-visible,
    .chacha-utility-bar__stores > summary:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 3px;
        border-radius: 2px;
    }


    .chacha-utility-bar__link.is-coming-soon {
        cursor: default;
        color: rgba(255, 253, 252, 0.72);
    }


    .chacha-utility-bar__link.is-coming-soon small {
        color: var(--chacha-brass-light, #D0B07B);
        font-size: 8px;
        font-weight: 500;
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }


    .chacha-utility-bar__stores {
        position: relative;
        margin: 0;
    }


    .chacha-utility-bar__stores > summary {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        min-height: 32px;
        margin: 0;
        padding: 0;
        cursor: pointer;
        list-style: none;
        transition: color 160ms ease;
    }


    .chacha-utility-bar__stores > summary::-webkit-details-marker {
        display: none;
    }


    .chacha-utility-bar__stores > summary svg {
        width: 13px;
        height: 13px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.4;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform 160ms ease;
    }


    .chacha-utility-bar__stores[open] > summary svg {
        transform: rotate(180deg);
    }


    .chacha-utility-bar__stores-menu {
        position: absolute;
        top: calc(100% + 7px);
        right: 0;
        z-index: var(--chacha-z-dropdown, 500);
        display: grid;
        width: 196px;
        padding: 9px;
        background: var(--chacha-ivory, #FFFDFC);
        border: 1px solid rgba(176, 141, 87, 0.24);
        box-shadow: 0 18px 44px rgba(32, 26, 23, 0.14);
    }


    .chacha-utility-bar__stores-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 38px;
        padding: 0 10px;
        color: var(--chacha-text-strong, #3B322D);
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        text-decoration: none;
        transition:
            background 150ms ease,
            color 150ms ease;
    }


    .chacha-utility-bar__stores-menu a:hover,
    .chacha-utility-bar__stores-menu a:focus-visible {
        background: var(--chacha-alabaster, #F8F4EE);
        color: var(--chacha-brass-dark, #8F6F3F);
    }


    .chacha-utility-external-icon {
        flex: 0 0 auto;
        width: 13px;
        height: 13px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.35;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

}


@media (min-width: 1025px) and (max-width: 1220px) {

    .chacha-utility-bar__nav {
        gap: 10px;
        font-size: 9.5px;
        letter-spacing: 0;
    }


    .chacha-utility-bar__link.is-coming-soon small {
        display: none;
    }

}


/* ==========================================================
   06. MOBILE OFF-CANVAS UTILITY / SOCIAL AREA
   ========================================================== */

@media (max-width: 1024px) {

    .chacha-mobile-utility {
        margin: 18px -18px 0;
        padding: 6px 18px 18px;
        background: var(--chacha-alabaster, #F8F4EE);
        border-top: 1px solid rgba(59, 50, 45, 0.08);
    }


    .chacha-mobile-utility__links {
        margin: 0;
        padding: 0;
        list-style: none;
    }


    .chacha-mobile-utility__links > li {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(59, 50, 45, 0.09);
    }


    .chacha-mobile-utility__links a,
    .chacha-mobile-utility__disabled,
    .chacha-mobile-utility__stores > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        min-height: 52px;
        margin: 0;
        padding: 0;
        color: var(--chacha-text, #5A514C);
        font-family: var(--chacha-font-body, "Inter", sans-serif);
        font-size: 13px;
        font-weight: 400;
        line-height: 1.25;
        letter-spacing: 0.01em;
        text-decoration: none;
    }


    .chacha-mobile-utility__links a:hover,
    .chacha-mobile-utility__links a:focus-visible,
    .chacha-mobile-utility__stores > summary:hover,
    .chacha-mobile-utility__stores > summary:focus-visible {
        color: var(--chacha-brass-dark, #8F6F3F);
    }


    .chacha-mobile-utility__disabled {
        cursor: default;
    }


    .chacha-mobile-utility__disabled small {
        flex: 0 0 auto;
        color: var(--chacha-brass-dark, #8F6F3F);
        font-size: 8px;
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }


    .chacha-mobile-utility__arrow {
        color: var(--chacha-brass, #B08D57);
        font-size: 15px;
    }


    .chacha-mobile-utility__stores {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(59, 50, 45, 0.09);
    }


    .chacha-mobile-utility__stores > summary {
        cursor: pointer;
        list-style: none;
    }


    .chacha-mobile-utility__stores > summary::-webkit-details-marker {
        display: none;
    }


    .chacha-mobile-utility__plus {
        color: var(--chacha-brass, #B08D57);
        font-size: 17px;
        font-weight: 300;
        transition: transform 160ms ease;
    }


    .chacha-mobile-utility__stores[open]
    .chacha-mobile-utility__plus {
        transform: rotate(45deg);
    }


    .chacha-mobile-utility__store-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 0 0 14px;
    }


    .chacha-mobile-utility__store-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 40px;
        padding: 0 11px;
        background: rgba(255, 253, 252, 0.74);
        border: 1px solid rgba(59, 50, 45, 0.10);
        color: var(--chacha-text-strong, #3B322D);
        font-family: var(--chacha-font-body, "Inter", sans-serif);
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1.15;
        text-decoration: none;
    }


    .chacha-mobile-social {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding-top: 18px;
    }


    .chacha-mobile-social__label {
        color: var(--chacha-text-muted, #7B716B);
        font-family: var(--chacha-font-body, "Inter", sans-serif);
        font-size: 10px;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }


    .chacha-mobile-social__icons {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }


    .chacha-mobile-social__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(59, 50, 45, 0.14);
        border-radius: 50%;
        color: var(--chacha-text-strong, #3B322D);
        background: rgba(255, 253, 252, 0.76);
        text-decoration: none;
        transition:
            border-color 160ms ease,
            color 160ms ease,
            background 160ms ease;
    }


    .chacha-mobile-social__link:hover,
    .chacha-mobile-social__link:focus-visible {
        border-color: rgba(176, 141, 87, 0.48);
        color: var(--chacha-brass-dark, #8F6F3F);
        background: var(--chacha-ivory, #FFFDFC);
    }


    .chacha-mobile-social__link:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 2px;
    }


    .chacha-mobile-social__link svg {
        width: 17px;
        height: 17px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.45;
        stroke-linecap: round;
        stroke-linejoin: round;
    }


    .chacha-mobile-social__link svg .is-fill {
        fill: currentColor;
        stroke: none;
    }

}


@media (max-width: 430px) {

    .chacha-mobile-utility {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }


    .chacha-mobile-utility__disabled small {
        font-size: 7.5px;
    }


    .chacha-mobile-social {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }


    .chacha-mobile-social__icons {
        justify-content: flex-start;
    }

}

/* ==========================================================
   07. PATCH-02B.1 — DROPDOWN LAYER + TABLET DRAWER SCROLL
   ========================================================== */

/*
 * The Utility Bar is a sibling of Kadence's main and bottom
 * header rows. Its store dropdown must therefore own a higher
 * stacking context than those rows; a large z-index on the
 * dropdown alone cannot escape a lower parent stacking context.
 */
@media (min-width: 1025px) {

    .site-top-header-wrap {
        z-index: 650;
        overflow: visible !important;
    }


    .site-top-header-wrap
    .site-header-row-container-inner,

    .site-top-header-wrap
    .site-top-header-inner-wrap,

    .site-top-header-wrap
    .site-header-top-section-right {
        overflow: visible !important;
    }


    .chacha-utility-bar__stores-menu {
        z-index: 700;
    }

}


/*
 * Tablet drawers are shorter in practice than their emulated
 * device height because browser chrome / DevTools can reduce the
 * available viewport. Make the ChaCha navigation itself a safe
 * scroll container so helper links, Stores and social actions are
 * always reachable without changing the already-approved phone
 * composition.
 */
@media (min-width: 601px) and (max-width: 1024px) {

    #mobile-drawer
    .chacha-mobile-nav,

    .popup-drawer
    .chacha-mobile-nav {
        max-height: calc(100dvh - 44px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 22px;
        scrollbar-width: thin;
    }


    .chacha-mobile-utility {
        margin-top: 14px;
        padding-bottom: 16px;
    }


    .chacha-mobile-utility__links a,
    .chacha-mobile-utility__disabled,
    .chacha-mobile-utility__stores > summary {
        min-height: 46px;
    }

}

