/**
 * Homepage-only sections: hero, new-arrivals scroller, why-shop, newsletter.
 * Category bento / promo bento reuse the shared .bento-grid component.
 */

/* Hero — dark spotlight with product stage ------------------------------------ */
.hx {
	--hx-bg: #070D19;
	--hx-line: rgba(255, 255, 255, 0.1);
	--hx-soft: rgba(247, 248, 250, 0.68);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--hx-bg);
	color: var(--color-text-on-primary);
	padding-block: clamp(3rem, 7vw, 6.5rem);
}

.hx__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hx__glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.hx__glow--a { width: 46vw; height: 46vw; right: -8vw; top: -14vw; background: rgba(47, 111, 237, 0.42); }
.hx__glow--b { width: 30vw; height: 30vw; left: -10vw; bottom: -16vw; background: rgba(255, 90, 31, 0.22); }
.hx__dots {
	position: absolute; inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
	background-size: 26px 26px;
	mask-image: linear-gradient(115deg, transparent 20%, #000 60%, transparent 95%);
}

.hx__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: clamp(2.5rem, 5vw, 5rem);
	align-items: center;
}

/* Copy */
.hx__eyebrow {
	display: inline-flex; align-items: center; gap: var(--space-2);
	padding: 0.45rem 0.95rem;
	border: 1px solid var(--hx-line);
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, 0.04);
	font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em;
	color: var(--hx-soft);
	margin-bottom: var(--space-5);
}
.hx__pulse {
	width: 0.5rem; height: 0.5rem; border-radius: 50%;
	background: var(--color-success);
	box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
	animation: hx-pulse 2s infinite;
}
@keyframes hx-pulse {
	70% { box-shadow: 0 0 0 0.5rem rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.hx__title {
	font-size: clamp(1.875rem, 1.45rem + 1.8vw, 3rem);
	line-height: 1.15;
	letter-spacing: -0.025em;
	color: #fff;
	margin-bottom: var(--space-5);
}
.hx__title a { color: inherit; }
.hx__title a:hover { color: #fff; opacity: 0.85; }
.hx__desc { font-size: var(--fs-md); line-height: var(--lh-normal); color: var(--hx-soft); max-width: 44ch; margin-bottom: var(--space-7); }

.hx__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hx__btn {
	display: inline-flex; align-items: center; gap: var(--space-4);
	border: 0; cursor: pointer; font-family: inherit;
	padding: 0.4rem 0.4rem 0.4rem 1.75rem;
	border-radius: var(--radius-pill);
	font-weight: 600; font-size: var(--fs-md);
	transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.hx__btn-icon {
	flex-shrink: 0;
	width: 3.25rem; height: 3.25rem;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	background: #fff;
	color: var(--color-conversion);
	transition: transform var(--duration-base) var(--ease-out);
}
.hx__btn-icon .icon { width: 1.25rem; height: 1.25rem; }
.hx__btn--solid { background: var(--color-conversion); color: #fff; box-shadow: 0 10px 30px -8px rgba(255, 90, 31, 0.6); }
.hx__btn--solid:hover { background: var(--color-conversion-hover); color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(255, 90, 31, 0.7); }
a.hx__btn--solid:hover .hx__btn-icon { transform: rotate(-45deg); }
button.hx__btn--solid:hover .hx__btn-icon { transform: scale(1.08); }

/* Prev / next — static outlined circles on the hero's left and right edges */
.hx__nav-btn {
	position: absolute;
	top: 50%;
	z-index: 5;
	width: 3.5rem; height: 3.5rem;
	margin-top: -1.75rem;
	display: flex; align-items: center; justify-content: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 50%;
	background: rgba(7, 13, 25, 0.35);
	color: #fff;
	cursor: pointer;
}
.hx__nav-btn--prev { left: clamp(0.75rem, 1.5vw, 1.5rem); }
.hx__nav-btn--next { right: clamp(0.75rem, 1.5vw, 1.5rem); }
.hx__nav-btn .icon { width: 1.25rem; height: 1.25rem; }
.hx__nav-btn:hover { background: #fff; border-color: #fff; color: var(--color-primary); }
.hx__nav-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.hx__btn.is-loading { opacity: 0.75; pointer-events: none; }
.hx__btn.is-loading .hx__btn-icon { animation: hx-spin 0.9s linear infinite; }
.hx__btn.is-added { background: var(--color-success); box-shadow: 0 10px 30px -8px rgba(22, 163, 74, 0.6); }
.hx__btn.is-added .hx__btn-icon { color: var(--color-success); }
@keyframes hx-spin { to { transform: rotate(360deg); } }

/* Stage — bare product PNG, no frame */
.hx__stage { display: block; }
.hx__img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; }

/* Slides — stacked in one grid cell; parts slide in with a stagger and the
   outgoing slide slides out to the left. */
.hx__slides { display: grid; }
.hx:has(.hx__nav-btn) .hx__slides { padding-inline: calc(var(--container-pad) + 3.5rem); }
.hx__slide {
	grid-area: 1 / 1;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear 700ms;
}
.hx__slide.is-active, .hx__slide.is-leaving { visibility: visible; transition-delay: 0s; }
.hx__slide.is-active { pointer-events: auto; }

.hx__copy > *, .hx__stage {
	opacity: 0;
	transform: translateX(48px);
	transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-out);
}
.hx__stage { transform: translateX(90px) scale(0.92); }

.hx__slide.is-active .hx__copy > *, .hx__slide.is-active .hx__stage { opacity: 1; transform: none; }
.hx__slide.is-active .hx__copy > :nth-child(2) { transition-delay: 80ms; }
.hx__slide.is-active .hx__copy > :nth-child(3) { transition-delay: 160ms; }
.hx__slide.is-active .hx__copy > :nth-child(4) { transition-delay: 240ms; }
.hx__slide.is-active .hx__stage { transition-delay: 120ms; transition-duration: 700ms, 1000ms; }

.hx__slide.is-leaving .hx__copy > * { opacity: 0; transform: translateX(-48px); transition-duration: 450ms; }
.hx__slide.is-leaving .hx__stage { opacity: 0; transform: translateX(-60px) scale(0.92); transition-duration: 450ms; }

/* Going back: enter from the left, leave to the right. */
.hx.is-reverse .hx__slide:not(.is-active) .hx__copy > * { transform: translateX(-48px); }
.hx.is-reverse .hx__slide:not(.is-active) .hx__stage { transform: translateX(-90px) scale(0.92); }
.hx.is-reverse .hx__slide.is-leaving .hx__copy > * { transform: translateX(48px); }
.hx.is-reverse .hx__slide.is-leaving .hx__stage { transform: translateX(60px) scale(0.92); }

@media (max-width: 1024px) {
	.hx__grid { grid-template-columns: minmax(0, 1fr); }
	.hx__stage { max-width: 460px; width: 100%; margin-inline: auto; }
	.hx__img { max-height: 420px; }
}
@media (max-width: 640px) {
	.hx__actions .hx__btn { flex: 1 1 auto; justify-content: space-between; }
	.hx:has(.hx__nav-btn) { padding-bottom: 6rem; }
	.hx:has(.hx__nav-btn) .hx__slides { padding-inline: var(--container-pad); }
	.hx__nav-btn { top: auto; bottom: 1.75rem; margin-top: 0; }
	.hx__nav-btn--prev { left: calc(50% - 4rem); }
	.hx__nav-btn--next { right: calc(50% - 4rem); }
	.hx__glow--a { width: 90vw; height: 90vw; }
}
@media (prefers-reduced-motion: reduce) {
	.hx__pulse, .hx__btn.is-loading .hx__btn-icon { animation: none; }
	.hx__copy > *, .hx__stage { transition: none; }
}

/* New arrivals carousel ------------------------------------------------------ */
.new-arrivals__scroller {
	display: flex;
	gap: var(--space-5);
	overflow-x: auto;
	/* overflow-y must be a non-"visible" value (hidden, not visible) — if
	   either axis is "visible" while the other isn't, the spec forces BOTH
	   to compute as "auto", which is what was showing a vertical scrollbar
	   here. "hidden" avoids that entirely; the padding below keeps the
	   product card's hover lift + shadow from actually being clipped. */
	overflow-y: hidden;
	padding: var(--space-4) var(--space-2) var(--space-4);
	margin: calc(var(--space-4) * -1) calc(var(--space-2) * -1) calc(var(--space-4) * -1);
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	/* Native scrollbar hidden — the carousel arrows + drag/touch are the
	   intended way to move through it. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.new-arrivals__scroller:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.new-arrivals__scroller::-webkit-scrollbar { display: none; }
.new-arrivals__item {
	flex: 0 0 clamp(320px, 36vw, 420px);
	scroll-snap-align: start;
}
.new-arrivals__item .product-card--landscape { height: 100%; }
@media (max-width: 480px) {
	.new-arrivals__item { flex-basis: 260px; }
}

.carousel-controls { display: flex; gap: var(--space-2); flex-shrink: 0; }
.carousel-arrow {
	width: 2.75rem; height: 2.75rem;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-text);
	background: var(--color-surface);
	transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.carousel-arrow:hover { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.carousel-arrow:disabled { opacity: 0.35; pointer-events: none; }

@media (max-width: 560px) {
	.carousel-controls { display: none; }
}

/* Why shop ------------------------------------------------------------------ */
.why-shop__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
@media (max-width: 900px) { .why-shop__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .why-shop__grid { grid-template-columns: 1fr; } }

/* Newsletter ------------------------------------------------------------------ */
.newsletter__box {
	position: relative;
	background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
	color: var(--color-text-on-primary);
	border-radius: var(--radius-lg);
	padding: var(--space-8);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--space-6);
	overflow: hidden;
}
.newsletter__icon {
	width: 3.25rem; height: 3.25rem;
	flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(247,248,250,0.1);
	border-radius: var(--radius-md);
	color: var(--color-text-on-primary);
}
.newsletter__icon .icon { width: 1.5rem; height: 1.5rem; }
.newsletter__text { flex: 1 1 260px; }
.newsletter__text h2 { color: var(--color-text-on-primary); margin-bottom: var(--space-2); }
.newsletter__text p { color: rgba(247,248,250,0.7); margin: 0; }
.newsletter__form-wrap { flex: 1 1 360px; max-width: 420px; }
.newsletter__form {
	display: flex;
	background: rgba(247,248,250,0.08);
	border: 1px solid rgba(247,248,250,0.25);
	border-radius: var(--radius-pill);
	padding: 0.35rem 0.35rem 0.35rem 1.25rem;
	gap: var(--space-2);
}
.newsletter__form input {
	background: transparent;
	border: none;
	color: var(--color-text-on-primary);
	padding: 0.6rem 0;
	flex-grow: 1;
	min-width: 0;
}
.newsletter__form input:focus { box-shadow: none; }
.newsletter__form input::placeholder { color: rgba(247,248,250,0.5); }
.newsletter__form .btn { flex-shrink: 0; }
.newsletter .form-status { color: rgba(247,248,250,0.9); margin-top: var(--space-2); text-align: right; }

@media (max-width: 640px) {
	.newsletter__box { flex-direction: column; align-items: flex-start; text-align: left; }
	.newsletter__form-wrap { max-width: none; width: 100%; }
	.newsletter__form { flex-wrap: wrap; border-radius: var(--radius-md); padding: var(--space-3); }
	.newsletter__form input { width: 100%; padding: 0.5rem 0.25rem; }
	.newsletter__form .btn { width: 100%; }
}
