/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.1.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

/* Tùy biến nút icon tròn sang nền viền xám */
.button.icon.circle {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.button.icon.circle:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

/* --- Tùy biến Nút Mua Hàng & Thêm Giỏ Hàng Fullwidth (Novis Fullwidth CTA - Product Summary) --- */
.product-info form.cart,
.summary.entry-summary form.cart,
.product-summary form.cart,
.single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px !important;
}

/* HÀNG TRÊN: Ô số lượng (cố định gọn gàng) */
.product-info form.cart .quantity,
.summary.entry-summary form.cart .quantity,
.product-summary form.cart .quantity {
    display: inline-flex !important;
    flex: 0 0 120px !important;
    width: 120px !important;
    height: 46px !important;
    margin: 0 !important;
}

.product-info form.cart .quantity .button,
.summary.entry-summary form.cart .quantity .button,
.product-summary form.cart .quantity .button {
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 46px !important;
    line-height: 46px !important;
    padding: 0 !important;
    text-align: center !important;
}

.product-info form.cart .quantity input.qty,
.summary.entry-summary form.cart .quantity input.qty,
.product-summary form.cart .quantity input.qty {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 46px !important;
    line-height: 46px !important;
    text-align: center !important;
}

/* HÀNG TRÊN: Nút Thêm Vào Giỏ Hàng chiếm trọn vẹn toàn bộ phần còn lại (Fullwidth hàng 1) */
.product-info form.cart .single_add_to_cart_button,
.summary.entry-summary form.cart .single_add_to_cart_button,
.product-summary form.cart .single_add_to_cart_button {
    flex: 1 1 calc(100% - 130px) !important;
    min-width: 160px !important;
    height: 46px !important;
    line-height: 46px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    background-color: #3b4252 !important;
    border: 1px solid #3b4252 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
}

.product-info form.cart .single_add_to_cart_button:hover,
.summary.entry-summary form.cart .single_add_to_cart_button:hover,
.product-summary form.cart .single_add_to_cart_button:hover {
    background-color: #2e3440 !important;
    border-color: #2e3440 !important;
}

/* HÀNG DƯỚI: Nút Mua Hàng chiếm 100% toàn bộ chiều ngang (Fullwidth hàng 2) */
.product-info form.cart .ux-buy-now-button,
.summary.entry-summary form.cart .ux-buy-now-button,
.product-summary form.cart .ux-buy-now-button {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    margin: 4px 0 0 0 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    background: #FF6F38 !important;
    border: 1px solid #FF6F38 !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(255, 111, 56, 0.25) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
}

