/**
 * CoinGate Sync - Product Catalog CSS
 * Style cho shortcode [coingate_products]
 * v1.3 - Out of stock full-width banner overlay
 */

.cgs-catalog {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.cgs-catalog-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Header: bộ đếm sản phẩm tự nhiên */
.cgs-catalog-header {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}
.cgs-catalog-header .cgs-count {
    display: inline-block;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 14px;
    margin-right: 2px;
}

.cgs-catalog-grid {
    display: grid;
    grid-template-columns: repeat(var(--cgs-columns, 5), 1fr);
    gap: 20px;
}

.cgs-catalog-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cgs-catalog-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Item hết hàng: viền xám nhạt */
.cgs-catalog-item.cgs-out-of-stock {
    border-color: #ddd;
    opacity: 0.85;
}

.cgs-catalog-item.cgs-out-of-stock:hover {
    transform: none;
    box-shadow: none;
}

.cgs-catalog-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

/* ------ Image area ------ */
.cgs-catalog-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cgs-catalog-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Ảnh hết hàng: làm mờ nhẹ */
.cgs-catalog-image.cgs-oos-image img {
    filter: grayscale(40%) brightness(0.9) blur(1px);
}

.cgs-catalog-no-img {
    font-size: 48px;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ------ Out of Stock Banner: kẻ ngang giữa ảnh ------ */
.cgs-oos-banner {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 10px 12px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ------ Body ------ */
.cgs-catalog-body {
    padding: 10px 12px 12px;
}

.cgs-catalog-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px 0;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cgs-catalog-price {
    font-size: 14px;
    font-weight: 700;
    color: #c00;
}

.cgs-catalog-price .woocommerce-Price-amount {
    font-weight: 700;
}

.cgs-catalog-price del .woocommerce-Price-amount {
    font-weight: 400;
}

.cgs-catalog-price ins {
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .cgs-catalog-grid {
        --cgs-columns: 4 !important;
    }
}

@media (max-width: 992px) {
    .cgs-catalog-grid {
        --cgs-columns: 3 !important;
    }
}

@media (max-width: 768px) {
    .cgs-catalog-grid {
        --cgs-columns: 2 !important;
    }
}

@media (max-width: 480px) {
    .cgs-catalog-grid {
        --cgs-columns: 1 !important;
    }
}
