/* ============================================================
   DMTT PRODUCT CARD — CSS DÙNG CHUNG TOÀN SITE
   Phiên bản: 3.0 - 2026-07-09
   (Áp dụng cho: trang shop/danh mục, carousel trang chủ)

   CHANGELOG v3.0:
   - GỠ BỎ toàn bộ CSS layout trang chi tiết sản phẩm (grid ảnh/thông
     tin, ẩn sidebar, .dmtt-box, .price, .dmtt-price-cart-wrapper...)
     vì phần này đã có bản ĐÚNG và MỚI HƠN trong style.css
     (từ file "CSS trang sản phẩm.txt"). Để 2 file cùng !important
     đè lên nhau gây vỡ layout trang sản phẩm (ảnh mô tả).
   - GỠ BỎ rule ẩn sidebar sitewide (.woocommerce-page .sidebar...)
     vì nó ẩn luôn bộ lọc/sidebar ở trang danh mục — chỉ trang chi
     tiết sản phẩm mới cần ẩn sidebar, việc đó style.css đã lo rồi.
   - Nếu cần chỉnh gì cho trang chi tiết sản phẩm, sửa trong
     "CSS trang sản phẩm.txt" (style.css), KHÔNG thêm lại vào đây.
   ============================================================ */

/* ============================================================
   PRODUCT CARD STYLES
   ============================================================ */
.dmtt-product-card {
    list-style: none !important;
}

.dmtt-card-inner {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: border-color 0.2s;
}

.dmtt-card-inner:hover {
    border-color: #aaa;
}

.dmtt-card-inner.is-out {
    opacity: 0.6;
}

.is-out .dmtt-img {
    filter: grayscale(40%);
}

.dmtt-img-wrap {
    position: relative;
    background: none;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dmtt-img {
    width: 100% !important;
    height: 190px !important;
    object-fit: contain !important;
    padding: 6px 4px !important;
}

.dmtt-badge-row {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}

.dmtt-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 0 5px;
    border-radius: 2px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.dmtt-b-new    { background: #E24B4A; color: #fff; }
.dmtt-b-hot    { background: #E24B4A; color: #fff; }
.dmtt-b-out    { background: #888780; color: #fff; }
.dmtt-b-coming { background: #FFD700; color: #1a1a1a; }

.dmtt-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dmtt-brand {
    font-size: 10px;
    font-weight: 500;
    color: #185FA5;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    flex-shrink: 0;
}

.dmtt-name {
    font-size: 14px;
    font-weight: 600;
    color: #3333cc;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 36px;
    flex-shrink: 0;
}

.dmtt-name:hover {
    color: #1f1f7a;
}

.dmtt-divider {
    height: 0.5px;
    background: #e8e8e8;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.dmtt-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    height: 46px;
    overflow: hidden;
    align-content: flex-start;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.dmtt-tag {
    font-size: 10px;
    color: #555;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    border: 0.5px solid #e0e0e0;
    white-space: nowrap;
    height: 20px;
    display: flex;
    align-items: center;
}

.dmtt-price-block {
    flex-shrink: 0;
    margin-bottom: 6px;
}

.dmtt-price-old {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
    flex-shrink: 0;
    display: block;
    margin-bottom: 2px;
}

.dmtt-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dmtt-price-new {
    font-size: 17px;
    font-weight: 500;
    color: #E24B4A;
    line-height: 1.4;
}

.dmtt-badge-pct {
    font-size: 12px;
    font-weight: 500;
    background: #E24B4A;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.dmtt-btn {
    display: block;
    width: 100%;
    padding: 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    margin-top: auto;
    flex-shrink: 0;
    box-sizing: border-box;
    border: none;
}

.dmtt-btn-cart {
    background: #ffc266;
    color: #fff !important;
    transition: background 0.2s;
}

.dmtt-btn-cart:hover {
    background: #ffa31a;
    color: #fff !important;
}

.dmtt-btn-detail {
    background: transparent;
    color: #666 !important;
    border: 0.5px solid #ccc !important;
}

.dmtt-btn-detail:hover {
    border-color: #aaa !important;
    color: #333 !important;
}

/* ============================================================
   PRODUCT CARD - MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .woocommerce ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .woocommerce ul.products li.product,
    .dmtt-product-card {
        width: 100% !important;
        margin: 0 !important;
        float: none !important;
        padding: 0 !important;
    }

    .dmtt-card-inner {
        border-radius: 8px;
    }

    .dmtt-body {
        padding: 8px !important;
    }

    .dmtt-img-wrap {
        height: 150px !important;
    }

    .dmtt-img {
        height: 140px !important;
        padding: 4px !important;
    }

    .dmtt-name {
        font-size: 10px !important;
        -webkit-line-clamp: 2 !important;
        min-height: 30px !important;
        margin-bottom: 4px !important;
    }

    .dmtt-brand {
        font-size: 9px !important;
        margin-bottom: 2px !important;
    }

    .dmtt-divider {
        margin-bottom: 4px !important;
    }

    .dmtt-specs {
        height: 42px !important;
        gap: 2px !important;
        margin-bottom: 5px !important;
    }

    .dmtt-tag {
        font-size: 9px !important;
        padding: 1px 4px !important;
        height: 18px !important;
    }

    .dmtt-price-new {
        font-size: 17px !important;
    }

    .dmtt-badge-pct {
        font-size: 9px !important;
        padding: 0px 2px !important;
    }

    .dmtt-price-block {
        margin-bottom: 4px !important;
    }

    .dmtt-btn-cart {
        font-size: 10px !important;
        padding: 6px 4px !important;
    }
}
