/* CSS hoàn chỉnh cho giao diện lưới và slider */
.fbt-section-container {
    margin-top: 30px;
}

.fbt-section-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 23px;
    color: #000;
}

.fbt-main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* === PHẦN GIAO DIỆN SẢN PHẨM === */
.fbt-products-visual {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

/* Kiểu dáng chung cho thẻ sản phẩm */
.fbt-product-card {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.fbt-card-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 15px;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease;
    height: 100%;
}
.fbt-product-card:hover .fbt-card-link {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fbt-card-image {
    width: 80px;
    flex-shrink: 0;
}
.fbt-card-image img {
    max-width: 100%;
    height: auto;
}

.fbt-card-details {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.fbt-details-main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    justify-content: flex-start;
}

.fbt-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fbt-card-description {
    font-size: 11px;
    line-height: 1.5;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.fbt-card-price {
    font-size: 11px;
    font-weight: 600;
    color: #d90429;
    margin-top: auto;
    padding-top: 5px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.fbt-card-price .woocommerce-Price-amount {
    display: inline;
    line-height: 1.3;
}
.fbt-card-price del {
    opacity: 1;
    color: #000;
    order: 1;
}
.fbt-card-price ins {
    order: 2;
    text-decoration: none;
}


/* === ĐỊNH DẠNG CHO SLIDER === */
.fbt-slider.swiper {
    padding: 5px 0;
}
.swiper-slide {
    height: auto;
    display: flex;
}
.swiper-slide .fbt-product-card {
    width: 100%;
}

/* === NÚT ĐIỀU HƯỚNG === */
.fbt-products-visual .swiper-button-next,
.fbt-products-visual .swiper-button-prev {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    color: #000;
    transition: all 0.2s ease-out;
    top: 50%;
    transform: translateY(-50%);
}

.fbt-products-visual .swiper-button-prev {
    left: 10px;
}

.fbt-products-visual .swiper-button-next {
    right: 10px;
}

.fbt-products-visual .swiper-button-next:after,
.fbt-products-visual .swiper-button-prev:after {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
}
.fbt-products-visual .swiper-button-prev:after {
    content: '‹';
    padding-right: 2px;
}
.fbt-products-visual .swiper-button-next:after {
    content: '›';
    padding-left: 2px;
}

.fbt-products-visual .swiper-button-next:hover,
.fbt-products-visual .swiper-button-prev:hover {
    background-color: #f8f8f8;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.fbt-products-visual .swiper-button-next.swiper-button-disabled,
.fbt-products-visual .swiper-button-prev.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}


/* === PHẦN CHECKLIST VÀ THÊM VÀO GIỎ HÀNG === */
.fbt-products-selection {
    width: 100%;
    border: 1px solid #f0f0f0;
    background-color: #fafafa;
    padding: 20px;
    border-radius: 8px;
}
.fbt-checklist-item { padding: 5px 0; }

.fbt-checklist-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #000;
}

/* Chuyển màu nút tích đã chọn sang màu đỏ */
.fbt-product-checkbox,
.fbt-checklist-item input[type="checkbox"] {
    accent-color: #d90429;
}

.fbt-summary { padding-top: 15px; border-top: 1px dashed #e0e0e0; }

.fbt-total-price {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #000;
}

/* Định dạng lại nút thêm vào giỏ hàng */
.fbt-add-to-cart-button {
    background-color: #d90429 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 30px !important; /* [THAY ĐỔI] Tăng giá trị để bo tròn nhiều hơn */
    width: 100%;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    transition: background-color 0.3s ease !important;
}

.fbt-add-to-cart-button:hover {
    background-color: #b80021 !important;
}


.fbt-add-to-cart .button.loading::after { content: ""; display: block; width: 1em; height: 1em; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; position: absolute; top: 50%; left: 50%; margin-top: -0.5em; margin-left: -0.5em; }
@keyframes spin { to { transform: rotate(360deg); } }
.fbt-message { margin-top: 10px; font-size: 14px; padding: 8px 12px; border-radius: 4px; display: inline-block; }
.fbt-message.success { color: #2e7d32; background-color: #e8f5e9; border: 1px solid #a5d6a7; }
.fbt-message.error { color: #c62828; background-color: #ffebee; border: 1px solid #ef9a9a; }


/* === [SỬA LỖI] Bổ sung responsive cho di động === */
@media screen and (max-width: 768px) {
    .fbt-section-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* === [BỔ SUNG] Tối ưu hiển thị tên sản phẩm trên di động === */
@media screen and (max-width: 767px) {
    /* Áp dụng cho tên sản phẩm trong danh sách checklist */
    .fbt-checklist-item label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%; /* Đảm bảo label chiếm đủ không gian để tính toán overflow */
    }

    /* Quy tắc cho tên sản phẩm trong slider đã có sẵn ở trên, 
       nhưng chúng ta thêm lại ở đây để đảm bảo nó được áp dụng chắc chắn trên mobile. */
    .fbt-card-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}