:root {
	--af-blue-900: #07345e;
	--af-blue-700: #07549a;
	--af-blue-100: #eaf4fc;
	--af-green-600: #18a469;
	--af-green-100: #e8f8f0;
	--af-ink: #17324a;
	--af-muted: #617183;
	--af-line: #dfe7ee;
	--af-surface: #ffffff;
	--af-shadow: 0 14px 36px rgba(17, 55, 86, .11);
}

.af-store,
.af-book-detail {
	color: var(--af-ink);
	font-family: inherit;
}

.af-store *,
.af-book-detail * {
	box-sizing: border-box;
}

.af-store-toolbar {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 18px;
	margin: 0 0 28px;
	padding: 18px;
	border: 1px solid var(--af-line);
	border-radius: 14px;
	background: linear-gradient(135deg, #f6fbff, #f4fbf7);
}

.af-search-wrap {
	position: relative;
	flex: 1 1 420px;
	max-width: 620px;
}

.af-search-icon {
	position: absolute;
	top: 50%;
	left: 16px;
	width: 15px;
	height: 15px;
	border: 2px solid var(--af-blue-700);
	border-radius: 50%;
	transform: translateY(-58%);
	pointer-events: none;
}

.af-search-icon::after {
	position: absolute;
	right: -6px;
	bottom: -4px;
	width: 7px;
	height: 2px;
	border-radius: 2px;
	background: var(--af-blue-700);
	transform: rotate(45deg);
	content: "";
}

.af-store-search,
.af-currency-control select,
.af-category-control select {
	width: 100%;
	min-height: 46px;
	margin: 0;
	border: 1px solid #b9c9d7;
	border-radius: 9px;
	background: #fff;
	color: var(--af-ink);
	font-size: 15px;
}

.af-store-search {
	padding: 10px 14px 10px 45px;
}

.af-store-search:focus,
.af-currency-control select:focus,
.af-category-control select:focus {
	border-color: var(--af-blue-700);
	box-shadow: 0 0 0 3px rgba(7, 84, 154, .14);
	outline: 0;
}

.af-currency-control,
.af-category-control {
	flex: 0 1 370px;
}

.af-category-control {
	flex-basis: 290px;
}

.af-currency-control label,
.af-category-control label {
	display: block;
	margin: 0 0 6px;
	color: var(--af-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.af-currency-control select,
.af-category-control select {
	padding: 8px 38px 8px 12px;
}

.af-book-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin: 0 0 18px;
}

.af-book-categories a,
.af-book-categories span {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px 10px;
	border: 1px solid #b9dfcb;
	border-radius: 999px;
	background: var(--af-green-100);
	color: #08744b;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.af-book-categories a:hover {
	border-color: var(--af-green-600);
	background: #d9f3e6;
	color: #075c3d;
}

.af-book-categories-compact {
	margin: 0 0 10px;
}

.af-book-categories-compact a,
.af-book-categories-compact span {
	min-height: 24px;
	padding: 3px 8px;
	font-size: 11px;
}

.af-book-grid {
	display: grid;
	gap: 26px;
}

.af-book-grid.af-columns-1 { grid-template-columns: 1fr; }
.af-book-grid.af-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.af-book-grid.af-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.af-book-grid.af-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.af-book-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--af-line);
	border-radius: 16px;
	background: var(--af-surface);
	box-shadow: 0 8px 24px rgba(18, 55, 86, .07);
	transition: transform .22s ease, box-shadow .22s ease;
}

.af-book-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--af-shadow);
}

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

.af-card-cover-link {
	position: relative;
	display: flex;
	min-height: 335px;
	align-items: center;
	justify-content: center;
	padding: 28px;
	background: radial-gradient(circle at 50% 20%, #fff 0, #edf6fc 52%, #dbeaf5 100%);
	text-decoration: none;
}

.af-card-cover {
	display: block;
	width: auto;
	max-width: 100%;
	height: 280px;
	margin: 0;
	object-fit: contain;
	border-radius: 2px 5px 5px 2px;
	box-shadow: -7px 9px 18px rgba(9, 40, 69, .23);
}

.af-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px;
}

.af-card-meta,
.af-book-kicker {
	margin-bottom: 8px;
	color: var(--af-green-600);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.af-card-title {
	margin: 0 0 12px;
	font-size: clamp(18px, 2vw, 22px);
	line-height: 1.28;
}

.af-card-title a {
	color: var(--af-blue-900);
	text-decoration: none;
}

.af-card-title a:hover {
	color: var(--af-blue-700);
}

.af-card-description {
	display: -webkit-box;
	overflow: hidden;
	margin: 0 0 16px;
	color: var(--af-muted);
	font-size: 14px;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.af-card-price {
	display: block;
	margin: auto 0 15px;
	color: var(--af-blue-900);
	font-size: 24px;
	line-height: 1.2;
}

.af-card-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--af-line);
}

