/**
 * MORA Luxury Animations & Scroll Effects
 * Performance-first, hardware-accelerated transitions & scroll interactions
 */

/* ==========================================================================
   1. Lenis Smooth Momentum Scrolling Base
   ========================================================================== */
:root, html, body {
    scroll-behavior: auto !important;
}

html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   2. Scroll Progress Bar (Top of Screen)
   ========================================================================== */
.mora-scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3.5px;
    background: rgba(0, 0, 0, 0.04);
    z-index: 99999;
    pointer-events: none;
}

.mora-scroll-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c8565c 0%, #e07a7f 50%, #f7a8aa 100%);
    box-shadow: 0 0 10px rgba(200, 86, 92, 0.6), 0 0 3px rgba(200, 86, 92, 0.9);
    transition: width 0.08s ease-out;
    border-radius: 0 2px 2px 0;
}

/* ==========================================================================
   3. Floating Back-to-Top Button with Circular Progress Ring
   ========================================================================== */
.mora-back-to-top {
    position: fixed;
    right: 28px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #09090b;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(9, 9, 11, 0.25), 0 2px 6px rgba(200, 86, 92, 0.2);
    border: none;
    outline: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.85);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.mora-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mora-back-to-top:hover {
    background: #c8565c;
    color: #ffffff;
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 12px 28px rgba(200, 86, 92, 0.4), 0 4px 10px rgba(9, 9, 11, 0.2);
}

.mora-back-to-top svg.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.mora-back-to-top svg.progress-ring circle.progress-ring-bg {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 2.5;
    fill: transparent;
}

.mora-back-to-top svg.progress-ring circle.progress-ring-fill {
    stroke: #c8565c;
    stroke-width: 2.5;
    stroke-linecap: round;
    fill: transparent;
    transition: stroke-dashoffset 0.1s ease-out;
}

.mora-back-to-top:hover svg.progress-ring circle.progress-ring-fill {
    stroke: #ffffff;
}

.mora-back-to-top .arrow-icon {
    font-size: 1.15rem;
    transition: transform 0.25s ease;
    z-index: 2;
}

