/*
 * Site-wide phone/tablet fixes. Loaded after the generated utilities; these
 * rules are unlayered, so they win over Tailwind's @layer utilities without
 * needing !important.
 */

@media (max-width: 1279.98px) {
    /*
     * Mobile menu: each line is an overflow-hidden reveal mask. At the old
     * 0.98 line height the mask cut the dots and umlauts off Turkish capitals
     * (İNDİRİLENLER read as INDIRILENLER, ÜRÜNLER as URUNLER).
     */
    #header-menu-panel nav a > p {
        padding-top: .08em;
        line-height: 1.1;
    }

    /*
     * Header: a slimmer bar with a smaller logo, flat icons like the desktop
     * header, and a plain dark bar (no glossy capsule) over dark sections.
     */
    header .liquid-glass-nav {
        min-height: 56px;
        padding-inline: 16px 6px;
    }

    header .liquid-glass-nav .logo-field img {
        height: 28px;
    }

    header [data-mobile-actions] {
        gap: 2px;
    }

    header [data-mobile-actions] button {
        height: 40px;
    }

    header [data-mobile-actions] button.rounded-full:not(.px-3) {
        width: 40px;
    }

    header [data-mobile-actions] button:not(.toggle) {
        border-color: transparent;
        background: transparent;
    }

    header:not([data-header-theme="light"]) .liquid-glass-nav {
        background-image: none;
        background-color: rgb(20 20 22 / 78%);
        box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), 0 8px 28px rgb(0 0 0 / 28%);
    }

    header:not([data-header-theme="light"]) .liquid-glass-nav::after {
        display: none;
    }

    /* The language code is hard-coded dark, which vanished on the dark bar. */
    header:not([data-header-theme="light"]) [data-mobile-actions] .text-shark-900 {
        color: #fff;
    }

    /* Footer menu: two columns instead of one oversized link per row. */
    footer a[class~="group/link"][class*="flex-1/2"] {
        flex: 1 1 40%;
        font-size: 22px;
    }

    /*
     * Newsletter consent: the checkbox label, notice link and trailing label
     * were three shrinking flex items, which squeezed the sentence into three
     * ragged columns. Let it wrap as one sentence beside the checkbox.
     */
    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) {
        position: relative;
        display: block;
        padding-left: 26px;
        font-size: 14px;
        line-height: 1.5;
    }

    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) > label:first-child {
        display: inline;
    }

    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) > label:first-child > span:not(:last-child) {
        position: absolute;
        top: 3px;
        left: 0;
        margin: 0;
    }

    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) > :is(button, label:last-child) {
        display: inline;
    }

    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) > button > span {
        display: inline-block;
        vertical-align: bottom;
    }

    form[name="Newsletter"] div:has(> label > #newsletter-consent-mobile) :is(span, label) {
        font-size: inherit;
    }
}

/*
 * Cookie sheet: on phones it covered two thirds of the screen. Keep all of
 * the notice and choices, just packed tighter, with the actions side by side.
 */
@media (max-width: 767.98px) {
    [data-cookie-box] {
        max-height: 80dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 20px 20px 0 0;
    }

    [data-cookie-box] > div {
        padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
    }

    [data-cookie-box] > div > div:first-child {
        margin-bottom: 8px;
    }

    [data-cookie-box] > div > p {
        margin-bottom: 12px;
        font-size: 13px;
        line-height: 1.45;
    }

    [data-cookie-box] > div > div:has(#analytics-toggle) {
        margin-bottom: 14px;
    }

    [data-cookie-box] > div > div:has(#analytics-toggle) > * + * {
        margin-top: 6px;
    }

    [data-cookie-box] > div > div:has(#analytics-toggle) > div {
        gap: 12px;
        padding: 9px 12px;
    }

    [data-cookie-box] > div > div:has(> [data-cookie-accept]) {
        flex-direction: row;
        gap: 8px;
    }

    [data-cookie-box] > div > div:has(> [data-cookie-accept]) > button {
        padding: 11px 12px;
    }
}
