/* ==========================================================================
   Mobile menu - drawer
   Markup: templates/headers/includes/_mobile-menu.template.html
   Behaviour: js/mobile-menu.js
   ========================================================================== */

.mobile-menu {
    --mobile-menu-orange: #fa5617;
    --mobile-menu-ink: #253044;
    --mobile-menu-muted: #7e8795;
    --mobile-menu-line: #eceff2;

    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;

    display: flex;
    flex-direction: column;

    width: 320px;
    max-width: 85%;

    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1099;

    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

body.mobile-menu-is-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

/* Stops the page behind the drawer scrolling with it. */
body.mobile-menu-is-open {
    overflow: hidden;
}


/* Header and footer - fixed, the same on every panel
   ========================================================================== */

.mobile-menu-header {
    display: grid;
    grid-template-columns: 1fr 50px;
    align-items: center;
    height: 64px;
    padding: 0 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
}

.mobile-menu-close {
    padding: 0;
    background: transparent;
    border: 0;
    color: #525d6d;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}


/* Search box - positioned between header and menu body
   ========================================================================== */

.mobile-menu-search {
    padding: 12px 12px;
    border-bottom: 1px solid var(--mobile-menu-line);
}

.mobile-menu-search-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: #f5f6f8;
    border: 1px solid var(--mobile-menu-line);
    border-radius: 4px;
    color: var(--mobile-menu-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: left;
}

.mobile-menu-search-toggle:active {
    background: #eaeced;
    color: var(--mobile-menu-ink);
}

.mobile-menu-search-toggle i {
    font-size: 16px;
    flex-shrink: 0;
}


.mobile-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    background: #263347;
    color: #fff;
    font-size: 13px;
}

.mobile-menu-footer-phone {
    color: #ffb18d;
    font-weight: 700;
    text-decoration: none;
}

.mobile-menu-footer-phone:hover {
    color: #ffb18d;
}


/* Panels - only one visible at a time, the body is the only thing that scrolls
   ========================================================================== */

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
}

.mobile-menu-panel {
    display: none;
}

.mobile-menu-panel.is-active {
    display: block;
}

.mobile-menu-label {
    margin: 0;
    padding: 15px 15px 8px;
    color: #7b8492;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}


/* Top level rows - icon, content, arrow
   ========================================================================== */

.mobile-menu-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 58px;
    padding: 0 12px;
    background: #fff;
    border: 0;
    border-top: 1px solid var(--mobile-menu-line);
    color: var(--mobile-menu-ink);
    text-align: left;
    text-decoration: none;
}

.mobile-menu-row:hover {
    background: #fff8f4;
    color: var(--mobile-menu-ink);
    text-decoration: none;
}

.mobile-menu-row-content {
    flex: 1;
    overflow: hidden;
}

.mobile-menu-row.kx-featured {
    color: var(--mobile-menu-orange);
}

/* Circle sized so the rows line up. Stays empty - just the background colour -
   until an advert image is set for that item, see
   templates/thumbs/advert/mobile-menu-icon.template.html. */
.mobile-menu-row-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff1ea;
    color: var(--mobile-menu-orange);
    flex-shrink: 0;
    overflow: hidden;
}

.mobile-menu-row-icon-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.mobile-menu-row-title {
    display: block;
    font-size: 16px;
}

.mobile-menu-row-subtitle {
    display: block;
    margin-top: 2px;
    color: var(--mobile-menu-muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The subtitle is the list of group names, separated by a dot. */
.mobile-menu-row-group:not(:last-child):after {
    content: " \2022 ";
}

.mobile-menu-row-arrow {
    color: #8b94a2;
    font-size: 22px;
    text-align: right;
}


/* Temporary - only rows that open another panel show a forward arrow. Direct
   links keep the markup, it is just hidden. Delete this whole block to bring
   every arrow back. */
.mobile-menu-row-arrow,
.mobile-menu-link-arrow {
    display: none;
}

.mobile-menu-has-panel .mobile-menu-row-arrow,
.mobile-menu-has-panel .mobile-menu-link-arrow {
    display: inline-block;
}


/* Back row - doubles as the heading of every panel below the first
   ========================================================================== */

.mobile-menu-back {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    width: 100%;
    height: 54px;
    padding: 0 11px;
    background: #f5f6f8;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    cursor: pointer;
}

.mobile-menu-back .fa {
    font-size: 25px;
}

.mobile-menu-back b {
    font-size: 16px;
}


/* Deeper level rows - name and arrow only. One rule for every level below the
   first, so a row reads the same however deep the menu goes.
   ========================================================================== */

.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 0 17px;
    background: #fbfbfc;
    border: 0;
    border-bottom: 1px solid var(--mobile-menu-line);
    color: #283448;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

/* Takes the space the arrow does not, so long names wrap instead of pushing it. */
.mobile-menu-link span:first-of-type {
    flex: 1;
}

.mobile-menu-link:hover {
    background: #fff8f4;
    text-decoration: none;
    color: #283448;
}

/* Shop All, the only way to reach the top level category page itself. */
.mobile-menu-link-all {
    color: var(--mobile-menu-orange);
    font-weight: 700;
}

.mobile-menu-link-all:hover {
    color: var(--mobile-menu-orange);
}

.mobile-menu-link-arrow {
    color: #8992a0;
    font-size: 20px;
}


/* Footer info - contact, footer menu, hours, social. Appended to the end of
   the root panel, below the category list.
   ========================================================================== */

.mobile-menu-info {
    border-top: 8px solid var(--mobile-menu-line);
}

.mobile-menu-info-contact {
    display: flex;
    flex-direction: column;
}

.mobile-menu-info-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 15px;
    border-bottom: 1px solid var(--mobile-menu-line);
    color: var(--mobile-menu-ink);
    font-size: 14px;
    text-decoration: none;
}

.mobile-menu-info-contact-item:hover {
    color: var(--mobile-menu-ink);
    text-decoration: none;
}

.mobile-menu-info-contact-item i {
    width: 16px;
    color: var(--mobile-menu-orange);
    text-align: center;
}

.mobile-menu-info-hours {
    margin: 0;
    padding: 0 15px 15px;
    list-style: none;
}

.mobile-menu-info-hours li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    color: var(--mobile-menu-muted);
    font-size: 13px;
}

.mobile-menu-info-social {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 5px 15px 20px;
    list-style: none;
}

.mobile-menu-info-social img {
    width: 24px;
    height: 24px;
}

/* Source icon is white, invisible against this panel's background. */
.mobile-menu-info-social-instagram {
    filter: brightness(0);
}


/* Breakpoint - mobile only, the desktop mega menu takes over above this
   ========================================================================== */

@media (min-width: 992px) {
    .mobile-menu,
    .mobile-menu-overlay {
        display: none;
    }
}