.mora-back-to-top:hover .arrow-icon {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .mora-back-to-top {
        right: 18px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: 36px;
        height: 36px;
    }
    .mora-back-to-top svg.progress-ring {
        width: 36px;
        height: 36px;
    }
    .mora-back-to-top .arrow-icon {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   4. Scroll Reveal Animations (IntersectionObserver Driven)
   ========================================================================== */
.mora-reveal {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.mora-reveal-up {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.mora-reveal-down {
    opacity: 0;
    transform: translate3d(0, -18px, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.mora-reveal-left {
    opacity: 0;
    transform: translate3d(-18px, 0, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.mora-reveal-right {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.mora-reveal-scale {
    opacity: 0;
    transform: scale(0.96) translate3d(0, 10px, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Revealed State */
.mora-revealed {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

/* Stagger Delays */
.mora-delay-1 { transition-delay: 0.08s; }
.mora-delay-2 { transition-delay: 0.16s; }
.mora-delay-3 { transition-delay: 0.24s; }
.mora-delay-4 { transition-delay: 0.32s; }
.mora-delay-5 { transition-delay: 0.40s; }
.mora-delay-6 { transition-delay: 0.48s; }
.mora-delay-7 { transition-delay: 0.56s; }
.mora-delay-8 { transition-delay: 0.64s; }

/* Stagger Container Utility */
.mora-stagger-parent > .mora-stagger-child {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ALL stagger children become visible when revealed */
.mora-stagger-parent.mora-revealed > .mora-stagger-child {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
}

.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(1) { transition-delay: 0.04s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(2) { transition-delay: 0.08s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(3) { transition-delay: 0.12s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(4) { transition-delay: 0.16s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(5) { transition-delay: 0.20s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(6) { transition-delay: 0.24s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(7) { transition-delay: 0.28s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(8) { transition-delay: 0.32s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(9) { transition-delay: 0.36s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(10) { transition-delay: 0.40s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(11) { transition-delay: 0.44s; }
.mora-stagger-parent.mora-revealed > .mora-stagger-child:nth-child(12) { transition-delay: 0.48s; }

/* Balanced Luxury Section Spacing to prevent huge empty gaps */
#latest-collection.padding-large {
    padding-top: 3.5rem !important;
    padding-bottom: 2rem !important;
}

#featured-products.padding-large {
    padding-top: 2rem !important;
    padding-bottom: 3.5rem !important;
}

#latest-products.padding-large {
    padding-top: 1.5rem !important;
    padding-bottom: 3.5rem !important;
}

#company-services.padding-large {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

#testimonials.padding-large {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

/* ==========================================================================
   5. Hero Banner Dynamic Motion
   ========================================================================== */
#billboard {
    position: relative;
    overflow: hidden;
}

#billboard .swiper-slide {
    transition: transform 0.8s ease-in-out;
}

/* Hero Content Staggered Keyframes */
#billboard .swiper-slide-active .banner-title {
    animation: moraHeroFadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.15s;
}

#billboard .swiper-slide-active .banner-content p {
    animation: moraHeroFadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

#billboard .swiper-slide-active .banner-content .btn-wrap {
    animation: moraHeroFadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.45s;
}

@keyframes moraHeroFadeInUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 32px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Hero CTA Button Glow & Hover Interaction */
#billboard .btn-medium {
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

#billboard .btn-medium:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 32px rgba(200, 86, 92, 0.35), 0 4px 12px rgba(0, 0, 0, 0.2);
}

#billboard .btn-medium::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        60deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    transition: all 0.75s ease;
    opacity: 0;
}

#billboard .btn-medium:hover::after {
    left: 130%;
    opacity: 1;
}

/* Scroll Down Hint Pill Indicator */
.mora-scroll-down-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mora-scroll-down-hint:hover {
    color: #ffffff;
    transform: translateX(-50%) translateY(-2px);
}

.mora-scroll-mouse {
    width: 22px;
    height: 34px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.15);
}

.mora-scroll-wheel {
    width: 3.5px;
    height: 7px;
    background: #ffffff;
    border-radius: 2px;
    animation: moraScrollWheel 1.8s ease-in-out infinite;
}

@keyframes moraScrollWheel {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    60% {
        opacity: 0.1;
        transform: translateY(12px);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

/* ==========================================================================
   6. Category Cards Luxury Micro-Interactions & Hover Physics
   ========================================================================== */
.ultras-category-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 16px;
    overflow: hidden;
}

.ultras-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(200, 86, 92, 0.1);
}

.ultras-category-card .products-thumb img {
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.ultras-category-card:hover .products-thumb img {
    transform: scale(1.08);
}

.ultras-category-card .product-entry {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.ultras-category-card:hover .product-entry {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* ==========================================================================
   7. Product Cards Luxury Hover, Shadow & Action Elevation
   ========================================================================== */
.product-item {
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 14px;
    padding: 10px;
    background: transparent;
}

.product-item:hover {
    transform: translateY(-6px);
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(200, 86, 92, 0.06);
}

.product-item .image-holder {
    border-radius: 10px;
    overflow: hidden;
}

.product-item .image-holder img.product-image {
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-item:hover .image-holder img.product-image {
    transform: scale(1.07);
}

.product-item .cart-concern {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   8. Company Services Features Box Hover Physics
   ========================================================================== */
.icon-box {
    padding: 22px 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(228, 228, 231, 0.6);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-box:hover {
    transform: translateY(-6px);
    border-color: rgba(200, 86, 92, 0.35);
    box-shadow: 0 14px 32px rgba(200, 86, 92, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
}

.icon-box .icon-box-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(200, 86, 92, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.icon-box:hover .icon-box-icon {
    background: #c8565c;
    transform: scale(1.1) rotate(4deg);
}

.icon-box:hover .icon-box-icon i {
    color: #ffffff !important;
}

/* ==========================================================================
   9. Testimonials & Quote Reveal
   ========================================================================== */
#testimonials {
    position: relative;
    overflow: hidden;
}

#testimonials .review-icon i {
    transition: all 0.4s ease;
    display: inline-block;
}

#testimonials:hover .review-icon i {
    transform: scale(1.15) rotate(-6deg);
    color: #c8565c !important;
}

/* ==========================================================================
   10. Brand Collection Grayscale to Color Smooth Transition
   ========================================================================== */
#brand-collection .brand-item {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#brand-collection .brand-item img {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.6;
    filter: grayscale(100%);
}

#brand-collection .brand-item:hover {
    transform: translateY(-4px) scale(1.08);
}

#brand-collection .brand-item:hover img {
    opacity: 1;
    filter: grayscale(0%);
}

/* ==========================================================================
   11. Sticky Header Glassmorphism on Scroll
   ========================================================================== */
#header {
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#header.is-scrolled,
#header.has-sticky-primary-nav,
#header-wrap .primary-nav.is-sticky {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border-bottom: 1px solid rgba(228, 228, 231, 0.8);
}

/* Section Title Animated Underline */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #c8565c, #fdc0be);
    border-radius: 2px;
    transition: width 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.mora-revealed .section-title::after,
.section-header.mora-revealed .section-title::after {
    width: 45px;
}

/* ==========================================================================
   12. RTL & Arabic Typography & Banner Layout Adaptations
   ========================================================================== */
[dir="rtl"] body,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .item-anchor, [dir="rtl"] .section-title, [dir="rtl"] .banner-title {
    font-family: 'Segoe UI', 'Cairo', Tahoma, Arial, sans-serif !important;
}

/* Ensure Hero Banner (Billboard) text stays anchored to the left in RTL so it never covers the model */
[dir="rtl"] #billboard .banner-content {
    direction: ltr !important;
}

[dir="rtl"] #billboard .banner-content .container {
    direction: ltr !important;
}

[dir="rtl"] #billboard .banner-content .row {
    direction: ltr !important;
    justify-content: flex-start !important;
}

[dir="rtl"] #billboard .banner-content .col-md-7,
[dir="rtl"] #billboard .banner-content .col-lg-6 {
    direction: ltr !important;
    text-align: left !important;
}

[dir="rtl"] #billboard .banner-content h2.banner-title,
[dir="rtl"] #billboard .banner-content p,
[dir="rtl"] #billboard .banner-content .btn-wrap {
    text-align: left !important;
    unicode-bidi: plaintext;
}

[dir="rtl"] #billboard .banner-content .btn-wrap {
    display: flex;
    justify-content: flex-start;
}

/* Maintain proper left/right positions for slider navigation arrows in RTL */
[dir="rtl"] #billboard .button-prev {
    left: 0 !important;
    right: auto !important;
}

[dir="rtl"] #billboard .button-next {
    right: 0 !important;
    left: auto !important;
}

/* Ensure Category Card overlay badge stays anchored to the left in RTL */
[dir="rtl"] .ultras-category-card .product-entry {
    left: 0 !important;
    right: auto !important;
}

@media screen and (max-width: 991px) {
    [dir="rtl"] #billboard .banner-content .row {
        justify-content: center !important;
    }
    [dir="rtl"] #billboard .banner-content .col-md-7,
    [dir="rtl"] #billboard .banner-content .col-lg-6,
    [dir="rtl"] #billboard .banner-content h2.banner-title,
    [dir="rtl"] #billboard .banner-content p {
        text-align: center !important;
    }
    [dir="rtl"] #billboard .banner-content .btn-wrap {
        justify-content: center !important;
    }
}

[dir="rtl"] .mora-back-to-top {
    right: auto !important;
    left: 28px !important;
}

@media (max-width: 768px) {
    [dir="rtl"] .mora-back-to-top {
        right: auto !important;
        left: 18px !important;
    }

    .mora-back-to-top {
        display: none !important;
    }
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

[dir="rtl"] .mora-scroll-progress-fill {
    border-radius: 2px 0 0 2px;
}
