/* ==========================================================================
   Product grid + product card (all WooCommerce loops & Elementor Products widget)
   ========================================================================== */
.woocommerce ul.products,
.elementor-widget-woocommerce-products ul.products,
.elementor-element ul.products.elementor-grid {
	display: grid !important;
	grid-template-columns: repeat(var(--bv-cols, 4), minmax(0, 1fr));
	gap: 28px 22px;
	margin: 0 0 40px;
	padding: 0;
}

.woocommerce ul.products.columns-3 { --bv-cols: 3; }
.woocommerce ul.products.columns-5 { --bv-cols: 5; }

.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none !important; }

.woocommerce ul.products li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left;
}

/* ---------- Card ---------- */
.bv-card {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	border-radius: var(--bv-radius);
	background: var(--bv-surface);
	box-shadow: 0 1px 0 rgba(10, 20, 51, .04), 0 8px 24px -16px rgba(10, 20, 51, .2);
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0));
	transition: transform .5s var(--bv-ease), box-shadow .5s var(--bv-ease);
	will-change: transform;
}

.bv-card:hover {
	--lift: -8px;
	box-shadow: 0 0 0 1.5px rgba(44, 99, 255, .55), 0 30px 60px -24px rgba(44, 99, 255, .55);
}

.bv-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	border-radius: var(--bv-radius) var(--bv-radius) 0 0;
	background: linear-gradient(160deg, #eef3ff, #dfe8fb);
}

.bv-card__img-link { position: absolute; inset: 0; z-index: 1; display: block; }

.woocommerce ul.products li.product .bv-card__img,
.bv-card__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	object-fit: cover;
	transition: transform 1.1s var(--bv-ease), opacity .6s var(--bv-ease);
}

.bv-card__img--alt { opacity: 0; transform: scale(1.08); }
.bv-card:hover .bv-card__img--main { transform: scale(1.08); }
.bv-card:hover .bv-card__img--alt { opacity: 1; transform: scale(1); }
.bv-card:hover .bv-card__img--main:only-child { transform: scale(1.1); }

/* Light sweep on hover */
.bv-card__shine {
	position: absolute;
	inset: 0;
	background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .35), transparent 45%);
	opacity: 0;
	transition: opacity .4s;
	pointer-events: none;
	mix-blend-mode: soft-light;
	z-index: 2;
}

.bv-card:hover .bv-card__shine { opacity: 1; }

/* Badges */
.bv-badges {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
	pointer-events: none;
}

.bv-badge {
	align-self: flex-start;
	padding: 5px 10px;
	border-radius: 999px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	backdrop-filter: blur(6px);
}

.bv-badge--sale { background: linear-gradient(120deg, #ff3d6e, #ff7a45); }
.bv-badge--new { background: var(--bv-grad); box-shadow: 0 6px 18px -6px rgba(44, 99, 255, .8); }
.bv-badge--hot { background: linear-gradient(120deg, #ff8a00, #ffb800); }
.bv-badge--out { background: rgba(10, 20, 51, .75); }

/* Quick add */
.bv-quick {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 4;
	transform: translateY(calc(100% + 16px));
	transition: transform .55s var(--bv-ease);
}

.bv-card:hover .bv-quick,
.bv-quick.is-open,
.bv-quick:focus-within { transform: none; }

.woocommerce ul.products li.product .bv-quick__btn,
.bv-quick__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	border: 0;
	border-radius: 14px;
	background: rgba(4, 11, 36, .86);
	backdrop-filter: blur(12px);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	box-shadow: none;
	cursor: pointer;
	transition: background .3s, transform .3s var(--bv-ease);
}

.woocommerce ul.products li.product .bv-quick__btn:hover,
.bv-quick__btn:hover { background: var(--bv-blue); color: #fff; transform: none; }

.bv-quick__btn.loading { opacity: .7; }
.bv-quick__btn.added::after { display: none; }
.bv-quick .added_to_cart { display: none !important; }
.bv-quick.is-open .bv-quick__btn { display: none !important; }

.bv-quick__sizes {
	display: none;
	grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
	gap: 6px;
	max-height: 170px;
	overflow-y: auto;
	padding: 10px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .95);
	backdrop-filter: blur(14px);
	box-shadow: 0 20px 40px -20px rgba(4, 11, 36, .5);
}

.bv-quick.is-open .bv-quick__sizes { display: grid; animation: bv-pop .45s var(--bv-ease); }

@keyframes bv-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.bv-quick__sizes p { grid-column: 1 / -1; margin: 0; padding: 6px; text-align: center; color: var(--bv-muted); font-size: 13px; }

.bv-size {
	padding: 9px 4px;
	border: 1.5px solid var(--bv-line);
	border-radius: 10px;
	background: #fff;
	color: var(--bv-ink);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .2s, background .2s, color .2s, transform .2s;
}

.bv-size:hover { border-color: var(--bv-blue); color: var(--bv-blue); background: #fff; transform: translateY(-2px); }
.bv-size.is-busy { background: var(--bv-blue); border-color: var(--bv-blue); color: #fff; animation: bv-pulse 1s infinite; }
.bv-size:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; transform: none; }

@keyframes bv-pulse { 50% { opacity: .6; } }

/* Body */
.bv-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 18px;
}

.bv-card__cat {
	color: var(--bv-blue);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.bv-card__title-link { color: var(--bv-ink); text-decoration: none; }

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	margin: 0;
	padding: 0;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: var(--bv-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	transition: color .25s;
}

.bv-card:hover .woocommerce-loop-product__title { color: var(--bv-blue); }

.bv-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 6px;
}

.woocommerce ul.products li.product .price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin: 0;
	color: var(--bv-ink);
	font-size: 19px;
	font-weight: 700;
}

.woocommerce ul.products li.product .price del { color: var(--bv-muted); font-size: 13px; font-weight: 400; opacity: 1; }
.woocommerce ul.products li.product .price ins { text-decoration: none; color: #ff3d6e; }
.bv-price-from { margin-right: 2px; color: var(--bv-muted); font-size: 12px; font-weight: 500; }

.bv-card__go {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--bv-bg);
	color: var(--bv-ink);
	transition: background .35s, color .35s, transform .45s var(--bv-ease);
}

.bv-card:hover .bv-card__go {
	background: var(--bv-grad);
	color: #fff;
	transform: rotate(-45deg);
}

@media (max-width: 1024px) {
	.woocommerce ul.products,
	.elementor-widget-woocommerce-products ul.products { --bv-cols: 3 !important; }
}

@media (max-width: 767px) {
	.woocommerce ul.products,
	.elementor-widget-woocommerce-products ul.products { --bv-cols: 2 !important; gap: 16px 12px; }
	.bv-card__body { padding: 12px; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px; }
	.woocommerce ul.products li.product .price { font-size: 16px; }
	.bv-card__go { display: none; }
	/* 触屏没有 hover：快速加购常驻为小按钮 */
	.bv-quick { transform: none; left: 8px; right: 8px; bottom: 8px; }
	.woocommerce ul.products li.product .bv-quick__btn { padding: 9px 10px; font-size: 12px; border-radius: 12px; }
}
