.hmbs-bookstore-grid-wrap,
.hmbs-my-library-wrap,
.hmbs-single-manual,
.hmbs-library-login,
.hmbs-widget-block,
.hmbs-elementor-button-wrap {
	box-sizing: border-box;
}

.hmbs-bookstore-filters {
	margin: 0 0 24px;
	padding: 18px;
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.hmbs-bookstore-filters__row {
	display: grid;
	grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) auto auto;
	gap: 14px;
	align-items: end;
}

.hmbs-bookstore-filters__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hmbs-bookstore-filters__field label {
	font-size: 0.92rem;
	font-weight: 600;
	color: #334155;
}

.hmbs-bookstore-filters__field input[type="search"],
.hmbs-bookstore-filters__field select {
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	background: #ffffff;
	color: #0f172a;
}

.hmbs-bookstore-filters__field--checkbox {
	justify-content: flex-end;
}

.hmbs-bookstore-filters__field--checkbox label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	font-weight: 600;
}

.hmbs-bookstore-filters__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hmbs-bookstore-grid,
.hmbs-library-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
}

.hmbs-manual-card,
.hmbs-single-manual,
.hmbs-empty-state,
.hmbs-library-login {
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.hmbs-manual-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: 100%;
	position: relative;
}

.hmbs-manual-card__cover-wrap {
	position: relative;
}

.hmbs-manual-card__cover {
	display: block;
	aspect-ratio: 3 / 4;
	background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
	overflow: hidden;
}

.hmbs-manual-cover-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hmbs-manual-cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 220px;
	padding: 18px;
	color: #64748b;
	font-size: 0.95rem;
	background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
	text-align: center;
}

.hmbs-manual-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
}

.hmbs-manual-badge--featured {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fcd34d;
}

.hmbs-manual-card__badge-stack {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hmbs-manual-badge--offer {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #86efac;
}

.hmbs-manual-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	flex: 1;
}

.hmbs-manual-card__terms,
.hmbs-single-manual__terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hmbs-term-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 999px;
	background: #e2e8f0;
	color: #334155;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1;
}

.hmbs-manual-card__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.32;
}

.hmbs-manual-card__title a {
	color: #0f172a;
	text-decoration: none;
}

.hmbs-manual-card__title a:hover {
	text-decoration: underline;
}

.hmbs-manual-card__price,
.hmbs-single-manual__price {
	font-weight: 700;
	font-size: 1rem;
	color: #0f172a;
}

.hmbs-price-stack {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
}

.hmbs-price-old {
	font-size: 0.92rem;
	font-weight: 600;
	color: #64748b;
}

.hmbs-price-sale {
	font-size: 1.05rem;
	font-weight: 800;
	color: #0f172a;
}

.hmbs-manual-card__excerpt,
.hmbs-single-manual__description {
	margin: 0;
	color: #475569;
	line-height: 1.7;
	font-size: 0.92rem;
}

.hmbs-manual-card__offer-message,
.hmbs-single-manual__offer-message {
	padding: 10px 12px;
	border-radius: 12px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.5;
}

.hmbs-manual-card__helper,
.hmbs-single-manual__helper {
	padding: 10px 12px;
	border-radius: 12px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1d4ed8;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.5;
}

.hmbs-manual-card__actions,
.hmbs-single-manual__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
}

.hmbs-manual-card__actions .button,
.hmbs-single-manual__actions .button {
	flex: 1 1 calc(50% - 5px);
}

.hmbs-details-button,
.hmbs-action-button,
.hmbs-bookstore-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 10px 14px;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.2;
	transition: all 0.2s ease;
	text-align: center;
}

.hmbs-details-button,
.button.hmbs-details-button,
.hmbs-action-button--buy,
.button.hmbs-action-button--buy {
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.12);
	color: #0f172a;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.hmbs-details-button:hover,
.button.hmbs-details-button:hover,
.hmbs-action-button--buy:hover,
.button.hmbs-action-button--buy:hover {
	background: #f8fafc;
	border-color: rgba(59, 130, 246, 0.22);
	color: #0f172a;
	transform: translateY(-1px);
}

/* -------------------------------------------------------
 * Bookstore widget / shortcode button
 * Self Apps inspired card UI
 * ----------------------------------------------------- */
