/**
 * WC Custom Product Display - Frontend Styles
 */

/* 1. Bố cục lưới sản phẩm (Product Grid Styling) */
.woocommerce ul.products li.product, 
.woocommerce-page ul.products li.product {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px !important;
}

.woocommerce ul.products li.product:hover, 
.woocommerce-page ul.products li.product:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    border-color: #e0e0e0;
}

/* Cố định khung ảnh - Đảm bảo hàng luôn đều */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    flex-grow: 1;
}

.woocommerce ul.products li.product img {
    border-radius: 8px;
    margin-bottom: 12px;
    width: 100%;
    aspect-ratio: 1 / 1; /* Cố định tỉ lệ 1:1 giúp các hình đều nhau */
    object-fit: cover;
    transition: transform 0.5s ease;
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

/* Tiêu đề sản phẩm - Cân đều hàng bằng cách giới hạn dòng */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 2.8em; /* Cao tối đa 2 dòng */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
}

/* Nút thêm vào giỏ hàng bám đáy và đẹp hơn */
.woocommerce ul.products li.product .button {
    margin-top: 10px;
    text-align: center;
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9); /* Màu xanh chuyên nghiệp */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 15px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(41, 128, 185, 0.2);
}

.woocommerce ul.products li.product .button:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    box-shadow: 0 6px 15px rgba(41, 128, 185, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

/* 2. Nhãn giảm giá (Discount Badge) - Kiểu Tag hiện đại */
.z-all-wcpd-badge {
    position: absolute;
    top: 15px;
    right: 15px; /* Chuyển sang bên phải cho cân đối */
    left: auto;
    background: #e74c3c;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px; /* Bo tròn kiểu viên thuốc */
    font-weight: 700;
    font-size: 12px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
}

/* 3. Thanh tiến trình (Progress Bar) */
.z-all-wcpd-progress-wrap {
    margin-bottom: 12px;
}

.z-all-wcpd-progress-bar {
    background-color: #f1f1f1;
    border-radius: 6px;
    height: 6px; /* Mỏng hơn cho thanh lịch */
    width: 100%;
    overflow: hidden;
    margin-bottom: 6px;
    position: relative;
}

.z-all-wcpd-progress-fill {
    background: linear-gradient(90deg, #ff9f43, #ff6b6b);
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-in-out;
}

.z-all-wcpd-progress-text {
    font-size: 11px;
    color: #888;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Fix WooCommerce price style */
.woocommerce ul.products li.product .price {
    color: #d35400;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    display: block;
}

.woocommerce ul.products li.product .price del {
    color: #999;
    font-size: 14px;
    margin-right: 5px;
    font-weight: normal;
}

.woocommerce ul.products li.product .price ins {
    text-decoration: none;
}
