/* ==========================================================================
   Book Library — Frontend Styles  (Creative 3D · Gold & Navy)
   Gold #E7A125  ·  Navy #16294C
   ========================================================================== */

:root {
	--bl-navy: #16294C;
	--bl-navy-2: #24406f;
	--bl-gold: #E7A125;
	--bl-gold-2: #f4b942;
	--bl-gold-deep: #c1841b;
	--bl-text-dark: #16294C;
	--bl-text-muted: #6b7280;
	--bl-border: #e7e3d6;
	--bl-bg-card: #ffffff;
	--bl-radius: 22px;
}

/* ---- Section Header ---- */
.bl-section-header {
	max-width: 660px;
	margin: 0 auto 56px;
	padding: 0 16px;
}

.bl-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 20px;
	border-radius: 999px;
	background: rgba(231, 161, 37, 0.12);
	color: var(--bl-gold-deep);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 18px;
	border: 1px solid rgba(231, 161, 37, 0.28);
}

.bl-section-header h2 {
	font-size: 40px;
	font-weight: 800;
	color: var(--bl-navy);
	margin: 0;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

/* ---- Grid ---- */
.bl-book-grid {
	--bl-columns: 3;
	display: grid;
	grid-template-columns: repeat(var(--bl-columns), 1fr);
	gap: 34px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 16px 40px;
}

@media (max-width: 992px) {
	.bl-book-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
}

@media (max-width: 600px) {
	.bl-book-grid { grid-template-columns: 1fr; gap: 22px; }
	.bl-section-header h2 { font-size: 30px; }
}

/* ---- Book Card ---- */
.bl-book-card {
	position: relative;
	background:
		radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #faf8f2 55%, #f4f1e8 100%);
	border-radius: var(--bl-radius);
	border: 1px solid var(--bl-border);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease, border-color 0.4s ease;
	box-shadow: 0 4px 14px rgba(22, 41, 76, 0.06);
}

/* soft gold aura at top of each card */
.bl-book-card::before {
	content: "";
	position: absolute;
	top: -60px;
	left: 50%;
	transform: translateX(-50%);
	width: 220px;
	height: 220px;
	background: radial-gradient(circle, rgba(231, 161, 37, 0.22) 0%, transparent 68%);
	opacity: 0.7;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.bl-book-card:hover {
	transform: translateY(-10px);
	box-shadow: 0 26px 56px rgba(22, 41, 76, 0.22);
	border-color: rgba(231, 161, 37, 0.45);
}

.bl-book-card:hover::before { opacity: 1; }

/* ---- Stage (holds the 3D book, reflection, price chip) ---- */
.bl-book-stage {
	position: relative;
	height: 300px;
	padding: 40px 28px 0;
	display: flex;
	justify-content: center;
	align-items: flex-end;
	perspective: 1400px;
}

/* faint shelf line */
.bl-book-stage::after {
	content: "";
	position: absolute;
	left: 12%;
	right: 12%;
	bottom: 40px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(22, 41, 76, 0.12), transparent);
}

/* ---- The 3D standing book ---- */
.bl-book-3d {
	position: relative;
	transform-style: preserve-3d;
	transform: rotateY(-28deg) rotateX(3deg);
	transition: transform 0.55s cubic-bezier(.2,.8,.2,1);
	will-change: transform;
	filter: drop-shadow(-16px 26px 26px rgba(22, 41, 76, 0.34));
}

.bl-book-card:hover .bl-book-3d {
	transform: rotateY(-6deg) rotateX(1deg) translateY(-8px);
}

.bl-book-cover {
	position: relative;
	display: block;
	border-radius: 4px 8px 8px 4px;
	overflow: hidden;
}

.bl-book-cover img {
	display: block;
	max-height: 230px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	border-radius: 4px 8px 8px 4px;
}

/* Binding spine — dark gradient strip on the left edge */
.bl-book-spine {
	position: absolute;
	top: 0;
	left: 0;
	width: 14px;
	height: 100%;
	background: linear-gradient(90deg,
		rgba(0, 0, 0, 0.38) 0%,
		rgba(0, 0, 0, 0.18) 32%,
		rgba(255, 255, 255, 0.22) 55%,
		rgba(0, 0, 0, 0.10) 100%);
	mix-blend-mode: multiply;
	pointer-events: none;
}

/* Page edges — thin light lines on the right to hint paper thickness */
.bl-book-cover::after {
	content: "";
	position: absolute;
	top: 3px;
	right: 0;
	width: 7px;
	height: calc(100% - 6px);
	background: repeating-linear-gradient(90deg,
		#ffffff 0px, #ffffff 1px,
		#ded7c5 1px, #ded7c5 2px);
	border-radius: 0 3px 3px 0;
	box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.12);
	pointer-events: none;
}

/* Ambient sheen over the cover */
.bl-book-glow {
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg,
		rgba(255, 255, 255, 0.28) 0%,
		transparent 40%);
	pointer-events: none;
}

