/* ProtecSmart Morocco - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* Typography & Direction */
html {
    scroll-behavior: smooth;
}

html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] label,
html[dir="rtl"] a {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, -apple-system, sans-serif !important;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .font-bold,
html[dir="rtl"] .font-extrabold,
html[dir="rtl"] .font-black,
html[dir="rtl"] strong,
html[dir="rtl"] b {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif !important;
    font-weight: 800 !important;
}

html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] label,
html[dir="rtl"] input {
    font-weight: 600;
}

body {
    font-family: 'Segoe UI', 'Tajawal', Roboto, system-ui, -apple-system, sans-serif;
}

/* Animations */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.badge-pulse {
    animation: pulseGlow 2s infinite ease-in-out;
}

/* Hero Typewriter Cursor & Animation */
#hero-typewriter-text::after {
    content: '|';
    display: inline-block;
    margin-inline-start: 4px;
    color: #34d399;
    font-weight: 300;
    animation: blinkCursor 0.75s infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes radarWave {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.radar-circle {
    animation: radarWave 3s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

/* Glassmorphism effects */
.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Tabs styles */
.tab-btn.active {
    border-color: #1e3a8a !important;
    color: #1e3a8a !important;
    background-color: #eff6ff !important;
}

/* Custom scrollbars */
.scrollbar-none::-webkit-scrollbar {
    display: none;
}
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Image transitions & Modern Product Gallery */
.gallery-main-img {
    transition: opacity 0.2s ease-in-out, transform 0.3s ease;
}

.gallery-thumb {
    width: 4.5rem;
    height: 4.5rem;
    aspect-ratio: 1 / 1;
    border-radius: 0.875rem;
    padding: 0.2rem;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    opacity: 0.72;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .gallery-thumb {
        width: 5.5rem;
        height: 5.5rem;
        border-radius: 1.125rem;
        padding: 0.25rem;
    }
}

.gallery-thumb:hover {
    opacity: 1;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.08);
}

.cam-thumb.active {
    border-color: #01296e !important;
    box-shadow: 0 0 0 3px rgba(1, 41, 110, 0.22), 0 8px 16px -4px rgba(1, 41, 110, 0.15) !important;
    opacity: 1 !important;
    transform: scale(1.03) !important;
}

.rep-thumb.active {
    border-color: #d99204 !important;
    box-shadow: 0 0 0 3px rgba(217, 146, 4, 0.25), 0 8px 16px -4px rgba(217, 146, 4, 0.18) !important;
    opacity: 1 !important;
    transform: scale(1.03) !important;
}

/* Chatbot Floating Animation */
.chat-btn-pulse {
    box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.5), 0 8px 10px -6px rgba(30, 58, 138, 0.5);
}

/* Language Dropdown Menu */
#lang-menu {
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.25), 0 8px 12px -6px rgba(15, 23, 42, 0.15);
    animation: dropDownSlide 0.18s ease-out;
}

@keyframes dropDownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lang-opt img {
    transition: transform 0.15s ease-in-out;
}

.lang-opt:hover img {
    transform: scale(1.15);
}

/* Trust Features Infinite Marquee (Continuous, Never Ending, Right to Left) */
.trust-marquee-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 0.5rem 0;
    user-select: none;
    direction: ltr !important; /* Forces LTR coordinate space so translateX is mathematically seamless */
}

.trust-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
    animation: marqueeScrollInfinite 45s linear infinite;
}

@media (hover: hover) and (pointer: fine) {
    .trust-marquee-wrapper:hover .trust-marquee-track {
        animation-play-state: paused;
    }
}

.trust-marquee-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 1rem;
    flex-shrink: 0;
}

/* Card internal direction respects site language */
[dir="rtl"] .trust-marquee-card {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] .trust-marquee-card {
    direction: ltr;
    text-align: left;
}

