/*
    MerchStudio version 0.01 - Core File
    Copyright (c) 2026 MerchStudio Inc.
    Builder Menu (MERCH_CSF1): the site menu on the gang sheet and sticker
    builders, a Menu button in the builder header and a panel from the left.
    @version     tpl/core/client/css/builder_menu.css - 0.01 - 11-24-2026 - merchstudio (MERCH_CSF1)
    @version     tpl/core/client/css/builder_menu.css - 0.02 - 11-24-2026 - merchstudio (MERCH_CSF1B: every menu link looks the same, the site's link colour no longer applies)
*/

.bm_button {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    height: 38px;
    min-width: 38px;
    margin-right: 14px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.bm_button:hover,
.bm_button[aria-expanded="true"] {
    border-color: var(--highlight);
    color: var(--highlight);
}
.bm_button .merch_icon {
    width: 20px;
    height: 20px;
}

.bm_backdrop {
    position: fixed;
    inset: 0;
    /* Above the builder, which is fixed at 9999 on phones. */
    z-index: 100000;
    background: rgba(0, 0, 0, 0.4);
}
.bm_backdrop[hidden] {
    display: none;
}

.bm_panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    width: min(320px, 86vw);
    background: var(--bg);
    color: var(--text);
    border-right: 1px solid var(--line);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    visibility: hidden;
}
.bm_panel.open {
    transform: translateX(0);
    visibility: visible;
}
.bm_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 0 12px 0 18px;
    border-bottom: 1px solid var(--line);
}
.bm_logo {
    display: flex;
    align-items: center;
    min-width: 0;
}
.bm_logo svg,
.bm_logo img {
    display: block;
    max-width: 100%;
    max-height: 34px;
    width: auto;
    height: auto;
}
.bm_close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.bm_close:hover {
    background: var(--hover);
}
.bm_close .merch_icon {
    width: 20px;
    height: 20px;
}

.bm_list {
    flex: 1 1 auto;
    margin: 0;
    padding: 8px 0 24px;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.bm_list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.bm_link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.bm_link:hover,
.bm_sublink:hover,
a.bm_heading:hover {
    background: var(--hover);
    color: var(--highlight);
}
.bm_link .merch_icon {
    width: 18px;
    height: 18px;
}
.bm_toggle {
    justify-content: space-between;
    list-style: none;
}
.bm_toggle::-webkit-details-marker {
    display: none;
}
.bm_toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}
.bm_group[open] > .bm_toggle::after {
    transform: rotate(-135deg);
}
.bm_sub {
    padding: 0 0 8px;
}
.bm_heading {
    display: block;
    padding: 10px 18px 4px 30px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.7;
    text-decoration: none;
}
.bm_sublink {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 18px 0 30px;
    color: var(--text);
    text-decoration: none;
}

body.bm_open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .bm_button {
        height: 36px;
        min-width: 36px;
        margin-right: 8px;
        padding: 0;
    }
    .bm_button .bm_button_text {
        display: none;
    }
}

/* Gang sheet builder on small phones: the header was already full, so the
   Menu button takes the logo's place (the panel carries the logo and
   Home), and the right side gives up a little spacing and the greeting. */
@media (max-width: 768px) {
    .gang_sheet_app .app_header .header_left {
        flex: 0 0 auto;
    }
    .gang_sheet_app .app_header .header_right {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }
}
@media (max-width: 480px) {
    .gang_sheet_app .app_header .app_logo_holder {
        display: none;
    }
    .gang_sheet_app .app_header .bm_button {
        margin-right: 0;
    }
    .gang_sheet_app .app_header .header_right {
        gap: 6px;
    }
    .gang_sheet_app .app_header .price_display {
        margin-right: 0;
    }
    .gang_sheet_app .app_header .head_label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bm_panel {
        transition: none;
    }
}

/* MERCH_CSF1B: the storefront's link colour and underline (a, a:link)
   reached the plain links but not the drop down labels. */
.bm_panel a.bm_link,
.bm_panel a.bm_link:link,
.bm_panel a.bm_link:visited,
.bm_panel a.bm_sublink,
.bm_panel a.bm_sublink:link,
.bm_panel a.bm_sublink:visited,
.bm_panel a.bm_heading {
    color: var(--text);
    text-decoration: none;
}
.bm_panel a.bm_link:hover,
.bm_panel a.bm_sublink:hover,
.bm_panel a.bm_heading:hover {
    color: var(--highlight);
}
