.book-section {
	max-width: 100%;
	margin: 30px 0;
	font-family: inherit;
}

.book-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 15px;
}

.book-section__title {
	font-size: 22px;
	font-weight: 700;
	color: #1a2b4c;
	margin: 0;
}

.book-section__see-all {
	color: #e53935;
	text-decoration: underline;
	font-size: 14px;
	font-weight: 600;
}

.book-section__wrapper {
	position: relative;
}

.book-section__track {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-bottom: 5px;
}

.book-section__track::-webkit-scrollbar {
	display: none;
}

.book-section__arrow {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	background: #fff;
	border: 1px solid #eee;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 20px;
	cursor: pointer;
	z-index: 2;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
}

.book-section__arrow--prev {
	left: -10px;
}

.book-section__arrow--next {
	right: -10px;
}

.book-card {
	position: relative;
	flex: 0 0 160px;
	width: 160px;
}

.book-card__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	background: #e53935;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

.book-card__image-link {
	display: block;
	border-radius: 6px;
	overflow: hidden;
	background: #f2f2f2;
}

.book-card__image-link img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.book-card__title {
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0 4px;
	line-height: 1.3;
}

.book-card__title a {
	color: #1a2b4c;
	text-decoration: none;
}

.book-card__author {
	font-size: 12px;
	color: #777;
	margin: 0 0 6px;
}

.book-card__price {
	font-size: 14px;
	font-weight: 700;
}

.book-card__price-sale {
	color: #e53935;
	margin-right: 6px;
}

.book-card__price-regular {
	color: #999;
	font-weight: 400;
	text-decoration: line-through;
	font-size: 12px;
}

@media (max-width: 600px) {
	.book-card {
		flex: 0 0 130px;
		width: 130px;
	}
}

/* Phase 1 responsive/accessibility improvements */
.book-section__track {
	--book-cards-per-view: 6;
	--book-card-gap: 14px;
	gap: var(--book-card-gap);
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
}

.book-section__arrow[disabled] {
	opacity: .35;
	cursor: default;
	pointer-events: none;
}

.book-section__arrow[hidden] {
	display: none;
}

.book-section__track:focus-visible,
.book-section__arrow:focus-visible,
.book-section__see-all:focus-visible,
.book-card__image-link:focus-visible,
.book-card__title a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.book-section__notice {
	margin: 20px 0;
}

.book-section__notice--error {
	color: #b42318;
}

@media (max-width: 1024px) {
	.book-section__track {
		--book-cards-per-view: 4;
	}
}

@media (max-width: 600px) {
	.book-section__track {
		--book-cards-per-view: 2.2;
	}

	.book-card {
		flex-basis: 130px;
		width: 130px;
	}

	.book-section__arrow {
		width: 32px;
		height: 32px;
	}
}


.book-section__track .book-card {
	flex-basis: calc((100% - (var(--book-cards-per-view) - 1) * var(--book-card-gap)) / var(--book-cards-per-view));
	width: calc((100% - (var(--book-cards-per-view) - 1) * var(--book-card-gap)) / var(--book-cards-per-view));
}

/* Phase 2 — Bookstore features */
.book-card__rating,
.book-section__quick-view-rating {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 3px 0 7px;
	font-size: 12px;
}

.book-card__rating .star-rating,
.book-section__quick-view-rating .star-rating {
	margin: 0;
	font-size: 12px;
}

.book-card__review-count {
	color: #777;
	font-size: 11px;
}

.book-card__meta,
.book-card__stock {
	font-size: 11px;
	line-height: 1.4;
	margin: 3px 0;
	color: #777;
}

.book-card__stock--instock {
	color: #198754;
}

.book-card__stock--outofstock {
	color: #dc3545;
}

.book-card__stock--onbackorder {
	color: #b7791f;
}

.book-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 10px;
}

.book-card__add-to-cart,
.book-card__quick-view,
.book-section__quick-view-link,
.book-section__quick-view-cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 7px 11px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	background: #fff;
	color: #1a2b4c;
	box-sizing: border-box;
}

