/**
 * Achol Core — Front-end Block Styles
 *
 * Styles for all Achol blocks (Hero Banner, Product Grid, Promo
 * Popup). Mobile-first: base rules target small screens, then
 * min-width media queries progressively enhance for tablet (768px)
 * and desktop (1024px).
 */

:root {
	--achol-primary: #FF751F;
	--achol-primary-hover: #E86817;
	--achol-secondary: #000000;
	--achol-bg: #FFFFFF;
	--achol-surface: #F8F8F8;
	--achol-border: #E5E5E5;
	--achol-text-primary: #222222;
	--achol-text-secondary: #666666;
	--achol-success: #16A34A;
	--achol-warning: #F59E0B;
	--achol-danger: #DC2626;
}

/* -----------------------------------------------------------------
 * Shared Component: Button (used across all Achol blocks)
 * ----------------------------------------------------------------- */

.achol-btn {
	display: inline-block;
	box-sizing: border-box;
	padding: 12px 24px;
	min-height: 44px;
	background-color: var(--achol-primary);
	color: var(--achol-secondary);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.achol-btn:hover,
.achol-btn:focus {
	background-color: var(--achol-primary-hover);
	color: var(--achol-secondary);
}

.achol-btn:focus-visible {
	outline: 2px solid var(--achol-secondary);
	outline-offset: 2px;
}

/* Outline variant — used for secondary actions like "Buy Now" so it
   doesn't visually compete with the primary "Add to Cart" button. */
.achol-btn--outline {
	background-color: transparent;
	border: 2px solid var(--achol-secondary);
	color: var(--achol-secondary);
}

.achol-btn--outline:hover,
.achol-btn--outline:focus {
	background-color: var(--achol-secondary);
	color: #FFFFFF;
}

.achol-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* -----------------------------------------------------------------
 * Hero Banner
 * ----------------------------------------------------------------- */

.achol-hero-banner {
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	width: 100%;
	min-height: 280px;
	background-color: var(--achol-surface);
	display: flex;
}

.achol-hero-banner * {
	box-sizing: border-box;
}

.achol-hero-banner__image {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	z-index: 1;
}

.achol-hero-banner__overlay {
	position: relative;
	z-index: 2;
	width: 100%;
	display: flex;
	align-items: center;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0) 100%);
	padding: 32px 20px;
}

.achol-hero-banner__content {
	max-width: 100%;
	color: #FFFFFF;
}

.achol-hero-banner__title {
	margin: 0 0 12px 0;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 700;
	color: #FFFFFF;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
	overflow-wrap: break-word;
}

.achol-hero-banner__subtitle {
	margin: 0 0 20px 0;
	font-size: 15px;
	line-height: 1.5;
	color: #FFFFFF;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	overflow-wrap: break-word;
}

.achol-hero-banner__cta {
	margin: 0;
}

/* Alignment variants */
.achol-hero-banner--align-center .achol-hero-banner__overlay {
	justify-content: center;
	text-align: center;
	background: rgba(0, 0, 0, 0.45);
}

.achol-hero-banner--align-center .achol-hero-banner__content {
	max-width: 600px;
}

.achol-hero-banner--align-right .achol-hero-banner__overlay {
	justify-content: flex-end;
	text-align: right;
	background: linear-gradient(270deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0) 100%);
}

/* Tablet */
@media (min-width: 768px) {

	.achol-hero-banner {
		min-height: 380px;
	}

	.achol-hero-banner__overlay {
		padding: 48px 40px;
	}

	.achol-hero-banner__content {
		max-width: 480px;
	}

	.achol-hero-banner__title {
		font-size: 32px;
	}

	.achol-hero-banner__subtitle {
		font-size: 17px;
	}
}

/* Desktop */
@media (min-width: 1024px) {

	.achol-hero-banner {
		min-height: 480px;
	}

	.achol-hero-banner__overlay {
		padding: 64px 80px;
	}

	.achol-hero-banner__content {
		max-width: 560px;
	}

	.achol-hero-banner__title {
		font-size: 42px;
	}

	.achol-hero-banner__subtitle {
		font-size: 18px;
	}
}

/* -----------------------------------------------------------------
 * Product Grid
 * ----------------------------------------------------------------- */

.achol-product-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
	box-sizing: border-box;
}

.achol-product-grid * {
	box-sizing: border-box;
}

.achol-product-grid__item {
	display: flex;
	flex-direction: column;
	background-color: var(--achol-bg);
	border: 1px solid var(--achol-border);
	border-radius: 4px;
	overflow: hidden;
}

.achol-product-grid__image-wrap {
	display: block;
	position: relative;
	width: 100%;
	min-height: 200px;
	aspect-ratio: 3 / 4;
	background-color: var(--achol-surface);
	overflow: hidden;
}

.achol-product-grid__image-wrap:focus-visible {
	outline: 2px solid var(--achol-secondary);
	outline-offset: 2px;
}

.achol-product-grid__image-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

