@media (min-width: 768px) {
    .row.large-columns-4 > .col,
    .large-columns-4 > .col,
    .medium-columns-3.large-columns-4 > .col,
    .large-columns-4.medium-columns-3 > .col,
    .row-cols-4 > .col,
    .large-block-grid-4 > .col,
    .columns-4 > .col {
        max-width: 25% !important;
        flex-basis: 25% !important;
        width: 25% !important;
        flex: 0 0 25% !important;
        min-width: 0 !important;
    }
    .large-columns-3 > .col,
    .row.large-columns-3 > .col {
        max-width: 33.333333% !important;
        flex-basis: 33.333333% !important;
        width: 33.333333% !important;
        flex: 0 0 33.333333% !important;
        min-width: 0 !important;
    }
    .large-columns-2 > .col,
    .row.large-columns-2 > .col {
        max-width: 50% !important;
        flex-basis: 50% !important;
        width: 50% !important;
        flex: 0 0 50% !important;
        min-width: 0 !important;
    }
}

.row > .col {
    min-width: 0 !important;
}

.custom-product-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
    color: inherit !important;
    box-sizing: border-box;
    min-width: 0;
}

.custom-product-card {
    position: relative !important;
    overflow: hidden !important;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef0f2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.custom-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.09);
}

/* Image container: Tỷ lệ ảnh chuẩn 16:10 đồng đều cho mọi card */
.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 65%;
    overflow: hidden;
    background: #f8fafc;
}
.product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s ease;
}
.custom-product-card:hover .product-image-container img {
    transform: scale(1.04);
}

/* Corner Ribbon cố định chuẩn 45 độ */
.corner-ribbon-wrapper {
    width: 90px;
    height: 90px;
    overflow: hidden;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9;
    pointer-events: none;
}
.corner-ribbon-wrapper .hot-deal-ribbon {
    position: absolute;
    display: block;
    width: 130px;
    padding: 0;
    top: 20px;
    right: -32px;
    transform: rotate(45deg);
    text-align: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    box-sizing: border-box;
}

/* Container thông tin: Hiệu ứng nổi 3D (3D Floating Raised Panel) */
.product-info-container {
    position: relative;
    z-index: 2;
    margin: -16px 8px 8px 8px;
    padding: 12px 6px 12px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 
        0 10px 22px -4px rgba(0, 0, 0, 0.08),
        0 4px 8px -2px rgba(0, 0, 0, 0.04),
        0 -2px 6px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
    min-width: 0;
}
.custom-product-card:hover .product-info-container {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 30px -4px rgba(0, 0, 0, 0.12),
        0 6px 12px -2px rgba(0, 0, 0, 0.05),
        0 -3px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* Hàng 1: Icon text Căn hộ & Tên sản phẩm cùng 1 hàng */
.product-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 2px 0 6px;
    width: 100%;
    flex-wrap: nowrap;
    box-sizing: border-box;
    min-width: 0;
}
.product-property-type {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 600;
    color: #0284c7;
    white-space: nowrap;
    flex-shrink: 0;
}
.product-property-type .material-icons {
    font-size: 15px;
    color: #0284c7;
    vertical-align: middle;
}
.product-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    line-height: 1.2;
    min-width: 0;
}

/* Hàng 2: Phòng ngủ, WC, Diện tích cùng 1 hàng */
.product-details-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px 0 15px;
    width: 100%;
    flex-wrap: nowrap;
    box-sizing: border-box;
    min-width: 0;
}
.product-info-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
    flex-shrink: 0;
}
.product-info-item .material-icons {
    font-size: 14px;
    color: #2563eb;
    vertical-align: middle;
}

/* SĐT chỉ hiển thị cho Admin / Người dùng đã đăng nhập */
.product-contact-container {
    margin-bottom: 6px;
}
.product-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #a7f3d0;
}
.product-phone-btn .material-icons {
    font-size: 13px;
    color: #059669;
}

/* Giá to hơn + Hiệu ứng lõm đục lỗ (Inset / Debossed Effect) */
@keyframes priceRecessedGlow {
    0%, 100% {
        box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.12), inset -2px -2px 5px rgba(255, 255, 255, 0.9);
    }
    50% {
        box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.16), inset -2px -2px 6px rgba(255, 255, 255, 1), 0 0 8px rgba(170, 30, 46, 0.12);
    }
}
.product-price-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.12), inset -2px -2px 5px rgba(255, 255, 255, 0.9);
    animation: priceRecessedGlow 3s infinite ease-in-out;
    margin-top: 2px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.custom-product-card:hover .product-price-container {
    background: #e9ecef;
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.18), inset -2px -2px 6px rgba(255, 255, 255, 0.95);
}
.product-price-container .woocommerce-Price-amount {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #aa1e2e !important;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 📱 TỐI ƯU TRÊN DI ĐỘNG & TABLET (DƯỚI 768px): CHUẨN 1 CỘT TOÀN MÀN HÌNH */
@media (max-width: 767px) {
    .row > .col,
    .row.large-columns-4 > .col,
    .large-columns-4 > .col,
    .medium-columns-3 > .col,
    .medium-columns-2 > .col,
    .small-columns-2 > .col,
    .small-columns-1 > .col,
    .products > .col {
        max-width: 100% !important;
        flex-basis: 100% !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 auto 16px auto !important;
    }
    .custom-product-card {
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    .product-info-container {
        margin: -12px 8px 8px 8px !important;
        padding: 10px 8px 12px !important;
    }
    .product-title {
        font-size: 13.5px !important;
    }
    .product-property-type {
        font-size: 11.5px !important;
    }
    .product-property-type .material-icons {
        font-size: 13px !important;
    }
    .product-details-custom {
        gap: 8px !important;
        margin: 6px 0 10px !important;
    }
    .product-info-item {
        font-size: 11.5px !important;
        gap: 3px !important;
    }
    .product-info-item .material-icons {
        font-size: 14px !important;
    }
    .product-price-container {
        padding: 4px 14px !important;
    }
    .product-price-container .woocommerce-Price-amount {
        font-size: 16px !important;
    }
}