.af-card-link,
.af-card-sample {
	color: var(--af-blue-700);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.af-card-sample {
	color: var(--af-green-600);
}

.af-card-amazon {
	display: block;
	margin-top: 16px;
	padding: 11px 14px;
	border-radius: 8px;
	background: #ffb300;
	color: #251800;
	font-size: 14px;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
}

.af-card-amazon:hover {
	background: #f3a900;
	color: #111;
}

.af-no-results,
.af-empty-store {
	padding: 34px;
	border: 1px dashed #afc2d2;
	border-radius: 14px;
	background: #f7fbfe;
	color: var(--af-muted);
	text-align: center;
}

.af-book-detail {
	margin: 30px 0;
	padding: clamp(20px, 4vw, 42px);
	border: 1px solid var(--af-line);
	border-radius: 20px;
	background: #fff;
	box-shadow: var(--af-shadow);
}

.af-book-detail-layout {
	display: grid;
	grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
	gap: clamp(28px, 5vw, 58px);
	align-items: start;
}

.af-book-cover-column {
	position: sticky;
	top: 32px;
}

.af-book-cover-column .af-purchase-panel {
	align-items: stretch;
	flex-direction: column;
	gap: 16px;
	margin-top: 18px;
	padding: 18px;
}

.af-book-cover-column .af-purchase-panel .af-currency-control {
	width: 100%;
	max-width: none;
	flex: 0 0 auto;
}

.af-book-cover-column .af-book-actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-top: 12px;
}

.af-book-cover-column .af-book-actions .af-button {
	width: 100%;
	padding-right: 14px;
	padding-left: 14px;
}

.af-book-cover-wrap {
	position: relative;
	overflow: hidden;
	padding: 12px;
	border-radius: 16px;
	background: radial-gradient(circle at 50% 15%, #fff, var(--af-blue-100));
}

.af-book-cover-image {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	border-radius: 2px 7px 7px 2px;
	box-shadow: -10px 14px 30px rgba(7, 52, 94, .25);
	cursor: zoom-in;
	transform: scale(1);
	transform-origin: center;
	transition: transform .65s cubic-bezier(.2, .72, .22, 1);
	will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
	.af-book-cover-wrap:hover .af-book-cover-image {
		transform: scale(1.09);
	}
}

.af-cover-placeholder {
	display: flex;
	width: min(100%, 270px);
	min-height: 330px;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	margin: auto;
	border-radius: 3px 10px 10px 3px;
	background: linear-gradient(145deg, var(--af-blue-900), var(--af-blue-700));
	box-shadow: -8px 12px 22px rgba(7, 52, 94, .24);
	color: #fff;
	text-align: center;
}

.af-cover-placeholder span {
	font-size: 28px;
	font-weight: 900;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.af-cover-placeholder small {
	margin-top: 9px;
	opacity: .8;
}

.af-book-detail-title {
	margin: 0 0 12px;
	color: var(--af-blue-900);
	font-size: clamp(26px, 4vw, 42px);
	line-height: 1.16;
}

.af-book-description {
	color: #344c60;
	font-size: 16px;
	line-height: 1.72;
}

.af-book-description > :first-child { margin-top: 0; }

.af-units-public {
	margin: 30px 0;
	padding: clamp(20px, 3vw, 28px);
	border-left: 4px solid var(--af-green-600);
	border-radius: 0 12px 12px 0;
	background: #f6fbf8;
}

.af-units-public h3 {
	margin: 0 0 16px;
	color: var(--af-blue-900);
	font-size: 20px;
}

.af-units-public ol {
	margin: 0;
	padding-left: 24px;
}

.af-units-public li {
	margin: 0 0 10px;
	padding-left: 5px;
	line-height: 1.5;
}

.af-book-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	overflow: hidden;
	margin: 28px 0;
	border: 1px solid var(--af-line);
	border-radius: 12px;
}

.af-book-facts > div {
	display: flex;
	min-width: 0;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 16px;
	border-right: 1px solid var(--af-line);
	border-bottom: 1px solid var(--af-line);
}

.af-book-facts span {
	color: var(--af-muted);
	font-size: 13px;
}

.af-book-facts strong {
	overflow-wrap: anywhere;
	color: var(--af-ink);
	font-size: 14px;
	text-align: right;
}

.af-purchase-panel {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 22px;
	margin-top: 26px;
	padding: 20px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--af-blue-100), var(--af-green-100));
}