@keyframes marqueeScrollInfinite {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Mobile Bottom Safe Area & Floating Controls */
@media (max-width: 768px) {
    body {
        padding-bottom: 64px;
    }

    #chatbot-container {
        bottom: 74px !important;
        right: 14px !important;
    }

    [dir="rtl"] #chatbot-container {
        right: auto !important;
        left: 14px !important;
    }

    #chatbot-container button.chat-btn-pulse {
        width: 3.25rem !important;
        height: 3.25rem !important;
        font-size: 1.15rem !important;
    }

    #chat-window {
        width: calc(100vw - 28px) !important;
        max-width: 380px !important;
        bottom: 76px !important;
    }
}

/* ========================================================
   ULTRA-PREMIUM STORE ANIMATIONS & MICRO-INTERACTIONS
   ======================================================== */

/* 1. Ambient Floating Gradient Mesh in Hero */
.ambient-glow-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(85px);
    opacity: 0.35;
    will-change: transform;
    animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-orb-blue {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(1, 41, 110, 0.5) 0%, rgba(2, 20, 70, 0.2) 60%, transparent 100%);
    top: -60px;
    left: 8%;
    animation-duration: 16s;
}

.ambient-orb-gold {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(217, 146, 4, 0.4) 0%, rgba(224, 154, 6, 0.15) 60%, transparent 100%);
    top: 60px;
    right: 8%;
    animation-duration: 22s;
    animation-delay: -6s;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(35px, 25px) scale(1.12);
    }
    100% {
        transform: translate(-30px, 15px) scale(0.96);
    }
}

/* 2. Scroll Reveal Animations (Hardware Accelerated) */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay classes */
.delay-100 { transition-delay: 0.1s; }
.delay-150 { transition-delay: 0.15s; }
.delay-200 { transition-delay: 0.2s; }
.delay-250 { transition-delay: 0.25s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* 3. Product Cards 3D Hover & Light Sheen Sweep */
.product-card-animated {
    position: relative;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    isolation: isolate;
}

.product-card-animated:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 38px -12px rgba(15, 23, 42, 0.14), 0 12px 18px -6px rgba(15, 23, 42, 0.08);
}

.product-card-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.32) 50%,
        transparent 100%
    );
    transform: skewX(-22deg);
    transition: left 0.8s ease-in-out;
    pointer-events: none;
    z-index: 15;
}

.product-card-animated:hover::before {
    left: 170%;
}

/* 4. High-Converting Button Shimmer Sweep & Glowing Pulse */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.42) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: btnShimmerSweep 3.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

@keyframes btnShimmerSweep {
    0%, 65% {
        left: -120%;
    }
    100% {
        left: 220%;
    }
}

.btn-glow-gold {
    animation: glowGold 2.4s infinite ease-in-out;
}

@keyframes glowGold {
    0%, 100% {
        box-shadow: 0 4px 14px 0 rgba(217, 146, 4, 0.4);
    }
    50% {
        box-shadow: 0 6px 24px 2px rgba(217, 146, 4, 0.65), 0 0 0 4px rgba(217, 146, 4, 0.18);
    }
}

.btn-glow-primary {
    animation: glowPrimary 2.4s infinite ease-in-out;
}

@keyframes glowPrimary {
    0%, 100% {
        box-shadow: 0 4px 14px 0 rgba(1, 41, 110, 0.35);
    }
    50% {
        box-shadow: 0 6px 24px 2px rgba(1, 41, 110, 0.55), 0 0 0 4px rgba(1, 41, 110, 0.18);
    }
}

/* 5. Live Beacon Dot Animation */
.live-pulse-dot {
    position: relative;
    display: inline-flex;
    width: 9px;
    height: 9px;
}

.live-pulse-dot::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    background-color: currentColor;
    opacity: 0.75;
    animation: pingDot 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.live-pulse-dot::after {
    content: '';
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background-color: currentColor;
}

@keyframes pingDot {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    75%, 100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* 6. Price & Pack Interactive Animation */
.price-bump {
    animation: pricePop 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pricePop {
    0% {
        transform: scale(0.88);
        opacity: 0.7;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.check-pop {
    animation: checkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.25);
    }
    100% {
        transform: scale(1);
    }
}

/* 7. Floating Confetti Canvas for Order Celebration */
#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

