/* =====================================================
   TSV - Mobile: Popup mô tả ngắn sản phẩm
   Mobile gọn: nút mở thấp hơn, popup thấp hơn,
   nội dung không sát mép và tự cuộn khi dài
===================================================== */

/* Desktop: ẩn nút mở popup và overlay */
.tsv-mobile-desc-open,
.tsv-mobile-desc-overlay {
    display: none;
}

/* Mobile */
@media only screen and (max-width: 768px) {

    /* Ẩn mô tả dài gốc trên mobile */
    .single-product .summary .product-short-description {
        display: none !important;
    }

    /* Nút mở popup: Thông tin sản phẩm */
    .single-product .summary .tsv-mobile-desc-open {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        width: 100% !important;
        height: 26px !important;
        min-height: 26px !important;
        margin: 8px 0 12px 0 !important;
        padding: 0 13px !important;

        border: 1px solid #e7f0fc !important;
        border-radius: 3px !important;
        background: #f7f9fc !important;
        color: #1f2d3d !important;

        font-size: 13.5px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        text-align: left !important;
        text-transform: none !important;

        box-shadow: none !important;
    }

    .single-product .summary .tsv-mobile-desc-open span {
        font-size: 25px !important;
        line-height: 1 !important;
        color: #7a8aa0 !important;
    }

    /* Khóa cuộn nền khi mở popup */
    html.tsv-mobile-desc-lock,
    body.tsv-mobile-desc-lock {
        overflow: hidden !important;
    }

    /* Nền tối phía sau popup */
    .tsv-mobile-desc-overlay {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;

        display: none !important;
        align-items: flex-end !important;
        justify-content: center !important;

        background: rgba(0, 0, 0, 0.46) !important;
        z-index: 99999 !important;
    }

    .tsv-mobile-desc-overlay.is-open {
        display: flex !important;
    }

    /* Khung popup dưới */
    .tsv-mobile-desc-sheet {
        width: 100% !important;
        max-height: 56vh !important;

        background: #ffffff !important;
        border-radius: 17px 17px 0 0 !important;
        overflow: hidden !important;

        box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.18) !important;
        transform: translateY(0) !important;
    }

    /* Header popup */
    .tsv-mobile-desc-head {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        height: 46px !important;
        min-height: 46px !important;
        padding: 0 12px 0 16px !important;

        border-bottom: 1px solid #edf1f6 !important;
        background: #ffffff !important;
    }

    .tsv-mobile-desc-head strong {
        color: #1f2d3d !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }

    /* Nút đóng popup */
    .tsv-mobile-desc-close {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        padding: 0 !important;
        margin: 0 !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border: none !important;
        border-radius: 50% !important;
        background: transparent !important;
        color: #6b7280 !important;

        font-size: 23px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        text-transform: none !important;

        box-shadow: none !important;
    }

    .tsv-mobile-desc-close:hover,
    .tsv-mobile-desc-close:active {
        background: #f2f4f7 !important;
        color: #111827 !important;
    }

    /* Nội dung popup: có khoảng cách mép và tự cuộn khi dài */
    .tsv-mobile-desc-body {
        max-height: calc(56vh - 46px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;

        padding: 14px 18px 20px 18px !important;

        color: #2b1a1a !important;
        font-size: 14px !important;
        line-height: 1.65 !important;
        text-align: left !important;

        scrollbar-width: thin;
        scrollbar-color: #c5cbd3 #f1f1f1;
    }

    .tsv-mobile-desc-body p {
        margin: 0 0 8px 0 !important;
    }

    .tsv-mobile-desc-body p:last-child {
        margin-bottom: 0 !important;
    }

    .tsv-mobile-desc-body br {
        line-height: 1.65 !important;
    }

    /* Thanh cuộn Chrome / Edge */
    .tsv-mobile-desc-body::-webkit-scrollbar {
        width: 5px;
    }

    .tsv-mobile-desc-body::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .tsv-mobile-desc-body::-webkit-scrollbar-thumb {
        background: #c5cbd3;
        border-radius: 10px;
    }

    .tsv-mobile-desc-body::-webkit-scrollbar-thumb:hover {
        background: #9ba6b2;
    }
}