.af-price-table {
	width: 100%;
	overflow: hidden;
	border: 1px solid rgba(7, 84, 154, .16);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, .76);
}

.af-price-table th,
.af-price-table td {
	padding: 11px 10px;
	border-bottom: 1px solid rgba(7, 84, 154, .12);
}

.af-price-table tr:last-child th,
.af-price-table tr:last-child td {
	border-bottom: 0;
}

.af-price-table th {
	color: var(--af-muted);
	font-size: 12px;
	font-weight: 700;
	text-align: left;
}

.af-price-table td {
	text-align: right;
}

.af-price-table .af-price {
	color: var(--af-blue-900);
	font-size: clamp(18px, 2.2vw, 24px);
	line-height: 1.1;
	white-space: nowrap;
}

.af-price-note {
	display: block;
	margin-top: -5px;
	color: var(--af-muted);
	font-size: 11px;
}

.af-purchase-panel .af-currency-control {
	flex: 1 1 320px;
	max-width: 390px;
}

.af-book-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 18px;
}

.af-button {
	display: inline-flex;
	min-height: 48px;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 20px;
	border-radius: 9px;
	font-size: 15px;
	font-weight: 800;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease;
}

.af-button:hover {
	transform: translateY(-2px);
}

.af-button-amazon,
.af-button-buy,
.af-button-ebook {
	background: #ffb300;
	box-shadow: 0 7px 16px rgba(166, 110, 0, .2);
	color: #251800;
}

.af-amazon-mark {
	font: 900 22px Georgia, serif;
}

.af-button-sample {
	border: 1px solid var(--af-blue-700);
	background: #fff;
	color: var(--af-blue-700);
}

.af-button-course {
	background: var(--af-green-600);
	box-shadow: 0 7px 16px rgba(24, 164, 105, .22);
	color: #fff;
}

.af-button-course:hover {
	color: #fff;
}

.af-button-ebook:hover {
	color: #251800;
}

.af-button-information {
	cursor: default;
}

.af-button-information:hover {
	transform: none;
}

.af-viewer-open {
	overflow: hidden;
}

.af-sample-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.af-sample-modal[hidden] {
	display: none !important;
}

.af-sample-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 15, 25, .88);
	backdrop-filter: blur(5px);
}

.af-sample-dialog {
	position: relative;
	display: flex;
	overflow: hidden;
	width: min(1480px, 96vw);
	height: min(940px, 94vh);
	flex-direction: column;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 16px;
	background: #192531;
	box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
	color: #fff;
}

.af-sample-dialog:fullscreen {
	width: 100vw;
	height: 100vh;
	border: 0;
	border-radius: 0;
}

