/**
 * ZT Mobile Bottom Menu Stylesheet
 * Developed by ZERO TECHNOLOGY
 */

/* Ẩn hoàn toàn thanh menu cố định cũ của Shofy */
#tp-bottom-menu-sticky {
    display: none !important;
}

/* Ẩn trên máy tính / Desktop màn hình lớn */
@media (min-width: 992px) {
    .zt-mobile-bottom-bar {
        display: none !important;
    }
}

/* Hiển thị trên màn hình Mobile & Tablet dưới 992px */
@media (max-width: 991.98px) {
    /* Đẩy đáy body lên tránh bị che nội dung */
    body.zt-has-bottom-bar {
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    }
    body.zt-has-bottom-bar-floating {
        padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Thanh điều hướng cố định dưới đáy */
    .zt-mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 998;
        width: 100%;
        background-color: var(--zt-bg-color, #ffffff);
        box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        user-select: none;
    }

    /* Tự động ẩn khi cuộn xuống */
    .zt-mobile-bottom-bar.zt-is-hidden {
        transform: translateY(125%);
    }

    .zt-bottom-nav-container {
        display: flex;
        align-items: center;
        justify-content: space-around;
        height: 60px;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 4px;
        position: relative;
    }

    /* Mỗi nút trong menu */
    .zt-nav-item {
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        text-decoration: none;
        color: var(--zt-text-color, #55585b);
        background: transparent;
        border: none;
        outline: none;
        padding: 4px 2px;
        margin: 0;
        cursor: pointer;
        position: relative;
        transition: color 0.2s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .zt-nav-item:active {
        transform: scale(0.92);
    }

    .zt-nav-item:hover,
    .zt-nav-item.active {
        color: var(--zt-active-color, #0989ff);
    }

    /* Khung icon */
    .zt-nav-icon-wrapper {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        margin-bottom: 2px;
        width: 26px;
        height: 26px;
    }

    .zt-nav-item svg,
    .zt-nav-item i {
        font-size: var(--zt-icon-size, 20px);
        width: var(--zt-icon-size, 20px);
        height: var(--zt-icon-size, 20px);
        stroke-width: 1.8;
        display: inline-block;
        transition: transform 0.2s ease;
    }

    .zt-nav-item img.menu-icon-image {
        max-width: var(--zt-icon-size, 20px);
        max-height: var(--zt-icon-size, 20px);
        object-fit: contain;
    }

    /* Nhãn chữ dưới icon */
    .zt-nav-label {
        display: block;
        font-size: var(--zt-font-size, 11px);
        font-weight: 500;
        line-height: 1.2;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0 2px;
    }

    /* Chế độ chỉ hiện icon */
    .zt-hide-label .zt-nav-label {
        display: none !important;
    }
    .zt-hide-label .zt-nav-icon-wrapper {
        margin-bottom: 0;
    }

    /* Huy hiệu số lượng (Badge Giỏ hàng / Wishlist) */
    .zt-nav-badge {
        position: absolute;
        top: -4px;
        right: -8px;
        background: #ff3b30;
        color: #ffffff;
        font-size: 10px;
        font-weight: 700;
        min-width: 17px;
        height: 17px;
        line-height: 17px;
        padding: 0 4px;
        border-radius: 10px;
        text-align: center;
        box-shadow: 0 2px 5px rgba(255, 59, 48, 0.4);
        border: 1.5px solid #ffffff;
        pointer-events: none;
        font-family: system-ui, -apple-system, sans-serif;
    }

    .zt-nav-badge:empty,
    .zt-nav-badge[data-count="0"] {
        display: none;
    }

    /* === PHONG CÁCH 1: Nổi bật nút ở giữa (Center Action Button) === */
    .zt-nav-item.is-center-item {
        flex: 0 0 54px;
        height: 54px;
        margin-top: -24px;
        border-radius: 50%;
        background: var(--zt-active-color, #0989ff);
        color: #ffffff !important;
        box-shadow: 0 6px 18px rgba(9, 137, 255, 0.4);
        border: 3px solid #ffffff;
        padding: 0;
        z-index: 2;
    }

    .zt-nav-item.is-center-item .zt-nav-icon-wrapper {
        margin-bottom: 0;
        width: 30px;
        height: 30px;
    }

    .zt-nav-item.is-center-item svg,
    .zt-nav-item.is-center-item i {
        color: #ffffff !important;
        font-size: calc(var(--zt-icon-size, 20px) + 3px);
        width: calc(var(--zt-icon-size, 20px) + 3px);
        height: calc(var(--zt-icon-size, 20px) + 3px);
    }

    .zt-nav-item.is-center-item .zt-nav-label {
        display: none;
    }

    .zt-nav-item.is-center-item:active {
        transform: scale(0.9) translateY(2px);
    }

    /* === PHONG CÁCH 2: Dạng Dock nổi bo tròn (Floating Dock) === */
    .zt-style-floating {
        bottom: 12px;
        left: 14px;
        right: 14px;
        width: calc(100% - 28px);
        max-width: 480px;
        margin: 0 auto;
        border-radius: 35px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        padding-bottom: 0;
    }

    .zt-style-floating .zt-bottom-nav-container {
        height: 56px;
        padding: 0 8px;
    }

    .zt-style-floating .zt-nav-item.is-center-item {
        margin-top: -20px;
    }

    /* === PHONG CÁCH 3: Viền cong lượn mềm mại (Curved Soft) === */
    .zt-style-curved {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }
}

