/*
 * AfroLamps — Motion System
 *
 * Subtle entrance animations for storefront content.
 * Backgrounds and layout containers remain stationary.
 */

/* ============================================================
   01. CONTENT REVEAL BASE
============================================================ */

html.afro-motion-ready [data-afro-reveal] {
    opacity: 0;

    transition:
        opacity 720ms cubic-bezier(0.2, 0.65, 0.3, 1),
        transform 720ms cubic-bezier(0.2, 0.65, 0.3, 1);

    transition-delay: var(--afro-reveal-delay, 0ms);
}

/* ============================================================
   02. CONTENT REVEAL DIRECTIONS
============================================================ */

/* Gentle upward entrance. */
html.afro-motion-ready [data-afro-reveal="up"] {
    transform: translate3d(0, 20px, 0);
}

/* Editorial entrance from the left. */
html.afro-motion-ready [data-afro-reveal="left"] {
    transform: translate3d(-18px, 0, 0);
}

/* Editorial entrance from the right. */
html.afro-motion-ready [data-afro-reveal="right"] {
    transform: translate3d(18px, 0, 0);
}

/* Opacity-only entrance. */
html.afro-motion-ready [data-afro-reveal="fade"] {
    transform: none;
}

/* Subtle image treatment, only when explicitly requested. */
html.afro-motion-ready [data-afro-reveal="image"] {
    transform: scale(1.025);
    transform-origin: center;
}

/* ============================================================
   03. CONTENT REVEALED STATE
============================================================ */

html.afro-motion-ready [data-afro-reveal].is-afro-revealed,
html.afro-motion-ready [data-afro-reveal]:focus-within {
    opacity: 1;
    transform: none;
}

/* ============================================================
   04. HERO BACKGROUND SEQUENCE
============================================================ */

/*
 * The hero background has its own transition.
 *
 * It fades in independently of the text and buttons.
 * JavaScript adds the visible class only after the image
 * has loaded and the browser has had a chance to paint.
 */

html.afro-motion-ready [data-afro-hero-background] {
    opacity: 0;

    transition:
        opacity 1200ms cubic-bezier(0.2, 0.65, 0.3, 1);

    will-change: opacity;
}

/* Background fade-in complete. */
html.afro-motion-ready
[data-afro-hero].is-afro-hero-background-visible
[data-afro-hero-background] {
    opacity: 1;
}

/* ============================================================
   05. RESPONSIVE ADJUSTMENTS
============================================================ */

@media (max-width: 767px) {

    html.afro-motion-ready [data-afro-reveal="up"] {
        transform: translate3d(0, 14px, 0);
    }

    html.afro-motion-ready [data-afro-reveal="left"] {
        transform: translate3d(-12px, 0, 0);
    }

    html.afro-motion-ready [data-afro-reveal="right"] {
        transform: translate3d(12px, 0, 0);
    }

}

/* ============================================================
   06. ACCESSIBILITY
============================================================ */

@media (prefers-reduced-motion: reduce) {

    html.afro-motion-ready [data-afro-reveal],
    html.afro-motion-ready [data-afro-reveal].is-afro-revealed,
    html.afro-motion-ready [data-afro-reveal]:focus-within,
    html.afro-motion-ready [data-afro-hero-background] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        transition-delay: 0ms !important;
        will-change: auto !important;
    }

}
/* ============================================================
   07. AFROLAMPS SCROLL TO TOP
============================================================ */

.afro-scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    color: #DC9C15;
    background: #361105;
    border: 1px solid rgba(220, 156, 21, 0.45);
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(54, 17, 5, 0.18);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(8px);

    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 220ms ease,
        background-color 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.afro-scroll-top svg {
    display: block;
    width: 17px;
    height: 17px;
}

.afro-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.afro-scroll-top:hover {
    color: #361105;
    background: #DC9C15;
    border-color: #DC9C15;
    box-shadow: 0 5px 18px rgba(54, 17, 5, 0.24);
}

.afro-scroll-top:focus-visible {
    outline: 2px solid #DC9C15;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    .afro-scroll-top {
        right: 16px;
        bottom: 16px;
        width: 38px;
        height: 38px;
    }

    .afro-scroll-top svg {
        width: 16px;
        height: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .afro-scroll-top {
        transition: none;
        transform: none;
    }
}

