/*
 * Brand Store — product card + grid. Loaded on the front page and WooCommerce pages.
 * Token-only: every value comes from var(--bs-*).
 */
.bs-product-grid {
	display: grid;
	gap: 36px 16px;
	grid-template-columns: repeat(var(--bs-grid-columns-mobile), minmax(0, 1fr));
}
@media (min-width: 768px) { .bs-product-grid { grid-template-columns: repeat(min(3, var(--bs-grid-columns)), minmax(0, 1fr)); gap: 40px 20px; } }
@media (min-width: 1100px) { .bs-product-grid { grid-template-columns: repeat(var(--bs-grid-columns), minmax(0, 1fr)); } }

.bs-product-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bs-product-card__media {
	position: relative; overflow: hidden; margin-bottom: 8px;
	aspect-ratio: var(--bs-image-ratio); border-radius: var(--bs-radius-card); background: var(--bs-color-card-bg);
}
.bs-product-card__media > a:not(.bs-product-card__add) { display: block; height: 100%; }
.bs-product-card__img,
.bs-product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.bs-product-card:hover .bs-product-card__img { transform: scale(1.03); }

.bs-badge {
	position: absolute; top: 12px; left: 12px; z-index: 1;
	padding: 5px 10px; border-radius: calc(var(--bs-radius-button) * 0.66);
	background: var(--bs-color-bg); color: var(--bs-color-ink);
	font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}

.bs-product-card__add,
.bs-product-card__soldout {
	position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1;
	display: flex; align-items: center; justify-content: center; min-height: 44px;
	border-radius: var(--bs-radius-button);
	font-family: var(--bs-font-button); font-size: var(--bs-small); font-weight: var(--bs-button-weight); text-decoration: none;
}
.bs-product-card__add { background: color-mix(in srgb, var(--bs-color-bg) 94%, transparent); color: var(--bs-color-ink); transition: background-color 0.15s ease, color 0.15s ease; }
.bs-product-card__add:hover { background: var(--bs-color-button-bg); color: var(--bs-color-button-text); }
.bs-product-card__add.loading { opacity: 0.7; pointer-events: none; }
.bs-product-card__add.added { background: var(--bs-color-success); color: var(--bs-color-button-text); }
.bs-product-card__add.added::after { content: " ✓"; }
.bs-product-card .added_to_cart { display: none; } /* WooCommerce's "View cart" link — the header bag updates instead. */
.bs-product-card__soldout { background: var(--bs-color-surface); color: var(--bs-color-muted); }
.is-out-of-stock .bs-product-card__img { opacity: 0.6; }

/* On large screens, the quick-add button appears on hover/focus; always visible on touch. */
@media (hover: hover) and (min-width: 1024px) {
	.bs-product-card__add { opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease; }
	.bs-product-card:hover .bs-product-card__add,
	.bs-product-card__add:focus-visible,
	.bs-product-card__add.added { opacity: 1; transform: none; }
}

.bs-product-card__meta { font-size: 12px; font-weight: 600; color: var(--bs-color-muted); }
.bs-product-card__title { font-family: var(--bs-font-body); font-size: var(--bs-font-size-base); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.bs-product-card__title a { text-decoration: none; color: var(--bs-color-ink); }
.bs-product-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; } /* Whole card clickable. */
.bs-product-card__add, .bs-product-card__media > a:not(.bs-product-card__add) { position: relative; z-index: 1; }
.bs-product-card__add { position: absolute; }
.bs-product-card__price { font-weight: 800; color: var(--bs-color-ink); }
.bs-product-card__price del { font-weight: 500; color: var(--bs-color-muted); margin-right: 6px; }
.bs-product-card__price ins { text-decoration: none; }

.bs-rating { font-size: 13px; color: var(--bs-color-text); }
.bs-rating__stars { color: var(--bs-color-accent); }
.bs-rating__count { color: var(--bs-color-muted); }

/* Shop loop uses a real <ul>/<li> list (WooCommerce's item markup); reset list styling. */
ul.bs-shop__grid { list-style: none; margin: 0; padding: 0; }
ul.bs-shop__grid > li { margin: 0; padding: 0; }

/* WooCommerce's layout CSS floats product lists and adds clearfix boxes; neutralise it for our grid. */
.woocommerce ul.bs-product-grid,
.woocommerce-page ul.bs-product-grid { clear: none; margin: 0; padding: 0; list-style: none; }
.woocommerce ul.bs-product-grid::before,
.woocommerce ul.bs-product-grid::after,
.woocommerce-page ul.bs-product-grid::before,
.woocommerce-page ul.bs-product-grid::after { content: none; display: none; }
.woocommerce ul.bs-product-grid li.product,
.woocommerce-page ul.bs-product-grid li.product { float: none; clear: none; width: auto; margin: 0; padding: 0; }
.woocommerce .related, .woocommerce .up-sells, .woocommerce .cross-sells,
.woocommerce-page .related, .woocommerce-page .up-sells, .woocommerce-page .cross-sells { float: none; width: 100%; }

/* WooCommerce's `li.product a img` rule sets height:auto and a bottom margin, which leaves a white strip under the photo
   and pushes the quick-add overlay out of place. Restate the card image rules with equal weight. */
.woocommerce ul.bs-product-grid li.product .bs-product-card__media > a:not(.bs-product-card__add) { display: block; height: 100%; margin: 0; }
.woocommerce ul.bs-product-grid li.product .bs-product-card__media img { width: 100%; height: 100%; margin: 0; object-fit: cover; box-shadow: none; }
.woocommerce ul.bs-product-grid li.product .bs-product-card__media a.bs-product-card__add,
.woocommerce ul.bs-product-grid li.product .bs-product-card__media .bs-product-card__soldout {
	position: absolute; inset: auto 10px 10px 10px; margin: 0; width: auto; height: auto; min-height: 44px; padding: 0 12px; box-sizing: border-box;
}
.woocommerce ul.bs-product-grid li.product .bs-badge { margin: 0; }

/* Quick add: keep the label centred in the button */
.woocommerce ul.bs-product-grid li.product .bs-product-card__media a.bs-product-card__add { display: flex; align-items: center; justify-content: center; line-height: 1.1; text-align: center; }

/* ---------- Image frames: the card photo is pinned to the frame (never stretches the card) ---------- */
.bs-product-card__media { position: relative; overflow: hidden; }
.bs-product-card__media img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
