/* Bìa mặc định trên kệ trang chủ — nền vàng kem, gáy đỏ, cành tre.
   Khối cha đã có tỉ lệ 3/4, bo góc và bóng; bìa này chỉ lấp đầy mặt đó. */
.book-cover {
	--bc-top: #fbf0c8;
	--bc-bottom: #ecd185;
	--bc-spine: #b3262d;
	--bc-title: #7a1a1f;
	--bc-badge-bg: #b3262d;
	--bc-badge-text: #ffffff;
	--bc-line: rgba(122, 26, 31, .22);
	--bc-leaf: rgba(47, 107, 82, .20);
	position: absolute;
	inset: 0;
	z-index: 0;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 16px 14px 14px 24px;
	overflow: hidden;
	container-type: inline-size;
	color: var(--bc-title);
	font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
	background:
		radial-gradient(120% 70% at 100% 0%, rgba(255, 255, 255, .45), transparent 60%),
		linear-gradient(165deg, var(--bc-top), var(--bc-bottom));
	isolation: isolate;
}

.book-cover::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 14px;
	z-index: 1;
	--bc-cap: #e8c15a;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, .40) 0%, rgba(0, 0, 0, .05) 16%, rgba(255, 255, 255, .34) 36%, transparent 58%, rgba(0, 0, 0, .30) 100%),
		linear-gradient(180deg,
			var(--bc-cap) 0 7px, rgba(0, 0, 0, .35) 7px 8px, transparent 8px calc(100% - 8px),
			rgba(0, 0, 0, .35) calc(100% - 8px) calc(100% - 7px), var(--bc-cap) calc(100% - 7px) 100%),
		linear-gradient(90deg, color-mix(in srgb, var(--bc-spine) 70%, #000), var(--bc-spine) 40%, color-mix(in srgb, var(--bc-spine) 75%, #000));
	box-shadow: 4px 0 10px rgba(0, 0, 0, .22);
}

.book-cover::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 70%;
	height: 56%;
	background: var(--bc-leaf);
	-webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%20200%20170%27%20preserveAspectRatio=%27xMaxYMin%20meet%27%3E%3Cdefs%3E%3Cpath%20id=%27l%27%20d=%27M0%200C8%20-6%2028%20-7%2044%200C28%207%208%206%200%200Z%27/%3E%3C/defs%3E%3Cg%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%271.5%27%20stroke-linecap=%27round%27%20stroke-opacity=%27.8%27%3E%3Cpath%20d=%27M210%20-8C176%208%20134%2034%2088%2092%27/%3E%3Cpath%20d=%27M210%2014C190%2040%20170%2072%20160%20122%27/%3E%3Cpath%20d=%27M204%20-6C166%20-2%20128%2010%2084%2030%27/%3E%3C/g%3E%3Cg%20fill=%27%23000%27%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28197.4%20-1.8%29%20rotate%28154%29%20scale%280.94%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28197.4%20-1.8%29%20rotate%28111%29%20scale%280.83%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28177.8%209.4%29%20rotate%28179%29%20scale%280.83%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28177.8%209.4%29%20rotate%28100%29%20scale%280.99%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.9%2023.7%29%20rotate%28177%29%20scale%280.88%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.9%2023.7%29%20rotate%28187%29%20scale%280.82%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28134.9%2041.7%29%20rotate%28106%29%20scale%280.85%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28134.9%2041.7%29%20rotate%28126%29%20scale%281.00%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28111.9%2064.2%29%20rotate%28107%29%20scale%281.02%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28111.9%2064.2%29%20rotate%28106%29%20scale%280.82%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28179%29%20scale%281.04%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28144%29%20scale%281.12%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28140%29%20scale%280.86%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28202.8%2023.6%29%20rotate%28106%29%20scale%280.98%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28202.8%2023.6%29%20rotate%28204%29%20scale%281.01%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28185.9%2050.2%29%20rotate%28105%29%20scale%280.86%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28185.9%2050.2%29%20rotate%28134%29%20scale%280.95%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28171.1%2082.3%29%20rotate%28186%29%20scale%281.11%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28171.1%2082.3%29%20rotate%28149%29%20scale%281.01%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28112%29%20scale%281.13%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28208%29%20scale%280.82%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28207%29%20scale%281.04%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28190.3%20-4.2%29%20rotate%28182%29%20scale%280.96%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28190.3%20-4.2%29%20rotate%28145%29%20scale%280.90%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.5%203.1%29%20rotate%28203%29%20scale%280.96%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.5%203.1%29%20rotate%28193%29%20scale%281.15%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28121.3%2014.5%29%20rotate%28164%29%20scale%281.03%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28121.3%2014.5%29%20rotate%28166%29%20scale%280.80%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28197%29%20scale%281.04%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28208%29%20scale%280.94%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28163%29%20scale%280.87%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28155.5%2015.0%29%20rotate%28119%29%20scale%280.87%29%27%20fill-opacity=%270.6%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28176.8%2023.7%29%20rotate%28165%29%20scale%280.72%29%27%20fill-opacity=%270.6%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.4%209.4%29%20rotate%28167%29%20scale%280.99%29%27%20fill-opacity=%270.6%27/%3E%3C/g%3E%3C/svg%3E") no-repeat right top / contain;
	mask: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%20200%20170%27%20preserveAspectRatio=%27xMaxYMin%20meet%27%3E%3Cdefs%3E%3Cpath%20id=%27l%27%20d=%27M0%200C8%20-6%2028%20-7%2044%200C28%207%208%206%200%200Z%27/%3E%3C/defs%3E%3Cg%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%271.5%27%20stroke-linecap=%27round%27%20stroke-opacity=%27.8%27%3E%3Cpath%20d=%27M210%20-8C176%208%20134%2034%2088%2092%27/%3E%3Cpath%20d=%27M210%2014C190%2040%20170%2072%20160%20122%27/%3E%3Cpath%20d=%27M204%20-6C166%20-2%20128%2010%2084%2030%27/%3E%3C/g%3E%3Cg%20fill=%27%23000%27%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28197.4%20-1.8%29%20rotate%28154%29%20scale%280.94%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28197.4%20-1.8%29%20rotate%28111%29%20scale%280.83%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28177.8%209.4%29%20rotate%28179%29%20scale%280.83%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28177.8%209.4%29%20rotate%28100%29%20scale%280.99%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.9%2023.7%29%20rotate%28177%29%20scale%280.88%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.9%2023.7%29%20rotate%28187%29%20scale%280.82%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28134.9%2041.7%29%20rotate%28106%29%20scale%280.85%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28134.9%2041.7%29%20rotate%28126%29%20scale%281.00%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28111.9%2064.2%29%20rotate%28107%29%20scale%281.02%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28111.9%2064.2%29%20rotate%28106%29%20scale%280.82%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28179%29%20scale%281.04%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28144%29%20scale%281.12%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2888.0%2092.0%29%20rotate%28140%29%20scale%280.86%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28202.8%2023.6%29%20rotate%28106%29%20scale%280.98%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28202.8%2023.6%29%20rotate%28204%29%20scale%281.01%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28185.9%2050.2%29%20rotate%28105%29%20scale%280.86%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28185.9%2050.2%29%20rotate%28134%29%20scale%280.95%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28171.1%2082.3%29%20rotate%28186%29%20scale%281.11%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28171.1%2082.3%29%20rotate%28149%29%20scale%281.01%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28112%29%20scale%281.13%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28208%29%20scale%280.82%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.0%20122.0%29%20rotate%28207%29%20scale%281.04%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28190.3%20-4.2%29%20rotate%28182%29%20scale%280.96%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28190.3%20-4.2%29%20rotate%28145%29%20scale%280.90%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.5%203.1%29%20rotate%28203%29%20scale%280.96%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28156.5%203.1%29%20rotate%28193%29%20scale%281.15%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28121.3%2014.5%29%20rotate%28164%29%20scale%281.03%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28121.3%2014.5%29%20rotate%28166%29%20scale%280.80%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28197%29%20scale%281.04%29%27%20fill-opacity=%270.55%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28208%29%20scale%280.94%29%27%20fill-opacity=%271%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%2884.0%2030.0%29%20rotate%28163%29%20scale%280.87%29%27%20fill-opacity=%270.75%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28155.5%2015.0%29%20rotate%28119%29%20scale%280.87%29%27%20fill-opacity=%270.6%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28176.8%2023.7%29%20rotate%28165%29%20scale%280.72%29%27%20fill-opacity=%270.6%27/%3E%3Cuse%20href=%27%23l%27%20transform=%27translate%28160.4%209.4%29%20rotate%28167%29%20scale%280.99%29%27%20fill-opacity=%270.6%27/%3E%3C/g%3E%3C/svg%3E") no-repeat right top / contain;
	z-index: -1;
	pointer-events: none;
}

