/*
 * Product card density (v2.3.2)
 * ─────────────────────────────────────────────────────────────────
 * Height-reduction layer for product cards, driven entirely by body
 * classes set from the "Product Cards" Customizer section. Always
 * enqueued (independent of the Modern Look toggle) so the chosen
 * density applies in both the classic and modern looks.
 *
 * Body classes (set in inc/modern-style.php -> anubc_card_body_class):
 *   .anubc-cards-compact       tighter gaps + padding
 *   .anubc-cards-img-landscape 4:3 image instead of square 1:1
 *   .anubc-cards-cta-inline    price + icon button share one row
 *
 * Review stars are removed in PHP (content-product.php) when the
 * "Show review stars" box is unticked, so there's no CSS for that here.
 *
 * @package anu-book-centre
 */

/* ── Compact density: trim the vertical rhythm ─────────────────── */
.anubc-cards-compact .anubc-card-content {
	gap: 0.35rem;
}
.anubc-cards-compact .anubc-product-card .anubc-card-body {
	padding: 0.7rem;
}
.anubc-cards-compact .anubc-card-cta {
	padding-top: 0.35rem;
}
.anubc-cards-compact .anubc-price-row {
	margin-top: 0 !important;
}
/* Let short titles collapse instead of always reserving two lines,
   but still clamp long ones at two lines so nothing runs away. */
.anubc-cards-compact .anubc-card-title {
	min-height: 0;
}

/* ── Landscape image: shortest option (may crop tall covers) ───── */
.anubc-cards-img-landscape .anubc-product-card img,
.anubc-cards-img-landscape .anubc-product-card .anubc-img-placeholder {
	aspect-ratio: 4 / 3;
}

/* ── Inline CTA: price and button share one row ────────────────── */
.anubc-cards-cta-inline .anubc-card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}
.anubc-cards-cta-inline .anubc-price-row {
	margin: 0 !important;
	flex: 1 1 auto;
	min-width: 0;
}
.anubc-cards-cta-inline .anubc-card-cta {
	padding-top: 0;
	flex: 0 0 auto;
}
.anubc-cards-cta-inline .anubc-card-cta .anubc-btn {
	width: auto;
	padding: 0.45rem 0.7rem;
}
.anubc-cards-cta-inline .anubc-card-cta .anubc-btn span {
	display: none;
}
.anubc-cards-cta-inline .anubc-card-cta .anubc-btn i {
	display: inline-flex !important;
	margin: 0;
}

/*
 * Featured / Bestsellers right-side panel styles (v2.3.3)
 * ─────────────────────────────────────────────────────────────────
 * Style is chosen in Appearance > Customize > Featured Products grid.
 * Body/wrap classes: .anubc-fg--{classic|ranked|cards|hero} and an
 * optional .anubc-fg--glass modifier. All share the hover polish below.
 */

/* Title with leading icon */
.anubc-fg .anubc-featured-grid-title {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--anubc-blue-dark, #1e3a8a);
}
.anubc-fg .anubc-featured-grid-title i {
	color: var(--anubc-blue, #1d4ed8);
	font-size: 0.95rem;
}

/* ── Glass panel + hover lift ──────────────────────────────────── */
.anubc-fg--glass {
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(10px) saturate(1.35);
	backdrop-filter: blur(10px) saturate(1.35);
	border: 1px solid rgba(255, 255, 255, 0.7);
	box-shadow: 0 6px 22px rgba(16, 24, 40, 0.08);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.anubc-fg--glass:hover {
	box-shadow: 0 10px 30px rgba(29, 78, 216, 0.14);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.anubc-fg--glass { background: #ffffff; }
}

/* Shared thumb sizing for the list-based styles */
.anubc-fg-thumb {
	flex: 0 0 auto;
	display: block;
	border-radius: 8px;
	overflow: hidden;
	background: #eff6ff;
}
.anubc-fg-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.anubc-fg-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.anubc-fg-name {
	font-size: 0.78rem;
	color: #1f2937;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.anubc-fg-price {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--anubc-blue-dark, #1e3a8a);
}
.anubc-fg-price .woocommerce-Price-amount { font-size: inherit; }

/* ── Ranked list ───────────────────────────────────────────────── */
.anubc-fg-ranked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.anubc-fg-row {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 6px 5px;
	border-radius: 9px;
	text-decoration: none;
	transition: background 0.18s ease, transform 0.18s ease;
}
.anubc-fg-row:hover { background: rgba(29, 78, 216, 0.07); transform: translateX(2px); }
.anubc-fg-rank {
	flex: 0 0 21px;
	height: 21px;
	border-radius: 6px;
	background: #e5e7eb;
	color: #4b5563;
	font-size: 0.72rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.anubc-fg-rank--top { background: #fef3c7; color: #92400e; }
.anubc-fg-ranked .anubc-fg-thumb { width: 34px; height: 34px; }

/* ── Accent cards ──────────────────────────────────────────────── */
.anubc-fg-cards { display: flex; flex-direction: column; gap: 8px; }
.anubc-fg-card {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px;
	border-radius: 9px;
	border: 0.5px solid #e5e7eb;
	border-left: 3px solid var(--anubc-blue, #1d4ed8);
	background: #fff;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-left-color 0.18s ease;
}
.anubc-fg-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(29, 78, 216, 0.12);
	border-left-color: var(--anubc-blue-dark, #1e3a8a);
}
.anubc-fg-cards .anubc-fg-thumb { width: 38px; height: 38px; }

/* ── Hero + list ───────────────────────────────────────────────── */
.anubc-fg-hero-main {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	border: 0.5px solid #e5e7eb;
	background: #fff;
	text-decoration: none;
	margin-bottom: 10px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.anubc-fg-hero-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29, 78, 216, 0.14); }
.anubc-fg-hero-img { display: block; aspect-ratio: 16 / 10; background: #eff6ff; }
.anubc-fg-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anubc-fg-hero-body { display: block; padding: 8px 10px; }
.anubc-fg-badge {
	display: inline-block;
	font-size: 0.62rem;
	font-weight: 700;
	color: #92400e;
	background: #fef3c7;
	padding: 1px 7px;
	border-radius: 5px;
	margin-bottom: 4px;
}
.anubc-fg-hero-rest { display: flex; flex-direction: column; gap: 6px; }
.anubc-fg-row--slim { padding: 4px 4px; gap: 8px; }
.anubc-fg-row--slim .anubc-fg-thumb { width: 30px; height: 30px; }
.anubc-fg-row--slim .anubc-fg-name { flex: 1; }
.anubc-fg-row--slim .anubc-fg-price { font-size: 0.78rem; white-space: nowrap; }
