/**
 * NMO Book showcase — retailer logo strip only.
 * Enqueued when Content → Retailer strip display = Logo tiles (per widget instance).
 * Last modified: 2026-04-14 — default 3-col grid + last-row orphan align (reference layout).
 */

/*
 * Beat theme rules such as:
 * main#content a:not(.btn):not(.nloc-btn):not(.elementor-button) { text-decoration: underline; … }
 * Plain logo links are not .btn — scope under .buy-group--logos so only logo mode is affected.
 */
main#content .elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-group--logos a.nmo-book-showcase__buy-logo-tile--plain,
main#content .elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-group--logos a.nmo-book-showcase__buy-logo-tile.nmo-book-showcase__buy-logo-tile--plain {
	text-decoration: none !important;
	text-decoration-line: none !important;
	text-decoration-thickness: 0 !important;
	text-underline-offset: 0 !important;
	text-decoration-color: transparent !important;
	color: inherit !important;
}

main#content .elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-group--logos a.nmo-book-showcase__buy-logo-tile--plain:hover,
main#content .elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-group--logos a.nmo-book-showcase__buy-logo-tile--plain:focus,
main#content .elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-group--logos a.nmo-book-showcase__buy-logo-tile--plain:focus-visible {
	text-decoration: none !important;
	text-decoration-line: none !important;
	text-decoration-thickness: 0 !important;
	text-underline-offset: 0 !important;
}

/* --- Layout: stack | grid | masonry (Content → Logo layout) --- */

/* --nmo-buy-logo-cols and --nmo-buy-logo-gap are intentionally NOT set here.
 * They are owned entirely by the Elementor controls (Style → Logo tiles).
 * Setting them here caused the footer-loaded file to override Elementor's
 * head-injected CSS at equal specificity, making the controls non-functional. */
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos {
	width: 100%;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-stack {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--nmo-buy-logo-gap, 0.75rem);
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid {
	display: grid;
	grid-template-columns: repeat(var(--nmo-buy-logo-cols, 3), minmax(0, 1fr));
	gap: var(--nmo-buy-logo-gap, 1rem);
	align-items: center;
	justify-items: center;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid > .nmo-book-showcase__buy-logo-tile {
	min-width: 0;
}

/*
 * When the last row has a single logo (e.g. 3+3+1), tuck it to the start of that row like the design mockup.
 * data-nmo-logo-cols mirrors Style → Logos per row (set in PHP from the same setting).
 */
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid[data-nmo-logo-cols="2"] > .nmo-book-showcase__buy-logo-tile:last-child:nth-child(2n + 1) {
	justify-self: start;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid[data-nmo-logo-cols="3"] > .nmo-book-showcase__buy-logo-tile:last-child:nth-child(3n + 1) {
	justify-self: start;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid[data-nmo-logo-cols="4"] > .nmo-book-showcase__buy-logo-tile:last-child:nth-child(4n + 1) {
	justify-self: start;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid[data-nmo-logo-cols="5"] > .nmo-book-showcase__buy-logo-tile:last-child:nth-child(5n + 1) {
	justify-self: start;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-grid[data-nmo-logo-cols="6"] > .nmo-book-showcase__buy-logo-tile:last-child:nth-child(6n + 1) {
	justify-self: start;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-masonry {
	column-count: var(--nmo-buy-logo-cols, 3);
	column-gap: var(--nmo-buy-logo-gap, 0.75rem);
	column-fill: balance;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logos--layout-masonry > .nmo-book-showcase__buy-logo-tile {
	display: inline-flex;
	width: 100%;
	justify-content: center;
	align-items: center;
	vertical-align: top;
	break-inside: avoid;
	page-break-inside: avoid;
	margin-bottom: var(--nmo-buy-logo-gap, 0.75rem);
	box-sizing: border-box;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile--plain {
	display: flex;
	width: 100%;
	justify-content: center;
	align-items: center;
	text-align: center;
	text-decoration: none !important;
	color: inherit;
	box-shadow: none;
	background: transparent;
	border: none !important;
	border-bottom: none !important;
	padding: 0.25rem 0;
	transition: opacity 0.2s ease;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-fallback-text {
	display: block;
	font-family: var(--font-sans, Inter, system-ui, sans-serif);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-light, #6b6b6b);
	line-height: 1.3;
	text-align: center;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile--plain:hover,
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile--plain:focus-visible {
	opacity: 0.85;
	outline: none;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile--plain:focus-visible {
	box-shadow: 0 0 0 2px var(--gold, #c8922a);
	border-radius: 4px;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile.btn {
	display: flex;
	width: 100%;
	justify-content: center;
	align-items: center;
	text-align: center;
	gap: 0;
	min-height: 3rem;
	padding-block: 0.65rem;
	padding-inline: 1rem;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile .nmo-book-showcase__buy-logo-img {
	display: block;
	flex-shrink: 0;
	width: auto;
	height: auto;
	max-height: 44px; /* fallback until Style → Logo image max height is set */
	max-width: min(100%, 280px); /* fallback until Style → Logo image max width is set */
	margin-inline: auto;
	object-fit: contain;
	object-position: center;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile .nmo-book-showcase__buy-btn-icon,
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile .e-font-icon-svg,
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile svg {
	display: block;
	flex-shrink: 0;
	margin-inline: auto;
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile .nmo-book-showcase__buy-btn-icon,
.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile i {
	font-size: 1.1rem;
	line-height: 1;
	color: var(--gold, #c8922a);
}

.elementor-widget-nmo-book-showcase .nmo-book-showcase__buy-logo-tile svg {
	fill: var(--gold, #c8922a);
	color: var(--gold, #c8922a);
}
