/**
 * Shop card — compact marketplace tiles + product modal (home-preview shell).
 */

:root {
	--yala-shop-title-bg: #0a5c63;
	--yala-shop-title-fg: #f7fffe;
}

/*
 * Loja grid: 2-col CSS grid so DOM order reads left→right, then down.
 * (CSS columns fill top→bottom per column and scramble that reading order.)
 * Livros tiles keep an explicit grid via .yala-shop-grid--livros.
 */
.yala-shop-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85rem;
	width: 100%;
	align-items: start;
}

.yala-shop-grid > .yala-shop-card {
	display: block;
	width: 100%;
	margin: 0;
	min-width: 0;
}

.yala-shop-grid--livros,
.yala-shop-grid--single,
.yala-shop-grid--pair {
	display: grid;
	gap: 0.85rem;
	grid-template-columns: 1fr 1fr;
	align-items: start;
}

.yala-shop-grid--livros > .yala-shop-card,
.yala-shop-grid--single > .yala-shop-card,
.yala-shop-grid--pair > .yala-shop-card {
	display: block;
	margin: 0;
	min-width: 0;
}

.yala-shop-grid--single {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 719px) {
	.yala-shop-grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.yala-shop-grid--livros,
	.yala-shop-grid--pair {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	/* Let the gap rule paint outside the card box */
	.yala-shop-grid > .yala-shop-card,
	.yala-shop-grid--livros > .yala-shop-card,
	.yala-shop-grid--pair > .yala-shop-card {
		overflow: visible;
	}

	/* Horizontal rule centered in the gap between stacked tiles */
	.yala-shop-grid > .yala-shop-card + .yala-shop-card,
	.yala-shop-grid--livros > .yala-shop-card + .yala-shop-card,
	.yala-shop-grid--pair > .yala-shop-card + .yala-shop-card {
		position: relative;
	}

	.yala-shop-grid > .yala-shop-card + .yala-shop-card::before,
	.yala-shop-grid--livros > .yala-shop-card + .yala-shop-card::before,
	.yala-shop-grid--pair > .yala-shop-card + .yala-shop-card::before {
		content: "";
		position: absolute;
		top: calc(-1rem - 0.5px);
		left: 0;
		right: 0;
		border-top: 1px solid rgba(42, 27, 26, 0.2);
		pointer-events: none;
	}
}

.yala-shop-card {
	box-sizing: border-box;
	border: 1px solid rgba(42, 27, 26, 0.16);
	background: #fff;
	color: var(--yala-text, #2a1b1a);
	overflow: hidden;
	height: auto;
}

.yala-shop-card__hit {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.yala-shop-card__hit:focus-visible .yala-shop-card__title{
	background: #08484e;
}

@media (hover: hover) and (pointer: fine) {
	.yala-shop-card__hit:hover .yala-shop-card__title {
		background: #08484e;
}
}

.yala-shop-card__hit:focus-visible {
	outline: 2px solid var(--yala-shop-title-bg);
	outline-offset: -2px;
}

.yala-shop-card__title,
main .yala-shop-card .yala-shop-card__title {
	display: block;
	margin: 0;
	padding: 0.55rem 0.75rem;
	background: var(--yala-shop-title-bg);
	color: var(--yala-shop-title-fg);
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
	transition: background-color 0.15s ease;
}

.yala-shop-card__thumb {
	display: block;
	background: #f3f1ee;
	border-bottom: 1px solid rgba(42, 27, 26, 0.1);
}

.yala-shop-card__thumb img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	object-position: center;
}

.yala-shop-card__desc {
	display: block;
	margin: 0;
	padding: 0.55rem 0.75rem 0.65rem;
	font-size: 0.82rem;
	line-height: 1.4;
	color: rgba(42, 27, 26, 0.88);
}

.yala-shop-card__buy {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 2.35rem;
	padding: 0.55rem 0.75rem;
	border-top: 1px solid rgba(42, 27, 26, 0.14);
	background: rgba(10, 92, 99, 0.06);
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	color: var(--yala-shop-title-bg);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.yala-shop-card__buy:focus-visible{
	background: var(--yala-shop-title-bg);
	color: #fff;
	text-decoration: none;
	outline: none;
}

@media (hover: hover) and (pointer: fine) {
	.yala-shop-card__buy:hover {
		background: var(--yala-shop-title-bg);
		color: #fff;
		text-decoration: none;
		outline: none;
}
}

.yala-shop-card__buy--disabled {
	opacity: 0.55;
	cursor: default;
	color: rgba(42, 27, 26, 0.55);
	background: rgba(42, 27, 26, 0.04);
}

.yala-shop-card.is-sold-out {
	opacity: 0.85;
}

/* Specs table (modal + deck ficha) */
.yala-shop-specs,
.yala-deck-ficha .yala-shop-specs {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.82rem;
}

.yala-shop-specs th,
.yala-shop-specs td {
	padding: 0.4rem 0;
	border-top: 1px solid rgba(42, 27, 26, 0.1);
	text-align: left;
	vertical-align: top;
}

.yala-shop-specs th {
	width: 58%;
	padding-right: 0.75rem;
	font-weight: 600;
	color: rgba(42, 27, 26, 0.55);
}

.yala-shop-specs__ship {
	display: inline-block;
	margin-left: 0.35rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: lowercase;
	color: var(--yala-shop-title-bg, #0a5c63);
	white-space: nowrap;
}

.yala-deck-ficha {
	margin: 1.25rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(42, 27, 26, 0.12);
}

.yala-deck-ficha__title {
	margin: 0 0 0.55rem;
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Modal hosting a shop card (from carta Comprar) */
.yala-shop-card-modal {
	padding: 0;
	border: 0;
	background: transparent;
	max-width: min(22rem, calc(100vw - 1.5rem));
	width: 100%;
}

.yala-shop-card-modal[open] {
	animation: yala-home-preview-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.yala-shop-card-modal.is-closing {
	animation: yala-home-preview-out 0.28s ease both;
}

.yala-shop-card-modal.is-closing::backdrop {
	animation: yala-home-backdrop-out 0.28s ease both;
}

.yala-shop-card-modal::backdrop {
	background: rgba(26, 10, 46, 0.55);
}

.yala-shop-card-modal__inner {
	position: relative;
	background: transparent;
}

.yala-shop-card-modal__close {
	position: absolute;
	top: 0.35rem;
	right: 0.45rem;
	z-index: 2;
	border: 0;
	background: rgba(255, 255, 255, 0.92);
	width: 2rem;
	height: 2rem;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	color: rgba(42, 27, 26, 0.65);
}

.yala-shop-card-modal__body .yala-shop-card {
	box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.35);
}

/*
 * Product modal — home-preview shell + shop extras.
 * Keep overflow visible so the yellow ribbon fold can pass outside the shell
 * (same as .yala-home-preview). Do not restyle the title — reuse site ribbon
 * letterpress via .yala-ribbon .yala-letterpress.
 */
.yala-shop-preview__desc {
	margin: 0;
	padding: 0 var(--yala-preview-pad-x, 1.25rem);
	font-size: 0.92rem;
	line-height: 1.5;
}

.yala-shop-preview .yala-home-preview__shell {
	position: relative;
	align-items: stretch;
	height: auto;
	overflow: visible;
}

.yala-shop-preview .yala-home-preview__copy {
	gap: 0.55rem;
	padding-bottom: clamp(1.25rem, 3vw, 1.75rem);
	justify-content: flex-start;
}

.yala-shop-preview__art {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	padding: clamp(1.1rem, 2.5vw, 1.75rem);
	gap: 0;
	box-sizing: border-box;
}

.yala-shop-preview__art .yala-shop-preview__visual {
	flex: 1 1 auto;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.yala-shop-preview__nav-host:empty {
	display: none;
}

.yala-shop-preview__nav-host:not(:empty) {
	display: block;
	margin-top: auto;
	align-self: stretch;
	width: 100%;
	padding-top: 0.85rem;
}

.yala-shop-preview__specs-wrap {
	position: relative;
	padding: 0.35rem var(--yala-preview-pad-x, 1.25rem) 0;
	margin: 0;
}

.yala-shop-preview__specs {
	padding: 0;
	margin: 0;
}

.yala-shop-preview__buy {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	align-self: stretch;
	width: auto;
	margin: auto var(--yala-preview-pad-x, 1.25rem) 0;
	min-height: 2.85rem;
	padding: 0.85rem 1rem;
	border-radius: 0;
	background-color: var(--yala-accent, #006064);
	background-image: linear-gradient(rgba(0, 45, 48, 0.25), rgba(0, 45, 48, 0.25)), var(--yala-teal-paper, none);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: #fff;
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.15s ease, filter 0.15s ease;
}

.yala-shop-preview__buy:focus-visible{
	background-color: var(--yala-accent-dark, #004246);
	background-image: linear-gradient(rgba(0, 45, 48, 0.45), rgba(0, 45, 48, 0.45)), var(--yala-teal-paper, none);
	color: #fff;
	text-decoration: none;
	outline: none;
}

@media (hover: hover) and (pointer: fine) {
	.yala-shop-preview__buy:hover {
		background-color: var(--yala-accent-dark, #004246);
		background-image: linear-gradient(rgba(0, 45, 48, 0.45), rgba(0, 45, 48, 0.45)), var(--yala-teal-paper, none);
		color: #fff;
		text-decoration: none;
		outline: none;
}
}

.yala-shop-preview__buy.is-disabled,
.yala-shop-preview__buy[aria-disabled="true"] {
	opacity: 0.5;
	pointer-events: none;
}

.yala-shop-preview__nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0;
	min-height: 2.85rem;
	border: 1px solid rgba(42, 27, 26, 0.14);
	background: rgba(42, 27, 26, 0.025);
	border-radius: 0;
	box-sizing: border-box;
}

.yala-shop-preview__dir {
	box-sizing: border-box;
	min-height: 2.85rem;
	padding: 0.7rem 0.85rem;
	border: 0;
	border-right: 1px solid rgba(42, 27, 26, 0.14);
	background: transparent;
	font-family: var(--yala-font-sans, "Google Sans", system-ui, sans-serif);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(42, 27, 26, 0.72);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.yala-shop-preview__dir:last-child {
	border-right: 0;
	color: #1565c0;
}

.yala-shop-preview__dir:focus-visible{
	background: rgba(42, 27, 26, 0.05);
	outline: none;
}

@media (hover: hover) and (pointer: fine) {
	.yala-shop-preview__dir:hover {
		background: rgba(42, 27, 26, 0.05);
		outline: none;
}
}

.yala-shop-preview__dir:disabled {
	opacity: 0.35;
	cursor: default;
}

.yala-shop-preview__visual {
	position: relative;
	cursor: crosshair;
}

.yala-shop-preview__visual img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(78vh, 38rem);
	object-fit: contain;
}

/* Zoom overlays the right panel; shell stays overflow:visible for the ribbon fold. */
.yala-shop-preview.yala-home-preview {
	overflow: auto;
}

.yala-shop-zoom {
	position: absolute;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	pointer-events: none;
	z-index: 8;
	border: 1px solid rgba(42, 27, 26, 0.18);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
	border-radius: 2px;
	overflow: hidden;
	background: #111;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease, visibility 0.12s ease;
}

.yala-shop-zoom.is-visible {
	opacity: 1;
	visibility: visible;
}

.yala-shop-zoom[hidden] {
	display: block !important;
	opacity: 0;
	visibility: hidden;
}

.yala-shop-zoom__lens {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	pointer-events: none;
}

@media (max-width: 719px), (hover: none), (pointer: coarse) {
	.yala-shop-preview__visual {
		cursor: default;
	}

	.yala-shop-zoom {
		display: none !important;
	}
}

.yala-shop-preview.is-no-zoom .yala-shop-preview__visual {
	cursor: default;
}

.yala-shop-preview.is-no-zoom .yala-shop-zoom {
	display: none !important;
}

.yala-shop-specs__link {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	color: #1565c0;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
}

.yala-shop-specs__link:focus-visible{
	color: #0d47a1;
	outline: none;
}

@media (hover: hover) and (pointer: fine) {
	.yala-shop-specs__link:hover {
		color: #0d47a1;
		outline: none;
}
}

.yala-livro-gate-modal .yala-home-preview__shell {
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	max-width: min(52rem, calc(100vw - 1.5rem));
}

.yala-livro-gate-modal__body {
	padding: 0 var(--yala-preview-pad-x, 1.25rem) 1rem;
}

.yala-livro-gate-modal .yala-email-capture--gate {
	padding: 0;
	background: transparent;
	box-shadow: none;
}

.yala-livro-gate-modal .yala-email-capture__heading {
	display: none;
}

/*
 * Mobile shop product modal: copy first, photo, nav.
 * Viewport scrolls (shared home-preview rule); shell is the cream card.
 */
@media (max-width: 959px) {
	.yala-shop-preview.yala-home-preview {
		padding: 0.85rem;
		background: transparent;
		border-radius: 0;
		box-shadow: none;
		height: 100dvh;
		max-height: 100dvh;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.yala-shop-preview .yala-home-preview__shell {
		grid-template-columns: 1fr;
		overflow: hidden;
		background: #fffef9;
		border-radius: 10px;
		box-shadow: 0 18px 48px rgba(42, 27, 26, 0.28);
	}

	.yala-shop-preview .yala-home-preview__copy {
		order: 1;
		border-radius: 0;
		box-shadow: none;
		background: #fffef9;
	}

	.yala-shop-preview .yala-home-preview__art.yala-shop-preview__art {
		order: 2;
		border-radius: 0;
		padding: 0;
		background: #fffef9;
		background-image: none;
		overflow: hidden;
	}

	.yala-shop-preview .yala-home-preview__visual,
	.yala-shop-preview .yala-shop-preview__visual {
		max-width: 100%;
		width: 100%;
		box-sizing: border-box;
		padding: 0.75rem 0.75rem 0;
		background: #fffef9;
	}

	.yala-shop-preview .yala-home-preview__visual img,
	.yala-shop-preview .yala-shop-preview__visual img {
		display: block;
		width: 100%;
		height: auto;
		max-height: none;
		object-fit: cover;
		border: 0 !important;
		box-shadow: none !important;
		border-radius: 0;
		outline: 0;
	}

	.yala-shop-preview .yala-shop-preview__nav-host:not(:empty) {
		padding: 0.75rem 0 0;
		margin-top: 0;
		background: #fffef9;
	}

	.yala-shop-preview .yala-shop-preview__nav {
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		background: #fffef9;
	}
}