.hmbs-bookstore-button,
.hmbs-bookstore-button:visited {
	text-decoration: none;
}

.hmbs-bookstore-button--image {
	--hmbs-card-border: #e5e7eb;
	--hmbs-card-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
	--hmbs-card-shadow-hover: 0 10px 28px rgba(17, 24, 39, 0.12);
	--hmbs-card-bg: #ffffff;
	--hmbs-card-title: #111827;
	--hmbs-card-ring-bg: #f8fafc;
	--hmbs-card-ring-border: #e5e7eb;

	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 110px;
	margin: 16px auto;
	padding: 14px 14px 12px;
	background: var(--hmbs-card-bg);
	border: 1px solid var(--hmbs-card-border);
	border-radius: 16px;
	box-shadow: var(--hmbs-card-shadow);
	color: var(--hmbs-card-title);
	text-decoration: none;
	backface-visibility: hidden;
	-webkit-font-smoothing: antialiased;
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		border-color 0.18s ease,
		background-color 0.18s ease;
	will-change: transform;
}

.hmbs-bookstore-button--image:hover {
	transform: translateY(-3px) scale(1.01);
	box-shadow: var(--hmbs-card-shadow-hover);
	border-color: #d8dce3;
	background: #ffffff;
	color: var(--hmbs-card-title);
	text-decoration: none;
}

.hmbs-bookstore-button--image:active {
	transform: translateY(0) scale(0.985);
	box-shadow: 0 3px 10px rgba(17, 24, 39, 0.10);
}

.hmbs-bookstore-button--image:focus,
.hmbs-bookstore-button--image:focus-visible {
	outline: none;
	border-color: #c7d2fe;
	box-shadow:
		0 0 0 3px rgba(99, 102, 241, 0.12),
		var(--hmbs-card-shadow-hover);
}

.hmbs-bookstore-button__icon-image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: 9999px;
	border: 1px solid var(--hmbs-card-ring-border);
	background: var(--hmbs-card-ring-bg);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		border-color 0.18s ease,
		background-color 0.18s ease;
}

.hmbs-bookstore-button--image:hover .hmbs-bookstore-button__icon-image-wrap {
	border-color: #d6daf0;
	background: #fbfcff;
	box-shadow:
		0 8px 20px rgba(59, 130, 246, 0.08),
		0 0 0 4px rgba(139, 92, 246, 0.05);
}

.hmbs-bookstore-button__icon-image {
	display: block;
	width: 48px;
	height: 48px;
	max-width: none;
	object-fit: cover;
	border-radius: 10px;
	transition: transform 0.18s ease, filter 0.18s ease;
}

.hmbs-bookstore-button--image:hover .hmbs-bookstore-button__icon-image {
	transform: scale(1.04);
	filter: saturate(1.04);
}

.hmbs-bookstore-button--image:active .hmbs-bookstore-button__icon-image {
	transform: scale(0.98);
}

.hmbs-bookstore-button__text {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--hmbs-card-title);
	text-align: center;
	letter-spacing: 0.01em;
	white-space: normal;
	text-shadow: none;
}

.hmbs-bookstore-button__text--glow {
	color: #111827;
	text-shadow: none;
}

.hmbs-action-button--download,
.button.hmbs-action-button--download {
	background: #14532d;
	border: 1px solid #14532d;
	color: #ffffff;
}

.hmbs-action-button--download:hover,
.button.hmbs-action-button--download:hover {
	background: #166534;
	border-color: #166534;
	color: #ffffff;
}

.hmbs-action-button--pending,
.button.hmbs-action-button--pending {
	background: #ffffff;
	border: 1px solid #f59e0b;
	color: #92400e;
}

.hmbs-action-button--pending:hover,
.button.hmbs-action-button--pending:hover {
	background: #fff7ed;
	color: #92400e;
	transform: translateY(-1px);
}