.product-info form.cart .ux-buy-now-button:hover,
.summary.entry-summary form.cart .ux-buy-now-button:hover,
.product-summary form.cart .ux-buy-now-button:hover {
    background-color: #e55c27 !important;
    border-color: #e55c27 !important;
    box-shadow: 0 6px 16px rgba(255, 111, 56, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* Text chính & Text phụ bên trong nút Mua Hàng */
.ux-buy-now-button .buy-main-text {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
}

.ux-buy-now-button .buy-sub-text {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    line-height: 1.3 !important;
    margin-top: 2px !important;
    opacity: 0.95 !important;
}

/* --- TÙY BIẾN THANH GHIM (STICKY ADD TO CART) --- */
.sticky-add-to-cart--active {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    padding: 6px 16px !important;
    z-index: 9999 !important;
}

.sticky-add-to-cart__product {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 0 !important;
}

.sticky-add-to-cart__product .sticky-add-to-cart-img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 4px !important;
    object-fit: cover !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
}

.sticky-add-to-cart__product .product-title-small {
    margin: 0 !important;
    max-width: 320px !important;
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
    color: #1e293b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Form mua hàng trong Sticky Bar: Nằm ngang 1 dòng cân đối */
.sticky-add-to-cart form.cart {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ô số lượng trong Sticky Bar */
.sticky-add-to-cart form.cart .quantity {
    display: inline-flex !important;
    flex: 0 0 100px !important;
    width: 100px !important;
    height: 42px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.sticky-add-to-cart form.cart .quantity .button {
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 !important;
    text-align: center !important;
}

.sticky-add-to-cart form.cart .quantity input.qty {
    flex: 1 1 auto !important;
    width: 40px !important;
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 !important;
    text-align: center !important;
}

/* 1. Bỏ nút "Thêm vào giỏ hàng" trong Sticky Add to Cart */
.sticky-add-to-cart form.cart .single_add_to_cart_button {
    display: none !important;
}

/* 2. Nút "Mua hàng" thay vị trí vào hàng ngang cạnh ô số lượng */
.sticky-add-to-cart form.cart .ux-buy-now-button {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 180px !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 3px 18px !important;
    border-radius: 4px !important;
    background: #FF6F38 !important;
    border: 1px solid #FF6F38 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(255, 111, 56, 0.25) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
}

.sticky-add-to-cart form.cart .ux-buy-now-button:hover {
    background-color: #e55c27 !important;
    border-color: #e55c27 !important;
    box-shadow: 0 4px 12px rgba(255, 111, 56, 0.35) !important;
    transform: translateY(-1px) !important;
}

.sticky-add-to-cart form.cart .ux-buy-now-button .buy-main-text {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    line-height: 1.15 !important;
}

.sticky-add-to-cart form.cart .ux-buy-now-button .buy-sub-text {
    font-size: 0.72rem !important;
    font-weight: 400 !important;
    text-transform: none !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
    opacity: 0.95 !important;
}

/* --- Khối Thông Số Kỹ Thuật Sản Phẩm (Novis Specs) --- */
.novis-product-specs-container {
    margin: 20px 0;
    padding: 0;
}

.novis-specs-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0d5cb6;
    display: inline-block;
    color: #1a202c;
}

/* Định dạng bảng thông số kỹ thuật chuẩn chuyên nghiệp */
.novis-specs-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.novis-specs-content table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.novis-specs-content table th,
.novis-specs-content table td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    vertical-align: top;
    color: #4a5568;
}

.novis-specs-content table th {
    background-color: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    text-align: left;
}

/* Cột tiêu đề thông số (Cột 1) */
.novis-specs-content table td:first-child {
    font-weight: 600;
    color: #2d3748;
    background-color: #f8fafc;
    width: 35%;
    white-space: normal;
}

/* Hiệu ứng sọc (Zebra striping) */
.novis-specs-content table tbody tr:nth-child(even) td:last-child {
    background-color: #fcfdfe;
}

.novis-specs-content table tbody tr:hover td {
    background-color: #f1f7fe;
    transition: background-color 0.2s ease;
}

/* Danh sách gạch đầu dòng nếu người dùng không nhập bảng */
.novis-specs-content ul {
    margin: 12px 0 20px 20px;
    list-style-type: disc;
}

.novis-specs-content ul li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #4a5568;
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/

    /* Mobile: Hàng trên số lượng + thêm giỏ hàng trong Product Summary */
    .product-info form.cart .quantity,
    .summary.entry-summary form.cart .quantity,
    .product-summary form.cart .quantity {
        flex: 0 0 105px !important;
        width: 105px !important;
        height: 44px !important;
    }

    .product-info form.cart .quantity .button,
    .summary.entry-summary form.cart .quantity .button,
    .product-summary form.cart .quantity .button {
        flex: 0 0 32px !important;
        width: 32px !important;
        height: 44px !important;
        line-height: 44px !important;
    }

    .product-info form.cart .quantity input.qty,
    .summary.entry-summary form.cart .quantity input.qty,
    .product-summary form.cart .quantity input.qty {
        height: 44px !important;
        line-height: 44px !important;
    }

    .product-info form.cart .single_add_to_cart_button,
    .summary.entry-summary form.cart .single_add_to_cart_button,
    .product-summary form.cart .single_add_to_cart_button {
        flex: 1 1 calc(100% - 115px) !important;
        height: 44px !important;
        line-height: 44px !important;
        font-size: 0.82rem !important;
        padding: 0 10px !important;
    }

    .product-info form.cart .ux-buy-now-button,
    .summary.entry-summary form.cart .ux-buy-now-button,
    .product-summary form.cart .ux-buy-now-button {
        min-height: 50px !important;
        padding: 8px 12px !important;
    }

    .ux-buy-now-button .buy-main-text {
        font-size: 0.95rem !important;
    }

    .ux-buy-now-button .buy-sub-text {
        font-size: 0.78rem !important;
    }

    /* Sticky Bar Responsive Mobile */
    .sticky-add-to-cart--active {
        padding: 6px 10px !important;
    }

    .sticky-add-to-cart__product {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    .sticky-add-to-cart__product .sticky-add-to-cart-img {
        width: 40px !important;
        height: 40px !important;
    }

    .sticky-add-to-cart form.cart {
        flex: 1 1 auto !important;
        gap: 6px !important;
    }

    .sticky-add-to-cart form.cart .quantity {
        flex: 0 0 88px !important;
        width: 88px !important;
        height: 40px !important;
    }

    .sticky-add-to-cart form.cart .quantity .button {
        flex: 0 0 26px !important;
        width: 26px !important;
        height: 40px !important;
        line-height: 40px !important;
    }

    .sticky-add-to-cart form.cart .quantity input.qty {
        height: 40px !important;
        line-height: 40px !important;
    }

    .sticky-add-to-cart form.cart .ux-buy-now-button {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 3px 8px !important;
    }

    .sticky-add-to-cart form.cart .ux-buy-now-button .buy-main-text {
        font-size: 0.85rem !important;
    }

    .sticky-add-to-cart form.cart .ux-buy-now-button .buy-sub-text {
        font-size: 0.68rem !important;
    }

    .novis-specs-heading {
        font-size: 1.1rem;
    }

    .novis-specs-content table td:first-child {
        width: 40%;
        font-size: 0.88rem;
        padding: 10px 12px;
    }

    .novis-specs-content table td:last-child {
        font-size: 0.88rem;
        padding: 10px 12px;
    }
}