/**
 * Blessed Store — stock-awareness overlay.
 * Adds badges/disabled states on top of the existing .bm-card / Shopee-style
 * theme (views/store/_theme.php) without touching its base rules. Linked
 * from views/store/index.php and views/store/product.php.
 */

/* Out-of-stock replaces the ribbon slot (top-left) outright — an item that
   cannot be bought should never also wear a "Best Seller"/"Top Rated" badge. */
.bm-card.bm-outofstock .ribbon { display: none; }
.ribbon.stock-out {
    background: var(--kapistahan-red, #DC2626);
    color: #fff;
}

/* Low-stock gets its own slot (top-right), so it never fights the existing
   Best Seller / Top Rated ribbon for the same corner. */
.stock-low {
    position: absolute;
    top: 10px;
    right: 0;
    z-index: 3;
    background: rgba(255, 193, 7, .16);
    color: var(--accent-gold, #FFC107);
    border: 1px solid rgba(255, 193, 7, .45);
    font-size: .62rem;
    font-weight: 800;
    padding: 3px 9px 3px 10px;
    border-radius: 4px 0 0 4px;
    letter-spacing: .3px;
    white-space: nowrap;
}

/* Sold-out cards stay in the grid but visually sink — dimmed photo, muted
   name — so the eye lands on buyable stock first without hiding anything. */
.bm-card.bm-outofstock .imgwrap img,
.bm-card.bm-outofstock .imgwrap .ph { opacity: .45; filter: grayscale(.4); }
.bm-card.bm-outofstock .nm { color: var(--text-muted); }

.bm-card .addform button[disabled] {
    opacity: .5;
    cursor: not-allowed;
    border-color: var(--bm-line, rgba(255, 255, 255, .12));
    color: var(--text-muted);
}
.bm-card .addform button[disabled]:hover { background: transparent; color: var(--text-muted); }

/* Product detail page: stock line + disabled add-to-cart */
.bm-stockline { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; margin-top: .65rem; }
.bm-stockline.out { color: var(--kapistahan-red, #DC2626); }
.bm-stockline.low { color: var(--accent-gold, #FFC107); }
.bm-stockline.in  { color: var(--damayan-green, #16A34A); }

.btn.bm-soldout-btn { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }

/* "In stock only" toggle on /store */
.bm-instock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-muted);
    margin: -2px 0 1rem;
    cursor: pointer;
    user-select: none;
}
.bm-instock-toggle input { accent-color: var(--accent-gold, #FFC107); width: 14px; height: 14px; cursor: pointer; }

/* Cart / checkout: inline "your cart changed" notice + per-line stock chip */
.bm-stock-notice {
    background: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .35);
    color: #FCA5A5;
    border-radius: var(--border-radius-sm, .5rem);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    line-height: 1.55;
}
.bm-stock-notice ul { margin: .35rem 0 0 1.1rem; padding: 0; }

.bm-line-stock {
    display: inline-block;
    margin-top: 4px;
    font-size: .66rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}
.bm-line-stock.low { background: rgba(255, 193, 7, .14); color: var(--accent-gold, #FFC107); }
.bm-line-stock.out { background: rgba(220, 38, 38, .16); color: #F87171; }
