
/* GRID */
.cwgw-custom-woo-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--cwgw-columns), 1fr);
    gap: 20px;
    align-items: stretch !important;
}

/* THẺ SẢN PHẨM */
.cwgw-custom-woo-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #f0f0f0;
    height: 100% !important;
}

.cwgw-custom-woo-card .product-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ============================================================== */
/* VŨ KHÍ TỐI THƯỢNG MỚI: THE ACTION AREA */
/* ============================================================== */
.cwgw-custom-woo-card .product-info {
    padding: 15px; 
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

/* Khu vực Nút bấm + Biến thể sẽ tự động trôi xuống kịch đáy */
.cwgw-action-area {
    margin-top: auto; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* ============================================================== */

/* TIÊU ĐỀ & MÔ TẢ */
.cwgw-custom-woo-card .product-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #0b2447;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cwgw-custom-woo-card .product-title a {
    color: inherit;
    text-decoration: none;
}

.cwgw-custom-woo-card .product-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ĐÁNH GIÁ */
.cwgw-custom-woo-card .product-rating-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    color: #f5b91b;
}
.cwgw-star-rating {
    position: relative;
    display: inline-block;
    font-size: 15px;
    color: #d3ced2;
    line-height: 1;
    letter-spacing: 2px;
}
.cwgw-star-rating::before { content: '\2605\2605\2605\2605\2605'; }
.cwgw-star-rating-fill {
    position: absolute;
    top: 0;
    left: 0;
    color: #f5b91b;
    overflow: hidden;
    white-space: nowrap;
}
.cwgw-star-rating-fill::before { content: '\2605\2605\2605\2605\2605'; }
.cwgw-custom-woo-card .rating-count { font-size: 13px; color: #777; margin-left: 3px;}

/* GIÁ */
.cwgw-custom-woo-card .product-price {
    font-size: 16px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap; 
}
.cwgw-custom-woo-card .product-price del {
    color: #999;
    font-weight: normal;
    margin-right: 5px;
    font-size: 14px;
}

/* BIẾN THỂ FORM */
.cwgw-variations-wrap {
    margin-bottom: 10px;
}
.cwgw-attr-row {
    margin-bottom: 0;
}
.cwgw-select-attr {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: #f9f9f9;
    color: #333;
    outline: none;
    transition: 0.3s;
}
.cwgw-select-attr:focus {
    border-color: #145c36;
}

/* NÚT BẤM */
.cwgw-custom-woo-card .product-actions {
    margin-top: 0; 
}

.cwgw-custom-woo-card .btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    color: #fff !important;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.3s ease;
}
.cwgw-custom-woo-card .btn-add-to-cart {
    text-transform: none;
    background-color: #145c36;
}
.cwgw-custom-woo-card .btn-buy-now {
    background-color: #e51a2d;
    margin-bottom: 0 !important; 
}
.cwgw-custom-woo-card .btn:hover {
    opacity: 0.85;
}

/* PHÂN TRANG */
.cwgw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    width: 100%;
}
.cwgw-pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}
.cwgw-pagination .page-numbers:hover,
.cwgw-pagination .page-numbers.current {
    background-color: #145c36;
    color: #fff;
    border-color: #145c36;
}
.cwgw-pagination .page-numbers.next,
.cwgw-pagination .page-numbers.prev {
    width: auto;
    padding: 0 15px;
}

/* ========================================= */
/* FIX MOBILE */
/* ========================================= */
@media (max-width: 1024px) {
    .cwgw-custom-woo-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 767px) {
    .cwgw-custom-woo-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 8px !important; 
    }
    
    .cwgw-custom-woo-card .product-info { padding: 8px !important; }
    
    .cwgw-custom-woo-card .product-title { 
        font-size: 13px !important; 
        margin-bottom: 6px !important;
    }
    
    .cwgw-custom-woo-card .product-excerpt { 
        font-size: 11px !important; 
        margin-bottom: 8px !important;
        -webkit-line-clamp: 2 !important; 
    }
    
    .cwgw-custom-woo-card .product-price {
        font-size: 13px !important;
        margin-bottom: 10px !important;
        flex-wrap: wrap; 
        word-break: break-word;
    }
    
    .cwgw-custom-woo-card .btn {
        font-size: 11px !important;
        padding: 7px 4px !important; 
        white-space: nowrap !important; 
        letter-spacing: -0.3px !important; 
        margin-bottom: 6px !important;
    }
    
    .cwgw-select-attr { padding: 5px 6px !important; font-size: 11px !important; }
    .cwgw-star-rating { font-size: 11px !important; }
    .cwgw-custom-woo-card .rating-count { font-size: 10px !important; }
}

.cwgw-sort-bar { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.cwgw-sort-bar label { margin:0; }
.cwgw-sort-bar .cwgw-orderby { width:auto; max-width:100%; padding:8px 12px; border:1px solid #145c36; border-radius:8px; background:#fff; color:#0b2447; font:inherit; }
.cwgw-filter-region[aria-busy="true"] { opacity:0.6; pointer-events:none; }
