/* -----------------------------------------
   TBP PRODUCT CARDS SHORTCODE
   [tbp_product_cards category="..."]
----------------------------------------- */

.tbp-pc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

.tbp-pc-grid *,
.tbp-pc-grid *::before,
.tbp-pc-grid *::after {
    box-sizing: border-box;
}

.tbp-pc-card {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    gap: 20px;
    background: #d9d9d9;
    border-radius: 16px;
    padding: 22px;
    overflow: hidden;
}

/* Image */
.tbp-pc-media {
    min-width: 0;
}

.tbp-pc-media a {
    display: block;
    height: 100%;
}

.tbp-pc-media img,
.tbp-pc-card .tbp-pc-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

/* Content */
.tbp-pc-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 8px 4px 2px 0;
}

.tbp-pc-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.tbp-pc-grid .tbp-pc-title a,
.tbp-pc-grid .tbp-pc-title a:hover,
.tbp-pc-grid .tbp-pc-title a:focus,
.tbp-pc-grid .tbp-pc-title a:visited {
    color: inherit;
    text-decoration: none !important;
    border-bottom: none;
    box-shadow: none;
}

.tbp-pc-title a:hover {
    color: #000000;
}

.tbp-pc-desc {
    margin: 0 0 16px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #3a3a3a;
}

/* Price + cart row pinned to the bottom */
.tbp-pc-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.tbp-pc-price {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

.tbp-pc-price del {
    opacity: 0.55;
    font-weight: 500;
    margin-right: 6px;
}

.tbp-pc-price ins {
    text-decoration: none;
}

.tbp-pc-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.tbp-pc-cart-btn img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.tbp-pc-cart-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.tbp-pc-cart-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

.tbp-pc-cart-btn.added {
    opacity: 1;
}

/* Hide WooCommerce "View cart" link injected after AJAX add */
.tbp-pc-footer .added_to_cart {
    display: none;
}

/* Tablet */
@media (max-width: 900px) {
    .tbp-pc-grid {
        gap: 18px;
    }

    .tbp-pc-card {
        padding: 16px;
        gap: 14px;
    }

    .tbp-pc-media img,
    .tbp-pc-card .tbp-pc-img {
        min-height: 170px;
    }
}

/* Mobile: single column */
@media (max-width: 600px) {
    .tbp-pc-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tbp-pc-card {
        grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
    }

    .tbp-pc-media img,
    .tbp-pc-card .tbp-pc-img {
        min-height: 150px;
    }

    .tbp-pc-title {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .tbp-pc-desc {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .tbp-pc-price {
        font-size: 0.9rem;
    }

    .tbp-pc-cart-btn,
    .tbp-pc-cart-btn img {
        width: 36px;
        height: 36px;
    }
}
