/* ==========================================================================
   Royal Manufacture — Custom Smooth Scroll, Hover & Accessibility Animations
   ========================================================================== */

/* A. Smooth Scroll Reveal Primitives (GPU Transform + Opacity Only) */
.rm-reveal,
.rm-anim-item {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.rm-anim-fade-left {
    opacity: 0;
    transform: translate3d(-28px, 0, 0);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-anim-fade-right {
    opacity: 0;
    transform: translate3d(28px, 0, 0);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-anim-zoom {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-anim-clip {
    opacity: 0;
    clip-path: inset(0 0 14% 0);
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-reveal.rm-revealed,
.rm-anim-item.rm-revealed,
.rm-anim-fade-left.rm-revealed,
.rm-anim-fade-right.rm-revealed,
.rm-anim-zoom.rm-revealed,
.rm-anim-clip.rm-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    clip-path: inset(0 0 0% 0);
    will-change: auto;
}

/* Staggered Product Card Entrance (Restores Hebes bottom-to-top queue) */
.rm-product-animate {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-product-animate.rm-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* B. Smooth Hover Transitions (Cards, Buttons, Banners, Contact Boxes, Gallery) */
.product-item-inner {
    transition: box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-item-wrap:hover .product-item-inner {
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.06);
}

.gf-banner .banner-action a {
    position: relative;
    transition: color 0.25s ease, letter-spacing 0.28s ease;
}

.gf-banner:hover .banner-action a {
    color: var(--rm-accent) !important;
}

.btn {
    transition: background-color 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease,
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease;
}

.btn:hover:not(:disabled) {
    transform: translate3d(0, -1px, 0);
}

.btn:active:not(:disabled) {
    transform: translate3d(0, 0, 0);
}

.rm-contact-icon-box {
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.32s ease;
}

.rm-contact-icon-box:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.07);
    border-color: #d5d5d5;
}

.rm-contact-icon-letter {
    transition: background-color 0.28s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-contact-icon-box:hover .rm-contact-icon-letter {
    background-color: var(--rm-accent);
    transform: scale(1.06);
}

/* C. Single Product Gallery Crossfade & Subtle Zoom */
.rm-single-gallery-main {
    overflow: hidden;
}

.rm-single-gallery-main img {
    transition: opacity 0.22s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.rm-single-gallery-main img.is-switching {
    opacity: 0.25;
}

.rm-single-gallery-main:hover img:not(.is-switching) {
    transform: scale(1.03);
}

.rm-single-thumb {
    transition: border-color 0.22s ease, transform 0.22s ease;
}

.rm-single-thumb:hover {
    transform: translate3d(0, -2px, 0);
}

/* D. Mobile Drawer & Accordion Caret Animation */
.mobile-menu .menu-caret::before {
    display: inline-block;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu li.is-expanded > .menu-caret::before {
    transform: rotate(180deg);
}

#mobile-navigation-wrapper.in .mobile-menu > li {
    animation: rmMobileMenuCascade 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(1) { animation-delay: 0.05s; }
#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(2) { animation-delay: 0.09s; }
#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(3) { animation-delay: 0.13s; }
#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(4) { animation-delay: 0.17s; }
#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(5) { animation-delay: 0.21s; }
#mobile-navigation-wrapper.in .mobile-menu > li:nth-child(6) { animation-delay: 0.25s; }

@keyframes rmMobileMenuCascade {
    from {
        opacity: 0;
        transform: translate3d(16px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* E. Owl Carousel Dots Smooth Transitions */
.rm-owl-products .owl-dots .owl-dot span {
    transition: background-color 0.25s ease, transform 0.25s ease, width 0.25s ease;
}

.rm-owl-products .owl-dots .owl-dot.active span {
    transform: scale(1.2);
}

/* F. Touch Device Usability: Ensure Product Actions Never Require Hover */
@media (hover: none), (pointer: coarse) {
    .product-actions {
        opacity: 1;
        visibility: visible;
        transform: translate3d(0, 0, 0);
    }

    .product-action-item {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    .product-item-wrap:hover .product-item-inner,
    .gf-banner:hover .effect-bg-image.layla-effect .gf-banner-bg {
        transform: none;
    }
}

/* G. Mobile Performance & Overflow Safety */
@media (max-width: 767px) {
    .rm-anim-fade-left,
    .rm-anim-fade-right {
        transform: translate3d(0, 20px, 0);
    }
}

/* H. Accessibility: Full Reduced-Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .rm-reveal,
    .rm-anim-item,
    .rm-anim-fade-left,
    .rm-anim-fade-right,
    .rm-anim-zoom,
    .rm-anim-clip,
    .rm-product-animate,
    .rm-hero-slide .rm-hero-watermark,
    .rm-hero-slide .rm-hero-main-img,
    .rm-hero-slide .rm-hero-title,
    .rm-hero-slide .rm-hero-desc,
    .rm-hero-slide .rm-hero-cta {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        will-change: auto !important;
    }
}
