/* ============================================================
   PRODUCT CARD — tokenised overlay for the card rendered by
   woocommerce/loop/content-product.php. Replicates the current
   product-card appearance exactly (values captured from the live
   cascade incl. sheeel-ds !important overrides). Enqueued AFTER
   sheeel-ds so it wins via cascade; the !important brand rules in
   sheeel-ds still apply on top. Global tokens reused where they
   match; non-4px-scale px kept as --pc-* scoped tokens.
   ============================================================ */
:root {
    /* --- Global tokens reused --- */
    /* --color-brand-primary (#4D3F76), --color-brand-primary-light (#6B5B96),
       --color-brand-coral (#E27B7B), --color-danger-strong (#E53935),
       --color-text (#2A2733), --color-text-dark (#333), --color-text-secondary (#666),
       --color-bg-muted (#fafafa), --color-bg-card (#fff), --color-breadcrumb-bg (#f8f9fa),
       --color-border (#D6D0E8), --color-border-light (#eee), --color-radius-lg (16px),
       --color-shadow-sm, --color-shadow-lg, --color-text-inverse (#fff),
       --animation-duration-normal (300ms) */

    /* --- Component-scoped tokens (exact fidelity) --- */
    --pc-badge-radius:   6px;
    --pc-badge-pad:      4px 8px;
    --pc-badge-size:     24px;     /* express */
    --pc-disc-size:      42px;     /* discount */
    --pc-disc-pad:       4px;
    --pc-disc-gap:       2px;
    --pc-disc-line:      1.05;
    --pc-img-pad:        20px;
    --pc-img-minh:       220px;
    --pc-img-maxh:       200px;
    --pc-lowstock-bg:    #ffc107;
    --pc-lowstock-pad:   4px 8px;
    --pc-lowstock-radius: 12px;
    --pc-feature-pad:    4px 8px;
    --pc-feature-radius: 6px;
    --pc-feature-gap:    8px;
    --pc-feature-mb:     8px;
    --pc-feature-stock-bg:    #d4edda;  --pc-feature-stock-text:    #155724;
    --pc-feature-discount-bg: #f8d7da;  --pc-feature-discount-text: #721c24;  /* overridden by sheeel-ds coral */
    --pc-feature-express-bg: #d1ecf1;  --pc-feature-express-text: #0c5460;
    --pc-feature-sold-bg:    #fff3cd;  --pc-feature-sold-text:    #856404;
    --pc-feature-variant-radius: 4px;
    --pc-title-pad:      12px 15px 8px;
    --pc-desc-pad:       0 15px;
    --pc-desc-mb:        10px;
    --pc-price-pad:      15px;
    --pc-pricewrap-gap:  8px;
    --pc-pricewrap-mb:   12px;
    --pc-buy-pad:        12px 20px;
    --pc-buy-radius:     6px;
    --pc-fs-10: 10px;
    --pc-fs-11: 11px;
    --pc-fs-12: 12px;
    --pc-fs-13: 13px;
    --pc-fs-14: 14px;
    --pc-fs-18: 18px;
    --pc-top:   8px;
    --pc-right: 8px;
}

/* Card shell */
.product.type-product,
article.product,
.product-card,
li.product {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--color-radius-lg);
    box-shadow: 0 2px 14px var(--color-shadow-sm);
    overflow: hidden;
    padding: 0 0 12px;
}

.product.type-product:hover,
article.product:hover,
.product-card:hover,
li.product:hover {
    border-color: var(--color-brand-primary);
    box-shadow: 0 8px 28px var(--color-shadow-lg);
}

/* Top Row: Small Circular Icons */
.product-badges {
    position: absolute;
    top: var(--pc-top);
    left: var(--pc-top);
    right: var(--pc-top);
    display: flex;
    justify-content: space-between;
    z-index: 15;
    color: var(--color-text);
}

.express-badge {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    width: var(--pc-badge-size);
    height: var(--pc-badge-size);
    border-radius: var(--pc-badge-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--pc-fs-10);
    font-weight: 600;
    text-transform: uppercase;
}

.discount-badge-top {
    background: var(--color-danger-strong);
    color: var(--color-text-inverse);
    /* Bigger circle so "Save xx%" doesn't get clipped */
    width: var(--pc-disc-size);
    height: var(--pc-disc-size);
    border-radius: var(--pc-badge-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--pc-disc-gap);
    padding: var(--pc-disc-pad);
    font-weight: 600;
    text-transform: none;
    text-align: center;
    line-height: var(--pc-disc-line);
}