/* Animated diagonal shine that sweeps across on hover */
.bl-book-shine {
	position: absolute;
	top: 0;
	left: -120%;
	width: 60%;
	height: 100%;
	background: linear-gradient(105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.55) 50%,
		transparent 100%);
	transform: skewX(-18deg);
	pointer-events: none;
	transition: left 0.75s cubic-bezier(.2,.8,.2,1);
}

.bl-book-card:hover .bl-book-shine { left: 130%; }

/* Reflection under the book */
.bl-book-reflection {
	position: absolute;
	bottom: 22px;
	left: 50%;
	width: 62%;
	height: 26px;
	transform: translateX(-50%);
	background: radial-gradient(ellipse at center, rgba(22, 41, 76, 0.24) 0%, transparent 72%);
	filter: blur(3px);
	pointer-events: none;
	transition: opacity 0.4s ease, width 0.4s ease;
}

.bl-book-card:hover .bl-book-reflection { width: 70%; opacity: 0.85; }

/* ---- Floating price chip (navy tag, gold text) ---- */
.bl-book-price-chip {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 3;
	padding: 8px 15px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--bl-navy), var(--bl-navy-2));
	color: var(--bl-gold-2);
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.01em;
	box-shadow: 0 8px 20px rgba(22, 41, 76, 0.34);
	transition: transform 0.35s ease;
}

.bl-book-card:hover .bl-book-price-chip { transform: scale(1.06) rotate(-2deg); }

/* ---- Info section ---- */
.bl-book-info {
	padding: 6px 26px 28px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 12px;
	position: relative;
	z-index: 2;
}

.bl-book-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 5px 12px;
	border-radius: 8px;
	background: rgba(22, 41, 76, 0.08);
	color: var(--bl-navy);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.bl-book-tag svg { flex-shrink: 0; }

.bl-book-title {
	font-size: 19px;
	font-weight: 800;
	color: var(--bl-navy);
	margin: 0;
	line-height: 1.38;
	letter-spacing: -0.01em;
	min-height: 52px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Buy Now button — gold with navy text */
.bl-buy-now-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--bl-gold-2) 0%, var(--bl-gold) 55%, var(--bl-gold-deep) 100%);
	color: var(--bl-navy) !important;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
	padding: 13px 22px;
	border-radius: 12px;
	margin-top: auto;
	position: relative;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	box-shadow: 0 8px 20px rgba(231, 161, 37, 0.38);
}

.bl-buy-now-btn::after {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
	transition: left 0.6s ease;
}

.bl-buy-now-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 28px rgba(231, 161, 37, 0.52);
	color: var(--bl-navy) !important;
}

.bl-buy-now-btn:hover::after { left: 120%; }

.bl-buy-now-btn .bl-btn-arrow { transition: transform 0.25s ease; }
.bl-buy-now-btn:hover .bl-btn-arrow { transform: translateX(4px); }

.bl-buy-now-btn.bl-disabled {
	background: #e6e2d6;
	color: #9b927c !important;
	cursor: not-allowed;
	box-shadow: none;
}

.bl-buy-now-btn.bl-disabled::after { display: none; }

.bl-buy-now-btn.bl-disabled:hover {
	transform: none;
	box-shadow: none;
	background: #e6e2d6;
}

/* No books message */
.bl-no-books {
	text-align: center;
	color: var(--bl-text-muted);
	padding: 40px 16px;
	font-size: 16px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	.bl-book-3d,
	.bl-book-card,
	.bl-book-shine,
	.bl-book-price-chip { transition: none; }
	.bl-book-3d { transform: rotateY(-14deg); }
}
