/* Header on phones and tablets: a readable logo and a two-line menu button that turns into a cross. */
@media screen and (max-width: 1023.98px) {
    .topbar-grid {
        align-items: center;
    }

    .topbar-logo {
        width: 150px;
        max-width: 100%;
        height: 22px;
        margin-right: 0;
    }

    .burger {
        position: relative;
        width: 30px;
        height: 30px;
        border: 0;
        border-radius: 0;
        background: none;
        overflow: visible;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .burger::before,
    .burger::after {
        content: "";
        position: absolute;
        left: 4px;
        width: 22px;
        height: 1.5px;
        background-color: currentColor;
        transition: transform .45s cubic-bezier(.7, 0, .2, 1), width .45s cubic-bezier(.7, 0, .2, 1), top .45s cubic-bezier(.7, 0, .2, 1);
    }

    .burger::before {
        top: 10px;
    }

    .burger::after {
        top: 18px;
        width: 14px;
    }

    .mobile-menu-active .burger::before,
    .mobile-menu-active .burger::after {
        top: 14px;
        width: 22px;
    }

    .mobile-menu-active .burger::before {
        transform: rotate(45deg);
    }

    .mobile-menu-active .burger::after {
        transform: rotate(-45deg);
    }

    /* Page titles with a long second word ("Markalarımız") would run off the screen: no indent there. */
    .page-title--long span:last-child:not(:only-child) {
        padding-left: 0;
    }

    /* ---------- Mobile menu: sub-menus slide in, their items rise one after another ---------- */
    .mobile-menu-list {
        overflow: hidden;
    }

    .mobile-menu-main.active {
        animation: mm-from-left .6s cubic-bezier(.22, .8, .2, 1) both;
    }

    .mobile-menu-secondary.active {
        animation: mm-from-right .6s cubic-bezier(.22, .8, .2, 1) both;
    }

    .mobile-menu-main.active li,
    .mobile-menu-secondary.active li,
    .mobile-menu-secondary.active .mobile-menu-return {
        animation: mm-rise .7s cubic-bezier(.22, .8, .2, 1) both;
    }

    .mobile-menu-secondary.active .mobile-menu-return { animation-delay: .05s; }
    .mobile-menu-main.active li:nth-child(1), .mobile-menu-secondary.active li:nth-child(1) { animation-delay: .08s; }
    .mobile-menu-main.active li:nth-child(2), .mobile-menu-secondary.active li:nth-child(2) { animation-delay: .13s; }
    .mobile-menu-main.active li:nth-child(3), .mobile-menu-secondary.active li:nth-child(3) { animation-delay: .18s; }
    .mobile-menu-main.active li:nth-child(4), .mobile-menu-secondary.active li:nth-child(4) { animation-delay: .23s; }
    .mobile-menu-main.active li:nth-child(5), .mobile-menu-secondary.active li:nth-child(5) { animation-delay: .28s; }
    .mobile-menu-main.active li:nth-child(6), .mobile-menu-secondary.active li:nth-child(6) { animation-delay: .33s; }
    .mobile-menu-main.active li:nth-child(7), .mobile-menu-secondary.active li:nth-child(7) { animation-delay: .38s; }
    .mobile-menu-main.active li:nth-child(8), .mobile-menu-secondary.active li:nth-child(8) { animation-delay: .43s; }
    .mobile-menu-main.active li:nth-child(n+9), .mobile-menu-secondary.active li:nth-child(n+9) { animation-delay: .48s; }

    /* Sub-menu items in the same face as the main menu, a step smaller. */
    .mobile-menu-secondary ul {
        grid-gap: 14px;
    }

    .mobile-menu-secondary li {
        font-family: var(--altfont);
        font-weight: 300;
        font-size: var(--f-l);
        line-height: 1.05;
        letter-spacing: .02em;
        text-transform: none;
    }

    .mobile-menu-secondary li a {
        display: inline-block;
        transition: opacity .3s, transform .3s;
    }

    .mobile-menu-secondary li a:active {
        opacity: .6;
        transform: translateX(6px);
    }

    .mobile-menu-return {
        margin-bottom: 28px;
        opacity: .7;
    }

    @media (prefers-reduced-motion: reduce) {
        .mobile-menu-main.active,
        .mobile-menu-secondary.active,
        .mobile-menu-main.active li,
        .mobile-menu-secondary.active li,
        .mobile-menu-secondary.active .mobile-menu-return {
            animation: none;
        }
    }
}

@keyframes mm-from-right {
    from { transform: translateX(28%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes mm-from-left {
    from { transform: translateX(-18%); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes mm-rise {
    from { transform: translateY(22px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* The first title line is meant to end at the center of the page. A word wider than
   that half ("Showroomlarımızı" on an iPad in landscape) gets a negative left margin
   and Safari clips the start. Short lines still end at the center; long lines stay
   inside the page, starting from the left. */
@media screen and (min-width: 1024px) {
    .page-title {
        container-type: inline-size;
    }

    .page-title span:first-child:not(:only-child) {
        width: max-content;
        max-width: 100%;
        margin-left: 0;
        margin-right: auto;
        transform: translateX(max(0px, calc(50cqi - 100%)));
    }
}

/* Under 1100px the first line fills the page and the italic line is pulled back
   over it, so "Ziyaret Edin" disappears into the line above. Stack them instead. */
@media screen and (min-width: 1024px) and (max-width: 1099.98px) {
    .page-title {
        line-height: 1.12;
    }

    .page-title span:first-child:not(:only-child) {
        transform: none;
    }

    .page-title span:last-child:not(:only-child) {
        padding-left: 40rem;
        margin-left: 0 !important;
        margin-top: 0.12em;
    }
}