.book-card__add-to-cart {
	background: #1a2b4c;
	border-color: #1a2b4c;
	color: #fff;
}

.book-card__add-to-cart:hover,
.book-section__quick-view-cart:hover {
	filter: none;
}

.book-card__quick-view:hover,
.book-section__quick-view-link:hover {
	background: #f7f7f7;
}

.book-section__quick-view-content {
	display: none !important;
}

.book-section__modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.book-section__modal[hidden] {
	display: none !important;
}

.book-section__modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.book-section__modal-dialog {
	position: relative;
	z-index: 1;
	width: min(760px, calc(100% - 30px));
	max-height: calc(100vh - 30px);
	overflow: auto;
	margin: 15px auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
}

.book-section__modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.book-section__modal-body {
	padding: 30px;
}

.book-section__quick-view-inner {
	display: grid;
	grid-template-columns: minmax(180px, 280px) 1fr;
	gap: 28px;
	align-items: start;
}

.book-section__quick-view-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 7px;
}

.book-section__quick-view-info h3 {
	margin: 0 0 8px;
	font-size: 24px;
	line-height: 1.25;
}

.book-section__quick-view-author {
	margin: 0 0 10px;
	color: #777;
}

.book-section__quick-view-price {
	margin: 12px 0;
	font-size: 20px;
	font-weight: 700;
}

.book-section__quick-view-info > p:not(.book-section__quick-view-author) {
	color: #555;
	line-height: 1.6;
}

.book-section__quick-view-link,
.book-section__quick-view-cart {
	margin: 5px 7px 0 0;
}

