/* Global motion tokens and accessibility guardrails. */

:root {
    --motion-fast: 160ms;
    --motion-medium: 360ms;
    --motion-slow: 820ms;
    --motion-distance: 16px;
    --ease-premium: cubic-bezier(.22, 1, .36, 1);

    --cz-motion-fast: var(--motion-fast);
    --cz-motion-medium: var(--motion-medium);
    --cz-motion-slow: var(--motion-slow);
    --cz-motion-reveal: var(--motion-slow);
    --cz-motion-lift: var(--motion-distance);
    --cz-motion-ease: var(--ease-premium);
    --cz-motion-ease-soft: cubic-bezier(.16, 1, .3, 1);

    --cz-motion-header-bg: rgba(250, 253, 250, .82);
    --cz-motion-header-shadow: 0 18px 48px rgba(20, 47, 43, .14);
    --cz-botanical-drift-distance: 10px;
}

[data-reveal] {
    --cz-reveal-delay: 0ms;
}

[data-reveal][data-reveal-armed="true"] {
    opacity: 0;
    transform: translate3d(0, var(--motion-distance), 0);
    transition:
        opacity var(--cz-motion-reveal) var(--cz-motion-ease-soft),
        transform var(--cz-motion-reveal) var(--cz-motion-ease-soft);
    transition-delay: var(--cz-reveal-delay);
    will-change: opacity, transform;
}

[data-reveal][data-reveal-armed="true"].is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

[data-reveal-delay="1"] {
    --cz-reveal-delay: 90ms;
}

[data-reveal-delay="2"] {
    --cz-reveal-delay: 180ms;
}

[data-reveal-delay="3"] {
    --cz-reveal-delay: 270ms;
}

[data-reveal-delay="4"] {
    --cz-reveal-delay: 360ms;
}

.site-header {
    background: rgba(255, 255, 255, .34);
    border-bottom-color: rgba(20, 47, 43, .04);
    box-shadow: none;
    transition:
        background-color var(--motion-medium) var(--ease-premium),
        border-color var(--motion-medium) var(--ease-premium),
        box-shadow var(--motion-medium) var(--ease-premium),
        backdrop-filter var(--motion-medium) var(--ease-premium);
}

html.cz-motion-ready .site-header {
    backdrop-filter: blur(0) saturate(1);
    -webkit-backdrop-filter: blur(0) saturate(1);
}

.site-header.is-scrolled {
    background: var(--cz-motion-header-bg);
    border-bottom-color: rgba(20, 47, 43, .14);
    box-shadow: var(--cz-motion-header-shadow);
    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.coguazul-shop-hero__title,
.coguazul-trust__title,
body.post-type-archive-product.woocommerce .page-title,
body.tax-product_cat.woocommerce .page-title,
body.tax-product_tag.woocommerce .page-title,
.catalog-cta__title {
    position: relative;
}

.coguazul-shop-hero__title::after,
.coguazul-trust__title::after,
body.post-type-archive-product.woocommerce .page-title::after,
body.tax-product_cat.woocommerce .page-title::after,
body.tax-product_tag.woocommerce .page-title::after,
.catalog-cta__title::after {
    content: "";
    display: block;
    width: clamp(38px, 5vw, 68px);
    height: 1px;
    margin-top: 16px;
    background: rgba(22, 73, 63, .42);
    transform: scaleX(1);
    transform-origin: left center;
}

.coguazul-trust__title::after,
body.post-type-archive-product.woocommerce .page-title::after,
body.tax-product_cat.woocommerce .page-title::after,
body.tax-product_tag.woocommerce .page-title::after {
    margin-right: auto;
    margin-left: auto;
    transform-origin: center;
}

html.cz-motion-ready [data-reveal][data-reveal-armed="true"] [data-reveal-line]::after {
    transform: scaleX(0);
    transition: transform var(--motion-slow) var(--ease-premium);
    transition-delay: calc(var(--cz-reveal-delay, 0ms) + 160ms);
}

html.cz-motion-ready [data-reveal][data-reveal-armed="true"].is-visible [data-reveal-line]::after {
    transform: scaleX(1);
}

[data-parallax] {
    transform: translate3d(var(--cz-parallax-x, 0px), var(--cz-parallax-y, 0px), 0);
    transition: transform var(--motion-slow) var(--ease-premium);
    will-change: transform;
}

.coguazul-shop-hero {
    isolation: isolate;
}

.coguazul-shop-hero::before {
    transform: translate3d(var(--cz-hero-parallax-x, 0px), var(--cz-hero-parallax-y, 0px), 0) scale(1.02);
    transform-origin: center;
    transition:
        opacity var(--motion-medium) var(--ease-premium),
        transform var(--motion-slow) var(--ease-premium);
    will-change: transform;
}

.coguazul-trust,
.catalog-cta,
.site-footer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.coguazul-trust::before,
.catalog-cta::before {
    content: "";
    position: absolute;
    z-index: 0;
    width: clamp(180px, 24vw, 340px);
    height: clamp(130px, 18vw, 240px);
    pointer-events: none;
    opacity: .045;
    background:
        radial-gradient(ellipse at 48% 28%, rgba(22, 73, 63, .74), rgba(22, 73, 63, 0) 66%);
    clip-path: polygon(44% 0, 72% 12%, 100% 42%, 82% 76%, 48% 100%, 14% 82%, 0 44%, 18% 14%);
    transform: translate3d(0, 0, 0) rotate(-8deg);
    animation: cz-botanical-drift 34s var(--cz-motion-ease-soft) infinite alternate;
}

.coguazul-trust::before {
    right: max(22px, calc(50% - 620px));
    bottom: -72px;
}

.catalog-cta::before {
    top: -80px;
    left: max(16px, calc(50% - 650px));
    animation-duration: 40s;
    animation-direction: alternate-reverse;
}

.coguazul-trust__inner,
.catalog-cta__inner,
.footer-shell {
    position: relative;
    z-index: 1;
}

.footer-shape {
    opacity: .38;
    animation: cz-botanical-drift 36s var(--cz-motion-ease-soft) infinite alternate;
}

@keyframes cz-botanical-drift {
    from {
        transform: translate3d(0, 0, 0) rotate(-8deg);
    }

    to {
        transform: translate3d(0, calc(var(--cz-botanical-drift-distance) * -1), 0) rotate(-6deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        transition-delay: 0ms !important;
    }

    [data-reveal],
    [data-reveal].is-visible,
    [data-reveal][data-reveal-armed="true"],
    [data-parallax],
    .coguazul-shop-hero__content {
        opacity: 1;
        transform: none !important;
        will-change: auto;
    }

    .coguazul-shop-hero,
    .coguazul-shop-hero::before,
    .coguazul-shop-hero::after {
        transform: none !important;
        will-change: auto;
    }

    [data-reveal-line]::after {
        transform: scaleX(1) !important;
    }
}