.achol-product-grid__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
	padding: 12px;
}

.achol-product-grid__title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: break-word;
}

.achol-product-grid__title a {
	color: var(--achol-text-primary);
	text-decoration: none;
}

.achol-product-grid__title a:hover,
.achol-product-grid__title a:focus {
	color: var(--achol-primary);
}

.achol-product-grid__title a:focus-visible {
	outline: 2px solid var(--achol-secondary);
	outline-offset: 2px;
}

.achol-product-grid__price {
	font-size: 14px;
	color: var(--achol-text-secondary);
}

.achol-product-grid__price ins {
	color: var(--achol-primary);
	font-weight: 600;
	text-decoration: none;
}

.achol-product-grid__price del {
	color: var(--achol-text-secondary);
	opacity: 0.6;
}

.achol-product-grid__actions {
	margin-top: auto;
	padding-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.achol-product-grid__actions .achol-btn {
	display: block;
	width: 100%;
	font-size: 13px;
	padding: 10px 16px;
}

/* Uses the existing brand "Success" token — close to WhatsApp's own
   green — so no new color is introduced outside the fixed palette. */
.achol-product-grid__whatsapp {
	background-color: var(--achol-success);
}

.achol-product-grid__whatsapp:hover,
.achol-product-grid__whatsapp:focus {
	filter: brightness(0.92);
}

.achol-product-grid__empty {
	padding: 24px;
	text-align: center;
	color: var(--achol-text-secondary);
}

/* Tablet: respect a max of 3 columns regardless of configured value,
   to avoid cramped cards on medium screens. */
@media (min-width: 768px) {

	.achol-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}
}

/* Desktop: honor the exact column count configured via shortcode. */
@media (min-width: 1024px) {

	.achol-product-grid {
		grid-template-columns: repeat(var(--achol-grid-cols, 4), minmax(0, 1fr));
		gap: 24px;
	}
}

/* -----------------------------------------------------------------
 * Promo Popup
 * ----------------------------------------------------------------- */

.achol-promo-popup {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.achol-promo-popup * {
	box-sizing: border-box;
}

.achol-promo-popup.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.achol-promo-popup__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
}

.achol-promo-popup__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 360px;
	max-height: 90vh;
	overflow-y: auto;
	background-color: var(--achol-bg);
	border-radius: 6px;
	padding: 28px 20px 24px;
	text-align: center;
}

.achol-promo-popup__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 4px;
	font-size: 24px;
	line-height: 1;
	color: var(--achol-text-secondary);
	cursor: pointer;
}

.achol-promo-popup__close:hover,
.achol-promo-popup__close:focus {
	color: var(--achol-secondary);
}

.achol-promo-popup__close:focus-visible {
	outline: 2px solid var(--achol-secondary);
	outline-offset: 2px;
}

.achol-promo-popup__image {
	margin-bottom: 16px;
	border-radius: 4px;
	overflow: hidden;
}

.achol-promo-popup__image-el {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.achol-promo-popup__title {
	margin: 0 0 12px 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--achol-text-primary);
	overflow-wrap: break-word;
}

.achol-promo-popup__message {
	margin: 0 0 20px 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--achol-text-secondary);
	overflow-wrap: break-word;
}

.achol-promo-popup__cta .achol-btn {
	display: block;
	width: 100%;
}

/* Prevent background scrolling while a popup is open. */
body.achol-popup-open {
	overflow: hidden;
}

/* Tablet and Desktop: slightly wider dialog. */
@media (min-width: 768px) {

	.achol-promo-popup__dialog {
		max-width: 420px;
		padding: 32px 28px 28px;
	}

	.achol-promo-popup__title {
		font-size: 22px;
	}
}

/* -----------------------------------------------------------------
 * Hero Slider (Multi-Slide)
 * ----------------------------------------------------------------- */

.achol-hero-slider {
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	width: 100%;
	min-height: 100vh;
	min-height: 100svh; /* Progressive enhancement: avoids mobile browser address-bar resize jank that plain 100vh can cause. */
	background-color: var(--achol-surface);
}

.achol-hero-slider *,
.achol-hero-slider *::before,
.achol-hero-slider *::after {
	box-sizing: border-box;
}

.achol-hero-slider:focus-visible {
	outline: 2px solid var(--achol-primary);
	outline-offset: -2px;
}

.achol-hero-slider__track {
	position: relative;
	width: 100%;
	min-height: 100vh;
	min-height: 100svh;
}

.achol-hero-slider__slide {
	position: absolute;
	inset: 0;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease;
	z-index: 1;
}

