/* ===== Bottom Menu — Modern (chỉ hiển thị ≤ 850px) ===== */
.lk-bottom-menu {
    display: none;
}

@media (max-width: 850px) {
    .lk-bottom-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        width: 100%;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: saturate(180%) blur(16px);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0;
        box-shadow:
            0 -6px 20px rgba(0, 0, 0, 0.10),
            0 -1px 3px rgba(0, 0, 0, 0.05);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        font-family: inherit;
        gap: 2px;
    }
}

.lk-bm-item {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px !important;
    padding: 8px 4px !important;
    margin-bottom: 0;
    margin-right: 0;
    background: transparent;
    border: 0;
    border-radius: 14px;
    text-decoration: none;
    color: #1f2937;
    font-size: 12.5px !important;
    font-weight: 600;
    letter-spacing: 0.1px;
    line-height: 1.25;
    text-align: center;
    transition: color .2s ease, background .2s ease, transform .2s ease;
    text-transform: none;
}

.lk-bm-item:hover,
.lk-bm-item:focus-visible {
    color: #4A80F0;
    background: linear-gradient(180deg, rgba(74, 128, 240, 0.10), rgba(74, 128, 240, 0.02));
    text-decoration: none;
    outline: none;
}

.lk-bm-item:active {
    transform: scale(.94);
}

.lk-bm-item::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(135deg, #4A80F0, #3563D4);
    opacity: 0;
    transition: opacity .2s ease;
}

.lk-bm-item:hover::after,
.lk-bm-item:focus-visible::after {
    opacity: 1;
}

.lk-bm-item .lk-bm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.lk-bm-item:hover .lk-bm-icon {
    box-shadow:
        inset 0 0 0 1px rgba(74, 128, 240, 0.25),
        0 4px 10px rgba(74, 128, 240, 0.30);
    transform: translateY(-1px);
}

.lk-bm-item img {
    object-fit: contain;
    display: block;
    margin: 0;
    opacity: 0.33;
}

.lk-bm-item span {
    display: block;
    white-space: nowrap;
    color: #797979;
    font-weight: 600;
}

.lk-bm-item:hover span,
.lk-bm-item:focus-visible span {
    color: #4A80F0;
}

/* Chừa khoảng trống dưới cùng chỉ khi menu hiển thị */
@media (max-width: 850px) {
    body {
        padding-bottom: 72px !important;
    }
}
body.lk-bm-open {
    overflow: hidden;
}

/* ===== Popup Sheet (slide up from bottom) ===== */
.lk-bm-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 68px; /* dừng tại mép trên của lk-bottom-menu */
    z-index: 9997; /* dưới lk-bottom-menu (9998) → menu luôn nổi lên trên */
    display: none;
}

.lk-bm-popup.is-open {
    display: block;
}

.lk-bm-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .32s ease;
}

.lk-bm-popup.is-open .lk-bm-popup__backdrop {
    opacity: 1;
}

.lk-bm-popup__sheet {
    position: absolute;
    bottom: 0; /* sát mép dưới popup container = ngay trên bottom-menu */
    left: 0;
    right: 0;
    height: 70vh;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform .38s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: 12px;
}

.lk-bm-popup.is-open .lk-bm-popup__sheet {
    transform: translateY(0);
}

/* Drag handle */
.lk-bm-popup__handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: pointer;
}

.lk-bm-popup__handle::before {
    content: '';
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
}

/* Header */
.lk-bm-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 12px;
    border-bottom: 1px solid #f0f2f5;
}

.lk-bm-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.1px;
}

.lk-bm-popup__close {
    width: 32px;
    height: 32px;
    margin: 0;
    background: #e3e3e3;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    flex-shrink: 0;
}

.lk-bm-popup__close:hover {
    background: #4A80F0;
    color: #fff;
    transform: rotate(90deg);
}

/* Grid 3 cột × 2 hàng */
.lk-bm-popup__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px 14px 8px;
}

/* Card */
.lk-bm-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-decoration: none;
    color: #1f2937;
    background: #f8fafc;
    border: 1.5px solid #e8ecf2;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    -webkit-tap-highlight-color: transparent;
}

.lk-bm-card:hover,
.lk-bm-card:active {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(74, 128, 240, 0.18);
    border-color: #4A80F0;
    text-decoration: none;
    color: #1f2937;
}

.lk-bm-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #edf0f4;
    transition: transform .3s ease;
}

.lk-bm-card:hover .lk-bm-card__img {
    transform: scale(1.04);
}

.lk-bm-card__label {
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    padding: 7px 6px 9px;
    line-height: 1.35;
    color: #374151;
    background: #fff;
}

/* ===== Responsive (trong phạm vi ≤ 850px) ===== */
@media (max-width: 480px) {
    .lk-bm-item {
        font-size: 12px !important;
        padding: 6px 2px !important;    }
    .lk-bm-item .lk-bm-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;    }

    @media (max-width: 850px) {
        body {
            padding-bottom: 68px !important;        }
    }
}

@media (min-width: 600px) and (max-width: 850px) {
    .lk-bm-item {
        font-size: 13px;
    }
    .lk-bm-item .lk-bm-icon {
        width: 38px;
        height: 38px;
    }
}
