/* NOTE: PROMO BAR + SITE HEADER + SITE MENU (inc/new/sections/promo-bar.php, header.php) */

.kmd-promo-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    padding: 10px var(--kmd-gutter);
    background: var(--kmd-accent);
    color: var(--kmd-white);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.kmd-promo-bar a {
    color: var(--kmd-white);
}

.kmd-header {
    position: sticky;
    top: var(--kmd-promo-bar-height);
    z-index: 20;
    background: #0E0E0E;
    color: var(--kmd-white);
}

.kmd-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-block: 14px;
}

.kmd-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kmd-header__menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: -10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--kmd-white);
    cursor: pointer;
}

.kmd-header__logo img {
    width: auto;
    height: 30px;
}

.kmd-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
}

.kmd-header__showrooms {
    color: #E8E8E8;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.kmd-header__showrooms:hover {
    color: var(--kmd-white);
    text-decoration: underline;
}

.kmd-header__phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--kmd-white);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.kmd-header__phone:hover {
    color: var(--kmd-white);
}

/* NOTE: SITE MENU PANEL (opened by the menu button, javascript/new/site-menu.js) */

.kmd-site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--kmd-promo-bar-height) - var(--kmd-header-height));
    /* dvh: the visible height on phones, without the browser bars, so the last links can be reached */
    max-height: calc(100dvh - var(--kmd-promo-bar-height) - var(--kmd-header-height));
    overflow-y: auto;
    /* scrolling past the end of the menu does not carry on into the page */
    overscroll-behavior: contain;
    border-top: 1px solid #2A2A2A;
    background: #0E0E0E;
    box-shadow: 0 18px 30px rgba(0, 0, 0, .35);
}

.kmd-site-menu__inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px 48px;
    padding-block: 24px 32px;
}

/* two fixed lists (the 'column' of each link in inc/data/site-menu.php) */
.kmd-site-menu__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0 32px;
}

.kmd-site-menu a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #262626;
    color: #E8E8E8;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.kmd-site-menu a:hover {
    color: var(--kmd-white);
}

.kmd-site-menu .kmd-site-menu__promo {
    color: var(--kmd-gold);
}

/* flashing dot of the Black Friday items (like the stock bullet of black-friday-banner.php) */
.kmd-flash-dot {
    display: inline-block;
    width: .6em;
    height: .6em;
    margin-right: .5em;
    border-radius: 50%;
    background: #FFA31A;
    vertical-align: .05em;
    animation: kmd-flash-dot 1.6s ease-in-out infinite;
}

@keyframes kmd-flash-dot {
    0%,
    100% {
        transform: scale(1);
        background-color: #FFA31A;
        box-shadow: 0 0 0 0 rgba(255, 163, 26, .6);
    }

    50% {
        transform: scale(1.35);
        background-color: #FFC56B;
        box-shadow: 0 0 0 .55em rgba(255, 163, 26, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kmd-flash-dot {
        animation: none;
    }
}

/* the page behind the open menu does not scroll on phones and touch screens (class set by site-menu.js);
   on desktop the hover menu leaves the page alone, so the scrollbar does not jump */
@media (hover: none), (max-width: 767px) {
    /* only <html>: hiding overflow on body as well would make body a scroll box and unstick the header */
    html.kmd-site-menu-open {
        overflow: hidden;
    }
}

@media screen and (max-width: 767px) {
    /* stays on screen while scrolling, so it is kept compact on phones */
    .kmd-promo-bar {
        gap: 2px 12px;
        padding-block: 6px;
        font-size: 13px;
        line-height: 1.35;
    }

    /* logo and phone always share one line on phones */
    .kmd-header__inner {
        flex-wrap: nowrap;
        gap: 12px;
        padding-block: 6px;
    }

    .kmd-header__phone {
        white-space: nowrap;
    }

    .kmd-header__showrooms {
        display: none;
    }

    .kmd-header__phone {
        font-size: 16px;
    }

    .kmd-site-menu__inner,
    .kmd-site-menu__links {
        grid-template-columns: 1fr;
    }
}

/* small phones (375px and less): a bit smaller logo and phone so both still fit next to the menu button */
@media screen and (max-width: 419px) {
    .kmd-header__brand {
        gap: 8px;
    }

    .kmd-header__logo img {
        height: 26px;
    }

    .kmd-header__phone {
        gap: 6px;
        font-size: 15px;
    }

    .kmd-header__phone svg {
        width: 18px;
        height: 18px;
    }
}

@media screen and (max-width: 359px) {
    .kmd-header__logo img {
        height: 22px;
    }

    .kmd-header__phone {
        font-size: 14px;
    }
}

/* NOTE: MINIMAL HEADER (checkout pages: buy, send) */

.kmd-header--minimal .kmd-header__phone {
    gap: 10px;
    font-size: 22px;
    line-height: 1.2;
}

.kmd-header--minimal .kmd-header__phone svg {
    width: 24px;
    height: 24px;
}

@media screen and (max-width: 599px) {
    .kmd-header--minimal .kmd-header__phone {
        gap: 8px;
        font-size: 19px;
    }

    .kmd-header--minimal .kmd-header__phone svg {
        width: 20px;
        height: 20px;
    }
}