.achol-hero-slider__slide.is-active {
	position: relative;
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

/* When the Custom Header reserves its own space at the top of the
 * page (solid/sticky, non-overlapping — see modules/header/), the
 * Hero fills exactly the remaining viewport height, so Header +
 * Hero together always fill the full screen. When the Header is
 * transparent-and-overlapping instead (no body.achol-header-space-
 * reserved class), the base 100vh/100svh rules above already apply
 * — the Hero itself is the full screen and the Header floats over
 * it. --achol-header-height / --achol-header-height-desktop are
 * defined in achol-header.css; the fallback values here keep this
 * safe even if the Header is ever disabled. */
body.achol-header-space-reserved .achol-hero-slider,
body.achol-header-space-reserved .achol-hero-slider__track,
body.achol-header-space-reserved .achol-hero-slider__slide {
	min-height: calc(100vh - var(--achol-header-height, 72px));
	min-height: calc(100svh - var(--achol-header-height, 72px));
}

@media (min-width: 1024px) {

	body.achol-header-space-reserved .achol-hero-slider,
	body.achol-header-space-reserved .achol-hero-slider__track,
	body.achol-header-space-reserved .achol-hero-slider__slide {
		min-height: calc(100vh - var(--achol-header-height-desktop, 92px));
		min-height: calc(100svh - var(--achol-header-height-desktop, 92px));
	}
}

.achol-hero-slider__picture,
.achol-hero-slider__image {
	position: absolute;
	inset: 0;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	z-index: 1;
	display: block;
}

.achol-hero-slider__overlay {
	position: absolute;
	inset: 0;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, var(--achol-hero-overlay-opacity, 0.4));
	z-index: 2;
}

.achol-hero-slider__content {
	position: relative;
	z-index: 3;
	width: 100%;
	max-width: 560px;
	padding: 32px 20px;
	color: #FFFFFF;
}

.achol-hero-slider__badge {
	display: inline-block;
	margin-bottom: 12px;
	padding: 4px 12px;
	background-color: var(--achol-primary);
	color: var(--achol-secondary);
	font-size: 12px;
	font-weight: 700;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.achol-hero-slider__heading {
	margin: 0 0 12px 0;
	font-size: 26px;
	line-height: 1.25;
	font-weight: 700;
	color: #FFFFFF;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
	overflow-wrap: break-word;
}

.achol-hero-slider__subheading {
	margin: 0 0 20px 0;
	font-size: 15px;
	line-height: 1.5;
	color: #FFFFFF;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	overflow-wrap: break-word;
}

.achol-hero-slider__cta {
	margin: 0;
}

.achol-hero-slider__button {
	display: inline-block;
}

.achol-hero-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, 0.35);
	color: #FFFFFF;
	border: none;
	border-radius: 50%;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.achol-hero-slider__arrow:hover,
.achol-hero-slider__arrow:focus {
	background-color: var(--achol-primary);
	color: var(--achol-secondary);
}

.achol-hero-slider__arrow:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
}

.achol-hero-slider__arrow--prev {
	left: 12px;
}

.achol-hero-slider__arrow--next {
	right: 12px;
}

.achol-hero-slider__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	z-index: 4;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.achol-hero-slider__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
}

.achol-hero-slider__dot:hover,
.achol-hero-slider__dot:focus {
	background-color: rgba(255, 255, 255, 0.8);
}

.achol-hero-slider__dot.is-active {
	background-color: var(--achol-primary);
}

.achol-hero-slider__dot:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
}

.achol-hero-slider__empty {
	padding: 24px;
	text-align: center;
	color: var(--achol-text-secondary);
}

/* Tablet */
@media (min-width: 768px) {

	.achol-hero-slider__content {
		max-width: 620px;
		padding: 48px 40px;
	}

	.achol-hero-slider__heading {
		font-size: 34px;
	}

	.achol-hero-slider__subheading {
		font-size: 17px;
	}

	.achol-hero-slider__arrow {
		width: 52px;
		height: 52px;
	}
}

/* Desktop */
@media (min-width: 1024px) {

	.achol-hero-slider__content {
		max-width: 680px;
		padding: 64px 80px;
	}

	.achol-hero-slider__heading {
		font-size: 44px;
	}

	.achol-hero-slider__subheading {
		font-size: 18px;
	}
}

/* -----------------------------------------------------------------
 * Language Switcher
 *
 * TEMPORARY placement (see includes/language.php docblock) — this
 * component is expected to move visually into the Custom Header
 * module once that phase is built. The underlying [data-lang]
 * visibility mechanism (printed inline in wp_head, not here) does
 * not depend on this component's location.
 * ----------------------------------------------------------------- */

.achol-language-switcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.achol-language-switcher__btn {
	background: transparent;
	border: none;
	padding: 6px 4px;
	min-height: 32px;
	color: var(--achol-text-secondary);
	font-weight: 600;
	cursor: pointer;
}

.achol-language-switcher__btn:hover,
.achol-language-switcher__btn:focus {
	color: var(--achol-primary);
}

.achol-language-switcher__btn:focus-visible {
	outline: 2px solid var(--achol-secondary);
	outline-offset: 2px;
}

.achol-language-switcher__btn.is-active {
	color: var(--achol-secondary);
}

.achol-language-switcher__divider {
	color: var(--achol-border);
}