.book-cover__badge {
	align-self: flex-start;
	flex: none;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--bc-badge-bg);
	color: var(--bc-badge-text);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
}

/* Huy chương xếp hạng: dải ruy băng treo từ mép trên bìa, đĩa tròn có số.
   Hạng 1 vàng, hạng 2 bạc, các hạng còn lại đỏ. */
.rank-medal {
	--rm-ribbon: #b3262d;
	--rm-ribbon-2: #8a1a20;
	--rm-disc-top: #e5484f;
	--rm-disc-bottom: #b3262d;
	--rm-ring: #f3a3a6;
	--rm-text: #ffffff;
	position: absolute;
	top: 0;
	left: 22px;
	z-index: 2;
	width: 30px;
	height: 44px;
	pointer-events: none;
}

.rank-medal--overlay {
	z-index: 10;
}

/* Dây treo gồm 2 sợi chéo nhau hình chữ V: ::before là sợi trái, ::after là sợi phải (đậm hơn) */
.rank-medal::before,
.rank-medal::after {
	content: "";
	position: absolute;
	top: 0;
	width: 15px;
	height: 26px;
	background:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 3px),
		var(--rm-ribbon);
}

.rank-medal::before {
	left: 3px;
	clip-path: polygon(0 0, 70% 0, 100% 100%, 30% 100%);
}