.hmbs-action-button--auth,
.button.hmbs-action-button--auth,
.hmbs-action-button--secondary,
.button.hmbs-action-button--secondary {
	background: #ffffff;
	border: 1px solid rgba(37, 99, 235, 0.24);
	color: #1d4ed8;
	box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.hmbs-action-button--auth:hover,
.button.hmbs-action-button--auth:hover,
.hmbs-action-button--secondary:hover,
.button.hmbs-action-button--secondary:hover {
	background: #eff6ff;
	border-color: rgba(37, 99, 235, 0.38);
	color: #1d4ed8;
	transform: translateY(-1px);
}

.hmbs-action-button--disabled,
.button.disabled.hmbs-action-button--disabled {
	background: #e2e8f0;
	border: 1px solid #cbd5e1;
	color: #64748b;
	cursor: not-allowed;
	pointer-events: none;
	box-shadow: none;
}

.hmbs-price-unavailable {
	color: #64748b;
	font-weight: 600;
}

.hmbs-empty-state,
.hmbs-library-login {
	padding: 28px;
	text-align: center;
	color: #475569;
}

.hmbs-empty-state p,
.hmbs-library-login p {
	margin: 0 0 12px;
}

.hmbs-single-manual {
	display: grid;
	grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
	gap: 32px;
	padding: 28px;
}

.hmbs-single-manual__media {
	min-width: 0;
}

.hmbs-single-manual__badge-wrap {
	margin-bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hmbs-single-manual__cover-link {
	display: block;
	overflow: hidden;
	border-radius: 18px;
	background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.hmbs-single-manual__cover-link .hmbs-manual-cover-image,
.hmbs-single-manual__cover-link .hmbs-manual-cover-placeholder {
	border-radius: 18px;
}

.hmbs-single-manual__content {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.hmbs-single-manual__title {
	margin: 0;
	font-size: clamp(1.8rem, 2.3vw, 2.6rem);
	line-height: 1.15;
	color: #0f172a;
}

.hmbs-widget-block {
	display: block;
}

.hmbs-widget-title {
	margin: 0 0 20px;
	font-size: clamp(1.5rem, 2vw, 2rem);
	line-height: 1.2;
	color: #0f172a;
}

.hmbs-elementor-button-wrap {
	display: block;
}

.hmbs-elementor-button-wrap--left {
	text-align: left;
}

.hmbs-elementor-button-wrap--left .hmbs-bookstore-button--image {
	margin-left: 0;
	margin-right: auto;
}

.hmbs-elementor-button-wrap--center {
	text-align: center;
}

.hmbs-elementor-button-wrap--center .hmbs-bookstore-button--image {
	margin-left: auto;
	margin-right: auto;
}

.hmbs-elementor-button-wrap--right {
	text-align: right;
}

.hmbs-elementor-button-wrap--right .hmbs-bookstore-button--image {
	margin-left: auto;
	margin-right: 0;
}

.hmbs-account-download-cell {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.hmbs-account-download-helper {
	display: block;
	font-size: 0.82rem;
	line-height: 1.45;
	font-weight: 700;
	color: #dc2626;
}

.hmbs-bookstore-button:focus,
.hmbs-details-button:focus,
.hmbs-action-button:focus,
.hmbs-manual-card__title a:focus,
.hmbs-bookstore-filters input:focus,
.hmbs-bookstore-filters select:focus,
.woocommerce-MyAccount-downloads-file:focus {
	outline: 3px solid rgba(59, 130, 246, 0.25);
	outline-offset: 2px;
}

@media (max-width: 1200px) {
	.hmbs-bookstore-grid,
	.hmbs-library-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 960px) {
	.hmbs-bookstore-grid,
	.hmbs-library-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hmbs-single-manual {
		grid-template-columns: 1fr;
	}

	.hmbs-bookstore-filters__row {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 640px) {
	.hmbs-bookstore-grid,
	.hmbs-library-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.hmbs-bookstore-filters__row {
		grid-template-columns: 1fr;
	}

	.hmbs-manual-card__actions .button,
	.hmbs-single-manual__actions .button {
		flex: 1 1 100%;
	}

	.hmbs-manual-card__body,
	.hmbs-single-manual {
		padding: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmbs-bookstore-button--image,
	.hmbs-bookstore-button__icon-image-wrap,
	.hmbs-bookstore-button__icon-image,
	.hmbs-manual-card,
	.hmbs-details-button,
	.hmbs-action-button {
		transition: none !important;
		transform: none !important;
	}
}