.discount-badge-save,
.discount-badge-value {
    display: block;
    width: 100%;
    white-space: nowrap;
    line-height: 1;
}

.discount-badge-save {
    font-size: var(--pc-fs-10);
    font-weight: 600;
}

.discount-badge-value {
    font-size: var(--pc-fs-12);
    font-weight: 700;
}

/* Middle: Product Image - Larger */
.product-image-container {
    position: relative;
    display: block;
    padding: var(--pc-img-pad);
    text-align: center;
    background: var(--color-bg-muted);
    min-height: var(--pc-img-minh);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand-primary-light);
}

.product-image-container img {
    max-width: 100%;
    max-height: var(--pc-img-maxh);
    object-fit: contain;
    transition: transform var(--animation-duration-normal, 0.3s) ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.02);
}

.low-stock-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--pc-lowstock-bg);
    color: var(--color-text-dark);
    padding: var(--pc-lowstock-pad);
    border-radius: var(--pc-lowstock-radius);
    font-size: var(--pc-fs-11);
    font-weight: 600;
}

/* Below Image: Horizontal Badges Row */
.product-features {
    padding: 10px 15px;
    background: var(--color-breadcrumb-bg);
    border-bottom: 1px solid var(--color-border-light);
}

.feature-badges-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--pc-feature-gap);
    margin-bottom: var(--pc-feature-mb);
    flex-wrap: wrap;
}

.feature-badge {
    background: var(--color-brand-coral);
    color: var(--color-text-inverse);
    padding: var(--pc-feature-pad);
    border-radius: var(--pc-feature-radius);
    font-size: var(--pc-fs-11);
    font-weight: 500;
    white-space: nowrap;
}

.feature-badge.stock {
    background: var(--pc-feature-stock-bg);
    color: var(--pc-feature-stock-text);
}

.feature-badge.discount {
    background: var(--pc-feature-discount-bg);
    color: var(--pc-feature-discount-text);
}

.feature-badge.express {
    background: var(--pc-feature-express-bg);
    color: var(--pc-feature-express-text);
}

.feature-badge.sold {
    background: var(--pc-feature-sold-bg);
    color: var(--pc-feature-sold-text);
}

/* Product Title */
.product-title-section {
    padding: var(--pc-title-pad);
}

.product-brand {
    display: block;
    font-size: var(--pc-fs-12);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-name {
    margin: 0;
    font-size: var(--pc-fs-14);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-dark);
}

.product-name a {
    color: var(--color-brand-primary-light);
    text-decoration: none;
    transition: color var(--animation-duration-normal, 0.3s) ease;
}

.product-name a:hover {
    color: var(--color-brand-primary);
}

/* Descriptive Text */
.product-description {
    padding: var(--pc-desc-pad);
    font-size: var(--pc-fs-12);
    color: var(--color-text-secondary);
    line-height: 1.4;
    flex-grow: 1;
    margin-bottom: var(--pc-desc-mb);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price at Bottom */
.product-price-section {
    padding: var(--pc-price-pad);
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: var(--pc-feature-gap);
    margin-bottom: var(--pc-pricewrap-mb);
}

.old-price {
    font-size: var(--pc-fs-13);
    color: var(--color-brand-primary-light);
    text-decoration: line-through;
    font-weight: 400;
}

.special-price {
    font-size: var(--pc-fs-18);
    color: var(--color-brand-primary);
    font-weight: 700;
}

.price-currency {
    font-size: var(--pc-fs-12);
    color: var(--color-text-secondary);
    margin-left: 2px;
}

.buy-button {
    display: block;
    width: 100%;
    padding: var(--pc-buy-pad);
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    text-align: center;
    border-radius: var(--pc-buy-radius);
    font-weight: 600;
    font-size: var(--pc-fs-14);
    text-decoration: none;
    transition: all var(--animation-duration-normal, 0.3s) ease;
    border: none;
    cursor: pointer;
}

.buy-button:hover {
    background: #b91c3c;
    transform: translateY(-1px);
}

.buy-button.out-of-stock {
    background: #6c757d;
    cursor: not-allowed;
}

.buy-button.out-of-stock:hover {
    background: #5a6268;
    transform: none;
}

/* Featured badge (brand plum, per sheeel-ds) */
.featured-badge {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--pc-feature-pad);
    border-radius: var(--pc-feature-radius);
    font-size: var(--pc-fs-11);
    font-weight: 500;
    white-space: nowrap;
}

/* Sold-out badge (pill, brand plum) */
.sold-out-badge {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--color-radius-pill);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}