.rank-medal::after {
	left: 12px;
	background:
		repeating-linear-gradient(45deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 3px),
		var(--rm-ribbon-2);
	clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%);
}

.rank-medal__disc {
	position: absolute;
	top: 14px;
	left: 0;
	box-sizing: border-box;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border: 2px solid var(--rm-ring);
	border-radius: 50%;
	background: linear-gradient(160deg, var(--rm-disc-top), var(--rm-disc-bottom));
	box-shadow: 0 2px 4px rgba(0, 0, 0, .28), inset 0 1px 1px rgba(255, 255, 255, .45);
	color: var(--rm-text);
	font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
    z-index: 2;
}

.rank-medal[data-rank="1"] {
	--rm-ribbon: #dcae3a;
	--rm-ribbon-2: #b8861f;
	--rm-disc-top: #ffe27a;
	--rm-disc-bottom: #f2b72a;
	--rm-ring: #d9a21f;
	--rm-text: #4a3200;
}

.rank-medal[data-rank="2"] {
	--rm-ribbon: #b4bbc8;
	--rm-ribbon-2: #8d96a6;
	--rm-disc-top: #ffffff;
	--rm-disc-bottom: #dfe4ec;
	--rm-ring: #9aa3b2;
	--rm-text: #1f2937;
}

.rank-medal[data-rank="3"] {
	--rm-ribbon: #c27a3e;
	--rm-ribbon-2: #a8622b;
	--rm-disc-top: #efb07c;
	--rm-disc-bottom: #a8622b;
	--rm-ring: #8a4f20;
	--rm-text: #3f1e0b;
}

.book-cover__title {
	min-height: 0;
	margin: auto 0;
	font-size: clamp(15px, 7.2cqw, 20px);
	font-weight: 700;
	line-height: 1.35;
	text-wrap: balance;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
    text-align: center;
}

.book-cover__meta {
	flex: none;
	padding-top: 10px;
	border-top: 1px solid var(--bc-line);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.book-cover__meta-value {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--bc-title);
}

.book-cover__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ================= SECTION "Sách hay mỗi ngày": nền màu + tủ sách 2 tầng =================
   Bìa sách (.book-cover) giữ nguyên, chỉ thay nền section và khung tủ. Slide vẫn do Swiper điều khiển. */