.af-sample-header {
	display: flex;
	min-height: 72px;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 12px 18px 12px 22px;
	background: linear-gradient(110deg, var(--af-blue-900), #092b49);
	box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
}

.af-sample-header > div:first-child {
	display: flex;
	min-width: 0;
	flex-direction: column;
}

.af-sample-brand {
	color: #72d6aa;
	font-size: 10px;
	font-weight: 900;
	letter-spacing: .11em;
}

.af-sample-header strong {
	overflow: hidden;
	font-size: clamp(15px, 2vw, 20px);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.af-sample-header-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
}

.af-sample-header-actions button,
.af-sample-header-actions a,
.af-sample-footer button {
	display: inline-grid;
	min-width: 40px;
	min-height: 40px;
	place-items: center;
	margin: 0;
	padding: 7px 11px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 7px;
	background: rgba(255, 255, 255, .08);
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 21px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.af-sample-header-actions button:hover,
.af-sample-header-actions a:hover,
.af-sample-footer button:hover:not(:disabled) {
	border-color: rgba(255, 255, 255, .5);
	background: rgba(255, 255, 255, .16);
	color: #fff;
}

.af-sample-stage {
	position: relative;
	display: flex;
	min-height: 0;
	flex: 1;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 24px 62px;
	background:
		radial-gradient(circle at 50% 30%, rgba(84, 105, 124, .5), transparent 55%),
		#17212b;
}

.af-pdf-pages {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	gap: 24px;
	perspective: 1700px;
}

.af-pdf-pages canvas {
	display: block;
	max-width: calc(50% - 12px);
	max-height: 100%;
	border-radius: 2px 6px 6px 2px;
	background: #fff;
	box-shadow: 0 16px 38px rgba(0, 0, 0, .42);
}

.af-pdf-pages.is-single-page canvas {
	max-width: 100%;
}

.af-pdf-pages canvas[hidden],
.af-pdf-pages[hidden] {
	display: none !important;
}

.af-pdf-pages.is-turning canvas {
	animation: af-page-turn .32s ease-out;
}

@keyframes af-page-turn {
	from { opacity: .35; transform: rotateY(-8deg) scale(.985); }
	to { opacity: 1; transform: rotateY(0) scale(1); }
}

.af-page-arrow {
	position: absolute;
	z-index: 2;
	top: 50%;
	display: grid;
	width: 44px;
	height: 62px;
	place-items: center;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 9px;
	background: rgba(4, 15, 25, .58);
	box-shadow: none;
	color: #fff;
	font: 300 44px/1 Arial, sans-serif;
	transform: translateY(-50%);
	cursor: pointer;
}

.af-page-arrow-prev { left: 12px; }
.af-page-arrow-next { right: 12px; }

.af-page-arrow:disabled,
.af-sample-footer button:disabled {
	opacity: .3;
	cursor: not-allowed;
}

.af-sample-loading,
.af-sample-error {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-direction: column;
	color: #fff;
	text-align: center;
}

.af-sample-loading[hidden],
.af-sample-error[hidden] {
	display: none !important;
}

.af-sample-loading span {
	width: 42px;
	height: 42px;
	border: 4px solid rgba(255, 255, 255, .2);
	border-top-color: var(--af-green-600);
	border-radius: 50%;
	animation: af-spin .8s linear infinite;
}

@keyframes af-spin {
	to { transform: rotate(360deg); }
}

.af-sample-error a {
	padding: 9px 13px;
	border-radius: 7px;
	background: #fff;
	color: var(--af-blue-900);
	font-weight: 700;
	text-decoration: none;
}

.af-sample-footer {
	display: flex;
	min-height: 58px;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 9px 16px;
	background: #0c1721;
}

.af-sample-footer button {
	display: inline-flex;
	min-width: 114px;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
}

.af-sample-footer span {
	min-width: 145px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.screen-reader-text {
	position: absolute !important;
	overflow: hidden;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	clip: rect(0, 0, 0, 0);
	border: 0;
	white-space: nowrap;
}

@media (max-width: 980px) {
	.af-book-grid.af-columns-3,
	.af-book-grid.af-columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.af-book-detail-layout {
		grid-template-columns: minmax(190px, 32%) minmax(0, 1fr);
		gap: 28px;
	}
}

@media (max-width: 720px) {
	.af-store-toolbar,
	.af-purchase-panel {
		align-items: stretch;
		flex-direction: column;
	}

	.af-store-toolbar .af-currency-control,
	.af-store-toolbar .af-category-control,
	.af-purchase-panel .af-currency-control {
		max-width: none;
		flex-basis: auto;
	}

	.af-book-grid.af-columns-2,
	.af-book-grid.af-columns-3,
	.af-book-grid.af-columns-4 {
		grid-template-columns: 1fr;
	}

	.af-book-detail-layout {
		grid-template-columns: 1fr;
	}

	.af-book-cover-column {
		position: static;
	}

	.af-book-cover-image {
		max-height: 440px;
	}

	.af-book-facts {
		grid-template-columns: 1fr;
	}

	.af-book-facts > div {
		border-right: 0;
	}

	.af-book-actions .af-button {
		width: 100%;
	}

	.af-sample-modal {
		padding: 0;
	}

	.af-sample-dialog {
		width: 100vw;
		height: 100vh;
		border: 0;
		border-radius: 0;
	}

	.af-sample-header {
		min-height: 62px;
		padding: 9px 10px 9px 14px;
	}

	.af-sample-header-actions [data-af-fullscreen],
	.af-sample-header-actions [data-af-pdf-download] {
		display: none;
	}

	.af-sample-stage {
		padding: 18px 42px;
	}

	.af-page-arrow {
		width: 36px;
		height: 54px;
		font-size: 36px;
	}

	.af-page-arrow-prev { left: 3px; }
	.af-page-arrow-next { right: 3px; }

	.af-sample-footer {
		gap: 8px;
		padding: 7px;
	}

	.af-sample-footer button {
		min-width: 0;
		padding: 7px 9px;
	}

	.af-sample-footer span {
		min-width: 104px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.af-book-card,
	.af-button {
		transition: none;
	}
}
