/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/
.css-postconten h2 {
    font-size: 22px;
}

.css-postconten h3 {
    font-size: 20px;
}

.css-postconten h4 {
    font-size: 18px;
}
.css-tieu-de {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Số dòng muốn hiển thị */
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word; /* Đảm bảo ngắt từ đúng chỗ */
}
/*css giá*/
/* Container chính của giá */
.css-item-sp .css-gia-sp {
    display: block; /* Chuyển về block để .price chiếm toàn hàng */
}

/* Cấu trúc bên trong thẻ price của WooCommerce */
.css-item-sp .css-gia-sp .price {
    display: flex;
    flex-direction: row; /* Nằm trên một hàng */
    align-items: baseline; /* Giúp chân các con số thẳng hàng nhau */
    gap: 8px; /* Khoảng cách giữa giá mới và giá cũ */
}

/* Giá cũ (đã giảm) */
.css-item-sp .css-gia-sp .price del {
    order: 2; /* Đứng sau giá mới */
    font-size: 13px !important;
    color: #82869e !important;
    font-weight: 400 !important;
    text-decoration: line-through;
}

/* Giá mới (giá đang bán) */
.css-item-sp .css-gia-sp .price ins,
.css-item-sp .css-gia-sp .price > .amount:not(del .amount) {
    order: 1; /* Đứng trước */
    font-size: 16px !important;
    color: #0038ae !important; /* Màu xanh đậm như ảnh bạn gửi */
    font-weight: 700 !important;
    text-decoration: none;
}

/* Xóa bỏ các margin mặc định của WooCommerce nếu có */
.css-item-sp .css-gia-sp .price ins, 
.css-item-sp .css-gia-sp .price del {
    display: inline-block;
}
/*css add sp*/
/* Container chứa ảnh và nút cần có relative */
.brxe-cnpydd.brxe-block {
    position: relative;
    overflow: hidden; /* Để nút không bị tràn ra ngoài khi đang ẩn ở dưới */
}

/* Trạng thái bình thường: Ẩn và nằm dưới đáy ảnh */
.css-button-add {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    
    opacity: 0;
    visibility: hidden;
    /* Đẩy nút xuống hẳn bên dưới (100%) để khi hiện nó trượt lên */
    transform: translateY(100%); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Khi hover vào item: Hiện lên và trượt về vị trí cũ */
.css-item-sp:hover .css-button-add {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Trượt lên hiển thị */
}

/* Tùy chỉnh thêm cho nút (nếu cần) */
.css-button-add a {
    width: 100%;
    border-radius: 0; /* Làm nút vuông vức khớp với khung ảnh */
    background-color: rgba(0, 56, 174, 0.9); /* Màu xanh đồng bộ với giá tiền */
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
}

/* =============================================
   CONTAINER CHÍNH & GIÁ CẢ
   ============================================= */
.css-box-gia {
    display: flex;
    align-items: center;
    gap: 12px;
}

.css-gia-ach-producs .price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Giá hiện tại */
.css-gia-ach-producs .price ins, 
.css-gia-ach-producs .price > .amount:last-child,
.css-gia-ach-producs .price > :not(del).amount {
    order: 1; 
    text-decoration: none;
    color: var(--color-blue-2);
    font-size: 28px; 
    font-weight: 600;
}

.css-gia-ach-producs .price .amount .woocommerce-Price-currencySymbol {
    text-decoration: underline;
    font-size: 0.65em;
    vertical-align: super;
    margin-left: 3px;
}

/* Giá gốc */
.css-gia-ach-producs .price del {
    order: 2;
    color: #929292;
    font-size: 16px;
    text-decoration: line-through;
}

/* Badge giảm giá */
.css-sale .badge.onsale {
    background-color: color-mix(in srgb, var(--color-blue-2), transparent 92%);
    color: var(--color-blue-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--color-blue-2), transparent 85%);
}

/* =============================================
   PHẦN MUA HÀNG (QUANTITY & BUTTONS)
   ============================================= */
#brxe-ryqnpz.css-add .cart {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 15px 10px !important;
}

/* --- Hàng 1: Số lượng (Đã thu nhỏ) --- */
#brxe-ryqnpz.css-add .quantity {
    flex: 0 0 100% !important;
    display: flex !important;
    align-items: center !important;
}

#brxe-ryqnpz.css-add .quantity::before {
    content: "Số Lượng";
    margin-right: 15px;
    color: #757575;
    font-size: 15px;
    white-space: nowrap;
}

#brxe-ryqnpz.css-add .quantity input.qty {
    width: 55px !important; /* Độ rộng nhỏ gọn */
    height: 38px !important;
    border: 1px solid #ddd !important;
    border-left: none !important;
    border-right: none !important;
    text-align: center !important;
    color: var(--color-blue-2) !important;
    font-weight: 600;
    flex: none !important; 
    padding: 0 !important;
}

#brxe-ryqnpz.css-add .quantity .action {
    width: 38px !important;
    height: 38px !important;
    border: 1px solid #ddd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    color: var(--color-blue-2) !important;
    cursor: pointer;
}

#brxe-ryqnpz.css-add .quantity .action.minus { border-radius: 4px 0 0 4px !important; }
#brxe-ryqnpz.css-add .quantity .action.plus { border-radius: 0 4px 4px 0 !important; }

/* --- Hàng 2: Hai nút bấm --- */
#brxe-ryqnpz.css-add .single_add_to_cart_button,
#brxe-ryqnpz.css-add .buy_now_button {
    height: 48px !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
    flex: 1; /* Hai nút tự chia đều hàng ngang */
}

/* Nút Thêm vào giỏ */
#brxe-ryqnpz.css-add .single_add_to_cart_button {
    background-color: color-mix(in srgb, var(--color-blue-2), transparent 92%) !important;
    border: 1.5px solid var(--color-blue-2) !important;
    color: var(--color-blue-2) !important;
    min-width: 160px;
}

/* Nút Mua ngay */
#brxe-ryqnpz.css-add .buy_now_button {
    background-color: var(--color-blue-2) !important;
    color: #fff !important;
    border: 1.5px solid var(--color-blue-2) !important;
    min-width: 140px;
}

#brxe-ryqnpz.css-add .buy_now_button:hover {
    filter: brightness(0.9);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #brxe-ryqnpz.css-add .single_add_to_cart_button,
    #brxe-ryqnpz.css-add .buy_now_button {
        flex: 0 0 100% !important;
    }
}

/* Ẩn thông báo thêm hàng thành công */
.woocommerce-message {
    display: none !important;
}

/* Hoặc nếu bạn muốn chỉ ẩn riêng ở trang cửa hàng/sản phẩm mà không ảnh hưởng trang Giỏ hàng */
.single-product .woocommerce-message,
.archive .woocommerce-message {
    display: none !important;
}
/* Ẩn liên kết "Xem giỏ hàng" xuất hiện sau khi bấm Thêm vào giỏ */
.added_to_cart.wc-forward {
    display: none !important;
}
/*css giỏ hàng*/