.shelf-sec {
	--shelf-band: #f8f0dc;
	--shelf-band-2: #f4e8c8;
	--shelf-band-line: #e6d7ae;
	--shelf-ink: #0f172a;
	--shelf-muted: #64748b;
	--shelf-red: #b3262d;
    margin-top: 52px;
	position: relative;
	padding: 36px 16px 60px;
	border-block: 1px solid var(--shelf-band-line);
	color: var(--shelf-ink);
	font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
	/* Nền "tường thư viện": vignette + đèn rọi + sàn sáng (84px) + gờ chỉ vàng + tường sọc lambri.
	   Các lớp liệt kê từ trên xuống dưới; tất cả nằm dưới nội dung nên không cần phần tử phụ. */
	--shelf-floor-h: 84px;
	background:
		/* vignette */
		radial-gradient(ellipse 85% 85% at 50% 45%, transparent 55%, rgba(60, 30, 10, .35)),
		/* đèn rọi từ trên */
		radial-gradient(ellipse 58% 70% at 50% 0%, rgba(255, 244, 205, .85), rgba(255, 244, 205, 0) 70%),
		/* sàn: vệt sáng + vạch ván + bóng đổ sát chân tường */
		linear-gradient(105deg, transparent 26%, rgba(255, 255, 255, .75) 38%, transparent 50%) 0 100% / 100% var(--shelf-floor-h) no-repeat,
		linear-gradient(105deg, transparent 62%, rgba(255, 255, 255, .45) 70%, transparent 78%) 0 100% / 100% var(--shelf-floor-h) no-repeat,
		repeating-linear-gradient(90deg, rgba(170, 130, 60, .1) 0 1px, transparent 1px 130px) 0 100% / 100% var(--shelf-floor-h) no-repeat,
		linear-gradient(to bottom, rgba(190, 150, 85, .28), rgba(255, 255, 255, 0) 45%) 0 100% / 100% var(--shelf-floor-h) no-repeat,
		/* gờ chỉ vàng ngăn tường và sàn */
		linear-gradient(rgba(120, 80, 30, .3), transparent) 0 calc(100% - var(--shelf-floor-h) + 8px) / 100% 6px no-repeat,
		linear-gradient(#f4e2b0, #c9a35e) 0 calc(100% - var(--shelf-floor-h)) / 100% 8px no-repeat,
		/* sọc lambri trên tường */
		repeating-linear-gradient(90deg, rgba(150, 110, 50, .07) 0 2px, transparent 2px 46px) 0 0 / 100% calc(100% - var(--shelf-floor-h)) no-repeat,
		/* màu nền tường + sàn */
		linear-gradient(to bottom, #efe0bd 0, #e7d3a5 calc(100% - var(--shelf-floor-h)), #f6ecd2 calc(100% - var(--shelf-floor-h)), #fff7e2 100%);
}

.shelf-sec *, .shelf-sec *::before, .shelf-sec *::after { box-sizing: border-box; }

.shelf-hd {
	max-width: 1160px;
	margin: 0 auto 30px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
}
.shelf-hd h2 { grid-column: 2; margin: 0; font-size: 22px; font-weight: 700; text-align: center; color: var(--shelf-ink); }
.shelf-hd a {
	grid-column: 3;
	justify-self: end;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--shelf-ink);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}
.shelf-hd a:hover { color: var(--shelf-red); }
.shelf-sub { max-width: 1160px; margin: -22px auto 30px; text-align: center; color: var(--shelf-muted); font-size: 13.5px; }

/* Khung tủ gỗ */
.shelf-cab {
	position: relative;
	max-width: 1160px;
	margin: 0 auto;
	padding: 14px 14px 0;
	border-radius: 20px 20px 6px 6px;
	background: linear-gradient(90deg, #9a6531, #d7a165 6%, #c18850 50%, #d19a5c 94%, #8e5a29);
	box-shadow: 0 40px 60px -28px rgba(70, 38, 8, .55), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.shelf-cab::before { content: ""; position: absolute; left: 14px; right: 14px; top: 4px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .28); }
.shelf-cab-in {
	position: relative;
	border-radius: 10px 10px 0 0;
	overflow: hidden;
	background:
		repeating-linear-gradient(90deg, rgba(0, 0, 0, .09) 0 2px, transparent 2px 140px),
		linear-gradient(180deg, #7d5129, #5c3a1c);
	box-shadow: inset 0 0 50px rgba(0, 0, 0, .55), inset 0 8px 14px rgba(0, 0, 0, .4);
}
.shelf-plinth { height: 26px; margin: 0 -14px; border-radius: 0 0 8px 8px; background: linear-gradient(#8a5a2b, #4e3017); box-shadow: 0 14px 24px -8px rgba(60, 30, 5, .6); }
/* Phản chiếu chân tủ trên sàn bóng */
.shelf-cab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 50px;
	margin-top: 1px;
	border-radius: 0 0 10px 10px;
	pointer-events: none;
	background: linear-gradient(#8a5a2b, #4e3017);
	transform: scaleY(-1);
	filter: blur(1.5px);
	/* Phần tử bị lật dọc nên mask chạy "to top": đậm sát chân tủ, mờ dần xuống sàn */
	-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .38), transparent);
	mask-image: linear-gradient(to top, rgba(0, 0, 0, .38), transparent);
}

/* Mỗi tầng: đèn LED, nhãn, mũi tên, ván đỡ sách */
.shelf-tier { --shelf-led: .85; position: relative; padding-top: 18px; }
.shelf-tier + .shelf-tier::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46px; z-index: 1; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.shelf-led { position: absolute; left: 0; right: 0; top: 0; bottom: 46px; z-index: 1; pointer-events: none; }
.shelf-led::before {
	content: "";
	position: absolute;
	inset: 0;
	mix-blend-mode: screen;
	opacity: var(--shelf-led);
	background:
		radial-gradient(34% 62% at 0% 0%, rgba(255, 206, 130, .45), transparent 72%),
		radial-gradient(34% 62% at 100% 0%, rgba(255, 206, 130, .45), transparent 72%),
		linear-gradient(180deg, rgba(255, 218, 150, .38), rgba(255, 214, 140, .10) 50%, transparent);
}
/* Không tạo stacking context ở đây để nhãn (z 2) nằm dưới sách (swiper z 3), còn mũi tên (z 4) vẫn bấm được */
.shelf-tier-hd { position: relative; display: flex; align-items: center; gap: 14px; padding: 0 28px; min-height: 36px; }
.shelf-plaque {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	padding: 7px 18px;
	border-radius: 999px;
	color: #4a2a07;
	background: linear-gradient(180deg, #f8e29c, #d2a23a);
	border: 1px solid #9c6f14;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .65);
}
.shelf-plaque strong { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.shelf-arrows { position: relative; z-index: 4; margin-left: auto; display: flex; gap: 8px; }
.shelf-arrows button {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 230, 170, .55);
	background: rgba(0, 0, 0, .28);
	color: #ffe9b8;
	cursor: pointer;
}
.shelf-arrows button:hover:not(.swiper-button-disabled) { background: rgba(255, 230, 170, .25); }
.shelf-arrows button.swiper-button-disabled { opacity: .35; cursor: default; pointer-events: none; }
.shelf-arrows button.swiper-button-lock { display: none; }
.shelf-arrows button:focus-visible { outline: 2px solid #ffe9b8; outline-offset: 2px; }

.shelf-board {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 46px;
	z-index: 1;
	background: linear-gradient(180deg, #f0cc94 0 9px, #8d5a2a 9px 10px, #c68d50 10px, #9a6630 62%, #7b4f24 100%);
	box-shadow: 0 12px 14px -4px rgba(0, 0, 0, .55);
}

/* Swiper nằm trên ván; chừa khoảng phía trên cho sách nhấc lên khi hover */
.shelf-tier .book-shelf-swiper.swiper {
	position: relative;
	z-index: 3;
	margin-top: -16px;
	padding: 38px 28px 0;
}
.shelf-bk { position: relative; z-index: 2; display: block; margin-bottom: -6px; }
.shelf-bk::after {
	content: "";
	position: absolute;
	left: 4%;
	right: 4%;
	bottom: -3px;
	height: 12px;
	z-index: -1;
	background: radial-gradient(50% 50%, rgba(0, 0, 0, .6), transparent 72%);
}
.shelf-stat { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding-top: 11px; }
.shelf-stat > span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(255, 244, 214, .93);
	color: #5a3a14;
	font-size: 11.5px;
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.shelf-stat svg { width: 12px; height: 12px; }

@media (max-width: 760px) {
	.shelf-sec { padding: 40px 10px 56px; }
	.shelf-cab { padding: 10px 10px 0; }
	.shelf-plinth { margin: 0 -10px; }
	.shelf-tier-hd, .shelf-tier .book-shelf-swiper.swiper { padding-inline: 16px; }
	.shelf-hd { grid-template-columns: 1fr; }
	.shelf-hd h2, .shelf-hd a { grid-column: 1; justify-self: center; }
	.shelf-sub { margin-top: -18px; }
}
