/*
 * Pret by Alina – animation layer.
 * Loaded only when Customize → Pret by Alina Options → Animations is on.
 * Phones with "Reduce motion" / "Remove animations" turned on (common with
 * Android battery saver) get gentle fades only: nothing moves, slides or loops.
 */

.alina-anim { --an-d: .75s; --an-step: 70ms; --an-dist: 26px; --an-ease: cubic-bezier(.22, .61, .36, 1); }
.alina-anim--speed-1 { --an-d: 1.1s; --an-step: 110ms; }
.alina-anim--speed-3 { --an-d: .5s; --an-step: 45ms; }
@media (max-width: 767px) { .alina-anim { --an-dist: 16px; --an-step: 50ms; } }

@keyframes alina-an-up { from { opacity: 0; transform: translate3d(0, var(--an-dist), 0); } to { opacity: 1; transform: none; } }
@keyframes alina-an-left { from { opacity: 0; transform: translate3d(-40px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes alina-an-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes alina-an-pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes alina-an-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes alina-an-curtain { from { clip-path: inset(0 0 100% 0); transform: scale(1.12); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes alina-an-star { 0% { opacity: .15; transform: scale(.4) rotate(-30deg); } 70% { transform: scale(1.25); } 100% { opacity: 1; transform: none; } }
@keyframes alina-an-ring { 0% { box-shadow: 0 0 0 0 rgba(107, 16, 41, .35); } 100% { box-shadow: 0 0 0 14px rgba(107, 16, 41, 0); } }
@keyframes alina-an-wiggle { 0%, 82%, 100% { transform: none; } 85% { transform: rotate(-12deg); } 89% { transform: rotate(10deg); } 93% { transform: rotate(-6deg); } 96% { transform: rotate(3deg); } }
@keyframes alina-an-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@keyframes alina-an-soft-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes alina-an-grow { from { width: 0; } }
@keyframes alina-an-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media all {

	/* ---------- 1. Scroll reveal: single blocks ---------- */
	.alina-js-anim .alina-anim :is(
		.alina-heading,
		.alina-page-banner .alina-breadcrumb,
		.alina-page-banner__title,
		.alina-page-banner__sub,
		.alina-banner__content,
		.alina-newsletter__inner,
		.alina-shop__toolbar,
		.alina-entry > *,
		.alina-contact-form,
		.single-product div.product .woocommerce-product-gallery,
		.single-product div.product .summary,
		.single-product .woocommerce-tabs,
		.single-product .related > h2,
		.single-product .upsells > h2,
		.alina-wishlist,
		.alina-empty
	):not(.is-in) { opacity: 0; }

	.alina-anim .is-in:is(
		.alina-heading,
		.alina-page-banner .alina-breadcrumb,
		.alina-page-banner__title,
		.alina-page-banner__sub,
		.alina-newsletter__inner,
		.alina-shop__toolbar,
		.alina-entry > *,
		.alina-contact-form,
		.single-product div.product .woocommerce-product-gallery,
		.single-product div.product .summary,
		.single-product .woocommerce-tabs,
		.single-product .related > h2,
		.single-product .upsells > h2,
		.alina-wishlist,
		.alina-empty
	) { animation: alina-an-up var(--an-d) var(--an-ease) backwards; animation-delay: var(--an-delay, 0s); }

	/* Page banner: title first, then breadcrumb / description. */
	.alina-anim .alina-page-banner__title { --an-delay: 0s; }
	.alina-anim .alina-page-banner .alina-breadcrumb { --an-delay: .15s; }
	.alina-anim .alina-page-banner__sub { --an-delay: .25s; }
	.alina-anim .single-product div.product .summary { --an-delay: .12s; }

	/* Banner text slides in from the left. */
	.alina-anim .alina-banner__content.is-in { animation: alina-an-left calc(var(--an-d) * 1.2) var(--an-ease) backwards; }

	/* Heading side lines draw outwards. */
	.alina-anim .alina-heading__title::before, .alina-anim .alina-heading__deco--l { transform-origin: right center; }
	.alina-anim .alina-heading__title::after, .alina-anim .alina-heading__deco--r { transform-origin: left center; }
	.alina-anim .alina-heading.is-in .alina-heading__title::before,
	.alina-anim .alina-heading.is-in .alina-heading__title::after,
	.alina-anim .alina-heading.is-in .alina-heading__deco { animation: alina-an-line calc(var(--an-d) * 1.3) var(--an-ease) .2s backwards; }
	.alina-anim .alina-heading.is-in .alina-heading__sub { animation: alina-an-fade var(--an-d) ease .25s backwards; }

	/* ---------- 2. Scroll reveal: groups (children one after another) ---------- */
	.alina-js-anim .alina-anim :is(
		.alina-grid,
		.alina-cats__grid,
		.alina-reviews__grid,
		.alina-gallery__grid,
		.alina-features__grid,
		.alina-why__grid,
		.alina-chips,
		.alina-footer__grid,
		ul.products
	):not(.is-in) > * { opacity: 0; }

	.alina-anim :is(.alina-grid, .alina-cats__grid, .alina-reviews__grid, .alina-gallery__grid, .alina-chips, .alina-footer__grid, ul.products).is-in > * {
		animation: alina-an-up var(--an-d) var(--an-ease) backwards;
		animation-delay: calc(var(--i, 0) * var(--an-step));
	}
	.alina-anim .alina-chips.is-in > * { animation-name: alina-an-left; }

	/* Feature strip + Why Choose: icons pop in. */
	.alina-anim :is(.alina-features__grid, .alina-why__grid).is-in > * { animation: alina-an-fade var(--an-d) ease backwards; animation-delay: calc(var(--i, 0) * var(--an-step) * 1.6); }
	.alina-anim :is(.alina-features__grid, .alina-why__grid).is-in :is(.alina-features__icon, .alina-why__icon) {
		animation: alina-an-pop calc(var(--an-d) * .9) var(--an-ease) backwards;
		animation-delay: calc(var(--i, 0) * var(--an-step) * 1.6 + .1s);
	}
	/* Why Choose: soft ring around the icon. */
	.alina-anim .alina-why__grid.is-in .alina-why__icon { animation: alina-an-pop calc(var(--an-d) * .9) var(--an-ease) backwards, alina-an-ring 1.4s ease-out backwards; animation-delay: calc(var(--i, 0) * var(--an-step) * 1.6 + .1s), calc(var(--i, 0) * var(--an-step) * 1.6 + .5s); }

	/* Gallery: curtain reveal. */
	.alina-anim .alina-gallery__grid.is-in > * img { animation: alina-an-curtain calc(var(--an-d) * 1.4) var(--an-ease) backwards; animation-delay: calc(var(--i, 0) * var(--an-step) * 1.4); }

	/* Reviews: stars fill one by one. */
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on svg { animation: alina-an-star .45s var(--an-ease) backwards; }
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on:nth-child(1) svg { animation-delay: .35s; }
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on:nth-child(2) svg { animation-delay: .47s; }
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on:nth-child(3) svg { animation-delay: .59s; }
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on:nth-child(4) svg { animation-delay: .71s; }
	.alina-anim .alina-reviews__grid.is-in .alina-stars span.on:nth-child(5) svg { animation-delay: .83s; }
	.alina-anim .alina-stars span { display: inline-flex; }

	/* ---------- 3. Header hide on scroll down / show on scroll up ---------- */
	.alina-anim.alina-header-autohide.alina-sticky-header .alina-header { transition: transform .35s var(--an-ease), box-shadow .3s; }
	.alina-anim.alina-header-autohide.alina-sticky-header .alina-header.is-hidden { transform: translateY(-110%); }
	.alina-anim.alina-header-autohide.alina-lock .alina-header.is-hidden { transform: none; }

	/* ---------- 4. Buttons: colour sweep + arrow nudge ---------- */
	.alina-anim .alina-btn:not(.alina-btn--outline):not(.alina-card__atc) {
		background-image: linear-gradient(var(--alina-primary-2), var(--alina-primary-2));
		background-repeat: no-repeat; background-position: left center; background-size: 0% 100%;
		transition: background-size .45s var(--an-ease), background-color .25s, transform .2s, box-shadow .25s;
	}
	.alina-anim .alina-btn:not(.alina-btn--outline):not(.alina-card__atc):hover { background-size: 100% 100%; background-color: var(--alina-primary); }
	.alina-anim .alina-btn .alina-icon { transition: transform .3s var(--an-ease); }
	.alina-anim .alina-btn:hover .alina-icon { transform: translateX(4px); }

	/* Product card: Add to Cart fills from the bottom on hover. */
	.alina-anim .alina-card a.alina-card__atc {
		background-color: #fff !important;
		background-image: linear-gradient(var(--alina-primary), var(--alina-primary)) !important;
		background-repeat: no-repeat !important; background-position: center bottom !important; background-size: 100% 0% !important;
		transition: background-size .35s var(--an-ease), color .25s, border-color .25s !important;
	}
	.alina-anim .alina-card:hover a.alina-card__atc,
	.alina-anim .alina-card a.alina-card__atc.added { background-size: 100% 100% !important; color: #fff !important; border-color: var(--alina-primary) !important; }
	.alina-anim .alina-card a.alina-card__atc.added::after { content: "\2713"; margin-left: 2px; display: inline-block; animation: alina-an-pop .45s var(--an-ease); }

	/* ---------- 5. Homepage extras ---------- */
	/* Hero dots: active dot fills like a progress bar. */
	.alina-anim .alina-hero[data-autoplay="true"] .alina-hero__dots button { position: relative; overflow: hidden; }
	.alina-anim .alina-hero[data-autoplay="true"] .alina-hero__dots button.is-active { width: 34px; background: rgba(107, 16, 41, .3); }
	.alina-anim .alina-hero[data-autoplay="true"] .alina-hero__dots button.is-active::after {
		content: ""; position: absolute; inset: 0; background: var(--alina-primary); transform-origin: left;
		animation: alina-an-progress var(--alina-hero-speed, 5000ms) linear both;
	}
	.alina-anim .alina-hero.is-paused .alina-hero__dots button.is-active::after { animation-play-state: paused; }

	/* Banner parallax (desktop only, driven by JS). */
	.alina-anim .alina-banner__bg img { will-change: transform; }

	/* Newsletter: mail icon wiggles now and then; success tick. */
	.alina-anim .alina-newsletter__icon { animation: alina-an-wiggle 5s ease-in-out infinite; transform-origin: 50% 20%; }
	.alina-anim .alina-newsletter__msg:not(:empty) { animation: alina-an-up .45s var(--an-ease); }
	.alina-anim .alina-newsletter__msg.is-success::before { content: "\2713"; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: #fff; color: var(--alina-primary); font-weight: 700; font-size: 12px; animation: alina-an-pop .5s var(--an-ease); }

	/* ---------- 6. Product page (CRO) ---------- */
	.alina-anim .alina-buy-now { position: relative; overflow: hidden; }
	.alina-anim .alina-buy-now::after {
		content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
		background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .45) 50%, rgba(255, 255, 255, 0) 100%);
		animation: alina-an-shine 3.6s ease-in-out infinite;
	}
	.alina-anim .alina-urgency .alina-icon { animation: alina-an-soft-pulse 1.6s ease-in-out infinite; }
	.alina-anim .alina-urgency { animation: alina-an-fade .6s ease .4s backwards; }
	.alina-anim .alina-freeship__bar span { animation: alina-an-grow 1.1s var(--an-ease) .2s backwards; transition: width .6s var(--an-ease); }
	.alina-anim .woocommerce-product-gallery__image img { transition: opacity .4s ease; }

	/* ---------- 7. Forms (contact, account, etc.) ---------- */
	.alina-anim .alina-contact-form label { display: inline-block; transition: color .25s, transform .25s var(--an-ease); }
	.alina-anim .alina-contact-form p:focus-within label { color: var(--alina-primary); transform: translateX(4px); }
	.alina-anim .alina-contact-form :is(input, textarea),
	.alina-anim .woocommerce form .form-row :is(input.input-text, textarea) { transition: border-color .25s, box-shadow .3s; }
	.alina-anim .alina-contact-form :is(input, textarea):focus,
	.alina-anim .woocommerce form .form-row :is(input.input-text, textarea):focus { border-color: var(--alina-primary); box-shadow: 0 0 0 4px rgba(107, 16, 41, .1); }
}

/* ---------- Reduced motion: fades only, nothing moves or loops ---------- */
@media (prefers-reduced-motion: reduce) {
	.alina-anim:not(.alina-anim--full) { --an-dist: 0px; }
	.alina-anim:not(.alina-anim--full) .is-in, .alina-anim:not(.alina-anim--full) .is-in > *, .alina-anim:not(.alina-anim--full) .alina-banner__content.is-in, .alina-anim:not(.alina-anim--full) .alina-chips.is-in > * { animation-name: alina-an-fade !important; }
	.alina-anim:not(.alina-anim--full) .alina-heading.is-in .alina-heading__title::before,
	.alina-anim:not(.alina-anim--full) .alina-heading.is-in .alina-heading__title::after,
	.alina-anim:not(.alina-anim--full) .alina-heading.is-in .alina-heading__deco,
	.alina-anim:not(.alina-anim--full) .alina-gallery__grid.is-in > * img,
	.alina-anim:not(.alina-anim--full) .alina-reviews__grid.is-in .alina-stars span.on svg,
	.alina-anim:not(.alina-anim--full) :is(.alina-features__grid, .alina-why__grid).is-in :is(.alina-features__icon, .alina-why__icon),
	.alina-anim:not(.alina-anim--full) .alina-newsletter__icon,
	.alina-anim:not(.alina-anim--full) .alina-buy-now::after,
	.alina-anim:not(.alina-anim--full) .alina-urgency .alina-icon { animation: none !important; }
	.alina-anim:not(.alina-anim--full).alina-header-autohide .alina-header.is-hidden { transform: none; }
}
