/* ==========================================================
   BOLSAdeal Menu Sheet
   components/menu-sheet/menu-sheet.css
   ========================================================== */

.bd-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    padding: 0;

    background: rgba(0, 0, 0, 0.46);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;
}

.bd-menu-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bd-menu-sheet {
    width: 100%;
    max-width: 700px;
    max-height: 90dvh;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: 22px 22px 0 0;

    background: #ffffff;

    box-shadow:
        0 -12px 40px rgba(0, 0, 0, 0.2);

    transform: translateY(100%);

    transition:
        transform 0.25s ease;
}

.bd-menu-overlay.open .bd-menu-sheet {
    transform: translateY(0);
}

/* Drag handle */

.bd-menu-handle {
    width: 52px;
    height: 5px;

    flex: 0 0 auto;

    margin: 10px auto 4px;

    border-radius: 999px;

    background: #cfd3d8;
}

/* Header */

.bd-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    flex: 0 0 auto;

    padding: 12px 16px 14px;

    border-bottom: 1px solid #e7e9ec;

    background: #ffffff;
}

.bd-menu-header h2 {
    margin: 0;

    color: #17191d;

    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

.bd-menu-header button {
    width: 42px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    padding: 0;

    border: 0;
    border-radius: 50%;

    color: #17191d;

    background: #f1f3f5;

    cursor: pointer;

    font-size: 21px;
    line-height: 1;

    transition:
        background 0.16s ease,
        transform 0.16s ease;
}

.bd-menu-header button:hover {
    background: #e4e7eb;
}

.bd-menu-header button:active {
    transform: scale(0.94);
}

/* Body */

.bd-menu-body {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding:
        8px
        14px
        calc(22px + env(safe-area-inset-bottom));

    background: #ffffff;
}

/* Menu item */

.bd-menu-item {
    min-height: 58px;

    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 26px;
    align-items: center;

    gap: 12px;

    padding: 8px 4px;

    border-bottom: 1px solid #eceef1;

    color: #17191d;

    text-decoration: none;

    -webkit-tap-highlight-color: transparent;
}

.bd-menu-item:last-child {
    border-bottom: 0;
}

.bd-menu-item:active {
    background: #f7f8fa;
}

/* Icon */

.bd-menu-icon {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: #ef3340;

    background: #fff0f1;
}

.bd-menu-icon svg {
    width: 22px;
    height: 22px;

    display: block;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Text */

.bd-menu-text {
    min-width: 0;

    overflow: hidden;

    color: #17191d;

    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Arrow */

.bd-menu-arrow {
    width: 26px;
    height: 26px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #98a0aa;
}

.bd-menu-arrow svg {
    width: 19px;
    height: 19px;

    display: block;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Divider */

.bd-menu-divider {
    height: 9px;

    margin: 8px -14px;

    border-top: 1px solid #eceef1;
    border-bottom: 1px solid #eceef1;

    background: #f5f6f8;
}

/* Focus */

.bd-menu-item:focus-visible,
.bd-menu-header button:focus-visible {
    outline: 3px solid rgba(239, 51, 64, 0.22);
    outline-offset: 2px;
}

/* Desktop/tablet */

@media (min-width: 701px) {
    .bd-menu-overlay {
        padding: 24px;
    }

    .bd-menu-sheet {
        max-width: 520px;

        border-radius: 22px;

        transform: translateY(40px);
    }

    .bd-menu-overlay.open .bd-menu-sheet {
        transform: translateY(0);
    }
}

/* Small mobile */

@media (max-width: 430px) {
    .bd-menu-sheet {
        max-height: 92dvh;

        border-radius: 20px 20px 0 0;
    }

    .bd-menu-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bd-menu-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .bd-menu-item {
        grid-template-columns: 40px minmax(0, 1fr) 24px;

        gap: 10px;

        min-height: 56px;
    }

    .bd-menu-icon {
        width: 38px;
        height: 38px;

        border-radius: 11px;
    }

    .bd-menu-text {
        font-size: 14px;
    }

    .bd-menu-divider {
        margin-left: -12px;
        margin-right: -12px;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
    .bd-menu-overlay,
    .bd-menu-sheet,
    .bd-menu-header button {
        transition: none;
    }
}