@media (max-width: 600px) {
	.book-section__modal-body {
		padding: 22px;
	}

	.book-section__quick-view-inner {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.book-section__quick-view-info h3 {
		font-size: 20px;
	}
}
html.book-section-modal-open {
	overflow: hidden;
}


/* Phase 2.1 — compact, uniform bookstore cards */
.book-section .book-section__track {
	align-items: flex-start;
}

.book-section .book-card {
	box-sizing: border-box;
	min-width: 160px;
	max-width: 300px;
	align-self: flex-start;
	overflow: hidden;
}

.book-section .book-card__image-link {
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	display: block;
}

.book-section .book-card__image-link img,
.book-section .book-card__image-link > img {
	width: 100% !important;
	height: 100% !important;
	min-height: 0;
	max-height: none;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	object-position: center;
	display: block;
}

.book-section .book-card__title,
.book-section .book-card h3.book-card__title {
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	margin: 9px 0 3px !important;
	padding: 0 !important;
	min-height: 37.8px;
	max-height: 37.8px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.book-section .book-card__title a,
.book-section .book-card__title a:hover,
.book-section .book-card__title a:focus {
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: #1a2b4c !important;
	text-decoration: none !important;
}

.book-section .book-card__author {
	font-size: 12px !important;
	line-height: 1.35 !important;
	min-height: 16px;
	max-height: 32px;
	margin: 0 0 5px !important;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.book-section .book-card__price {
	font-size: 14px !important;
	line-height: 1.4 !important;
	min-height: 20px;
	margin-top: 2px;
}

.book-section .book-card__price-sale {
	font-size: 14px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
}

.book-section .book-card__price-regular {
	font-size: 11px !important;
	font-weight: 400 !important;
	text-decoration: line-through !important;
	white-space: nowrap;
}

.book-section .book-card__badge {
	box-sizing: border-box;
	font-size: 10px;
	line-height: 1.05;
	white-space: normal;
	word-break: break-word;
}

/* Image-middle placement keeps the cart button anchored to the cover itself. */
.book-section .book-card__media {
	position: relative !important;
	display: block !important;
	width: 100%;
}

.book-section .book-card__actions--image-middle {
	position: absolute;
	top: 62% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	width: max-content;
	max-width: calc(100% - 16px);
	z-index: 6;
	margin: 0;
}

.book-section .book-card__actions--image-middle .book-card__add-to-cart {
	position: relative;
	max-width: 100%;
	white-space: nowrap;
	box-sizing: border-box;
}

/* Near-bottom image placement: KEEP the button physically inside the image box.
 * The media wrapper is the containing block, so the button cannot drift into
 * the title/price area even when the theme applies aggressive link styles.
 */
.book-section .book-card__media {
	position: relative !important;
	display: block !important;
	width: 100%;
}

.book-section .book-card--cart-placement-image_near_bottom .book-card__media,
.book-section .book-card--cart-placement-image-near-bottom .book-card__media {
	position: relative !important;
}

.book-section .book-card__actions--image-near-bottom {
	position: absolute !important;
	left: 50% !important;
	right: auto !important;
	top: auto !important;
	bottom: 10px !important;
	transform: translateX(-50%) !important;
	width: calc(100% - 20px) !important;
	max-width: calc(100% - 20px) !important;
	margin: 0 !important;
	padding: 0 !important;
	z-index: 20 !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	box-sizing: border-box;
	pointer-events: none;
}

.book-section .book-card__actions--image-near-bottom .book-card__add-to-cart {
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	transform: translateY(0) !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	box-sizing: border-box;
	white-space: nowrap;
	pointer-events: auto;
}

/* Add to Cart display + safe placement.
 * Both placements stay in the card's normal content flow, so the button can
 * never cover the product title/author/price.
 */
.book-section .book-card__actions {
	box-sizing: border-box;
}

.book-section .book-card--cart-placement-below_price .book-card__actions {
	position: relative;
	width: 100%;
	margin-top: 8px;
}

.book-section .book-card--cart-placement-card_bottom .book-card__actions {
	position: relative;
	width: 100%;
	margin-top: 10px;
}

/* Manual placement: absolute to the individual card, controlled by Elementor PX offsets.
 * Leaving an offset empty lets CSS use its natural edge; users can precisely position it.
 */
.book-section .book-card--cart-placement-manual .book-card__actions {
	position: absolute;
	width: auto;
	margin-top: 0;
	z-index: 20;
}

.book-section .book-card--cart-placement-manual .book-card__add-to-cart {
	position: relative;
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	transform: none;
	max-width: 100%;
	white-space: nowrap;
	box-sizing: border-box;
}

.book-section .book-card--cart-placement-below_price .book-card__add-to-cart,
.book-section .book-card--cart-placement-card_bottom .book-card__add-to-cart {
	position: relative;
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	transform: translateY(0);
	max-width: 100%;
	white-space: nowrap;
	box-sizing: border-box;
	z-index: 5;
}

/* Hover mode: collapse the button so it does not leave a blank area. */
.book-section .book-card--cart-hover .book-card__add-to-cart {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	display: inline-flex !important;
	max-height: 0;
	overflow: hidden;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	border-width: 0 !important;
	transform: translateY(6px);
	transition: opacity .22s ease, visibility .22s ease, transform .22s ease, max-height .22s ease;
}

.book-section .book-card--cart-hover:hover .book-card__add-to-cart,
.book-section .book-card--cart-hover:focus-within .book-card__add-to-cart {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	max-height: 120px;
	transform: translateY(0);
}

/* Always mode: visible in the selected normal-flow placement. */
.book-section .book-card--cart-always .book-card__add-to-cart {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	max-height: 120px;
}

/* Defensive visibility contract: only the explicit card mode controls cart visibility.
 * This prevents theme/Elementor inherited opacity/visibility rules from forcing hover carts visible.
 */
.book-section .book-card--cart-hover .book-card__add-to-cart {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}
.book-section .book-card--cart-hover:hover .book-card__add-to-cart,
.book-section .book-card--cart-hover:focus-within .book-card__add-to-cart {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}
.book-section .book-card--cart-always .book-card__add-to-cart {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

@media (prefers-reduced-motion: reduce) {
	.book-section .book-card__add-to-cart {
		transition: none;
	}
}

/* Premium discount badge presets. Elementor controls can override these values. */
.book-section .book-card__badge--top-left { top: 8px; left: 8px; right: auto; bottom: auto; }
.book-section .book-card__badge--top-right { top: 8px; right: 8px; left: auto; bottom: auto; }
.book-section .book-card__badge--bottom-left { bottom: 8px; left: 8px; right: auto; top: auto; }
.book-section .book-card__badge--bottom-right { bottom: 8px; right: 8px; left: auto; top: auto; }

.book-section .book-card__badge--shape-circle { border-radius: 50%; }
.book-section .book-card__badge--shape-rounded { border-radius: 10px; width: auto; min-width: 42px; padding-left: 8px; padding-right: 8px; }
.book-section .book-card__badge--shape-rectangle { border-radius: 0; width: auto; min-width: 42px; padding-left: 8px; padding-right: 8px; }
.book-section .book-card__badge--shape-pill { border-radius: 999px; width: auto; min-width: 42px; padding-left: 10px; padding-right: 10px; }

.book-section .book-card__actions {
	margin-top: 8px;
}

.book-section .book-card__add-to-cart,
.book-section .book-card__quick-view {
	font-size: 11px !important;
	line-height: 1.2 !important;
	min-height: 32px;
	padding: 7px 10px !important;
	text-decoration: none !important;
}

@media (max-width: 600px) {
	.book-section .book-card {
		min-width: 130px;
	}

	.book-section .book-card__title,
	.book-section .book-card h3.book-card__title,
	.book-section .book-card__title a {
		font-size: 13px !important;
		line-height: 1.35 !important;
	}

	.book-section .book-card__title {
		min-height: 35.1px;
		max-height: 35.1px;
	}
}


/* Phase 3 — Premium features */
.book-section--grid .book-section__track {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	align-items: start;
	overflow: visible;
}

.book-section--grid .book-card {
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	flex: none !important;
}

.book-section--preset-compact .book-card__title {
	font-size: 13px !important;
	line-height: 1.3 !important;
	min-height: 33.8px;
	max-height: 33.8px;
}

.book-section--preset-compact .book-card__author {
	font-size: 11px !important;
}

.book-section--preset-compact .book-card__price,
.book-section--preset-compact .book-card__price-sale {
	font-size: 13px !important;
}

.book-section--preset-clean .book-card__image-link {
	border-radius: 10px;
}

.book-section--preset-clean .book-card__badge {
	padding: 5px 7px;
}

.book-section--preset-clean .book-card__actions {
	margin-top: 6px;
}

@media (max-width: 1024px) {
	.book-section--grid .book-section__track {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

@media (max-width: 600px) {
	.book-section--grid .book-section__track {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}


/* v1.3.8 — stable product info alignment and header See All link */
.book-section .book-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.book-section .book-card__media {
	flex: 0 0 auto;
}

.book-section .book-card__title,
.book-section .book-card h3.book-card__title {
	height: 37.8px !important;
	min-height: 37.8px !important;
	max-height: 37.8px !important;
}

.book-section .book-card__author {
	height: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	margin-bottom: 5px !important;
}

.book-section .book-card__rating,
.book-section .book-card__meta,
.book-section .book-card__stock {
	min-height: 18px;
	max-height: 18px;
	overflow: hidden;
}

.book-section .book-card__price {
	margin-top: auto !important;
	min-height: 20px !important;
	height: 20px !important;
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	white-space: nowrap;
}

.book-section .book-section__header {
	width: 100%;
	gap: 16px;
}

.book-section .book-section__see-all {
	margin-left: auto;
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Mobile: hide the Order Now/Add to Cart action only.
 * Desktop and tablet hover behavior remain unchanged.
 * Removing the hover action on small touch screens prevents the hover layer
 * from interfering with vertical page scrolling.
 */
@media (max-width: 767px) {
	/* Allow vertical page scrolling when touch starts on a card/track.
	 * The base carousel uses pan-x, which blocks vertical swipes on mobile.
	 * Keep horizontal carousel swipes available while allowing vertical pan.
	 */
	.book-section .book-section__track {
		touch-action: pan-x pan-y !important;
	}

	.book-section .book-card__add-to-cart {
		display: none !important;
		pointer-events: none !important;
	}

	.book-section .book-card--cart-hover:hover .book-card__add-to-cart,
	.book-section .book-card--cart-hover:focus-within .book-card__add-to-cart {
		display: none !important;
		pointer-events: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
	}
}
