/* ============================================================
   MAISON NOIR — Animations v3 (Ultra Edition)
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   ULTRA PRELOADER (2-Second Cinematic Experience)
   ════════════════════════════════════════════════════════════ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #090816;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    /* CSS-only nuclear fallback: hide after 3s even if JS fails completely */
    animation: preloaderAutoHide 0.6s ease 3s forwards;
}
#preloader.hide {
    animation: preloaderExit 0.6s ease forwards !important;
    pointer-events: none;
}
@keyframes preloaderExit {
    0%   { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}
@keyframes preloaderAutoHide {
    0%   { opacity: 1; }
    100% { opacity: 0; visibility: hidden; display: none; }
}

/* Particle field */
.pl-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.pl-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(218,23,5,0.8), transparent);
    animation: plParticleFloat linear infinite;
}

/* Central glow ring */
.pl-glow-ring {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px solid rgba(218,23,5,0.15);
    animation: plRingExpand 2s ease-out infinite;
    pointer-events: none;
}
.pl-glow-ring:nth-child(2) { animation-delay: 0.5s; width: 400px; height: 400px; }
.pl-glow-ring:nth-child(3) { animation-delay: 1s;   width: 500px; height: 500px; }
@keyframes plRingExpand {
    0%   { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Logo container */
.preloader-logo-wrap {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
    animation: preloaderFadeIn 0.5s ease forwards;
}
@keyframes preloaderFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.preloader-logo {
    max-height: 90px;
    filter: drop-shadow(0 0 30px rgba(218,23,5,0.7)) drop-shadow(0 0 60px rgba(218,23,5,0.3));
    animation: preloader-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes preloader-pulse {
    from { transform: scale(1);    filter: drop-shadow(0 0 15px rgba(218,23,5,0.5)); }
    to   { transform: scale(1.06); filter: drop-shadow(0 0 40px rgba(218,23,5,1)) drop-shadow(0 0 80px rgba(218,23,5,0.4)); }
}

/* Spinning rings around logo */
.pl-spin-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: plSpinRing linear infinite;
}
.pl-spin-ring-1 {
    width: 120px; height: 120px;
    border-top-color: #da1705;
    border-right-color: rgba(218,23,5,0.3);
    animation-duration: 1.2s;
}
.pl-spin-ring-2 {
    width: 150px; height: 150px;
    border-bottom-color: rgba(218,23,5,0.6);
    border-left-color: rgba(218,23,5,0.2);
    animation-duration: 1.8s;
    animation-direction: reverse;
}
.pl-spin-ring-3 {
    width: 180px; height: 180px;
    border-top-color: rgba(218,23,5,0.2);
    border-right-color: rgba(218,23,5,0.5);
    animation-duration: 2.5s;
}
@keyframes plSpinRing { to { transform: rotate(360deg); } }

/* Progress bar */
.preloader-bar-wrap {
    width: 220px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.preloader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #da1705, #ff6b6b, #da1705);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.05s linear;
    animation: barShimmer 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(218,23,5,0.7);
}
@keyframes barShimmer {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

/* Percentage text */
.preloader-percent {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-top: 10px;
}

/* Preloader text */
.preloader-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    animation: blink 1s ease-in-out infinite;
    margin-top: 5px;
}
@keyframes blink {
    0%, 100% { opacity: 0.35; }
    50%       { opacity: 0.9; }
}

@keyframes plParticleFloat {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.5; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   CURSOR GLOW
   ════════════════════════════════════════════════════════════ */
#cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(218,23,5,0.07) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    transition: left 0.18s ease, top 0.18s ease;
    mix-blend-mode: screen;
}

/* ════════════════════════════════════════════════════════════
   SCROLL REVEAL CLASSES
   ════════════════════════════════════════════════════════════ */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1),
                transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.scale-in.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.flip-in {
    opacity: 0;
    transform: perspective(600px) rotateX(-30deg) translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1),
                transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
.flip-in.visible {
    opacity: 1;
    transform: perspective(600px) rotateX(0deg) translateY(0);
}

/* Stagger delays for grid children */
.stagger > *:nth-child(1)  { transition-delay: 0.05s !important; }
.stagger > *:nth-child(2)  { transition-delay: 0.12s !important; }
.stagger > *:nth-child(3)  { transition-delay: 0.19s !important; }
.stagger > *:nth-child(4)  { transition-delay: 0.26s !important; }
.stagger > *:nth-child(5)  { transition-delay: 0.33s !important; }
.stagger > *:nth-child(6)  { transition-delay: 0.40s !important; }

/* ════════════════════════════════════════════════════════════
   FLOATING ANIMATIONS
   ════════════════════════════════════════════════════════════ */
@keyframes float {
    0%   { transform: translateY(calc(-50% + 0px)) rotate(0deg); }
    33%  { transform: translateY(calc(-50% - 20px)) rotate(2deg); }
    66%  { transform: translateY(calc(-50% - 8px)) rotate(-1deg); }
    100% { transform: translateY(calc(-50% + 0px)) rotate(0deg); }
}
@keyframes float2 {
    0%   { transform: translateY(calc(-50% + 0px)) rotate(0deg); }
    40%  { transform: translateY(calc(-50% - 26px)) rotate(-3deg); }
    80%  { transform: translateY(calc(-50% - 5px)) rotate(2deg); }
    100% { transform: translateY(calc(-50% + 0px)) rotate(0deg); }
}
@keyframes floatSlow {
    0%   { transform: translateY(0) scale(1); }
    50%  { transform: translateY(-30px) scale(1.04); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes floatOrb {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(30px, -20px) scale(1.1); }
    50%  { transform: translate(-20px, 30px) scale(0.95); }
    75%  { transform: translate(10px, -10px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Floating background particles on page */
.page-float-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatOrb ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════
   GRADIENT ORB PULSE
   ════════════════════════════════════════════════════════════ */
@keyframes orbPulse {
    0%, 100% { transform: scale(1) translate(0,0); opacity: 0.5; }
    33%       { transform: scale(1.2) translate(25px,-20px); opacity: 0.8; }
    66%       { transform: scale(0.9) translate(-20px,25px); opacity: 0.3; }
}
@keyframes orbPulse2 {
    0%, 100% { transform: scale(1) translate(0,0); opacity: 0.4; }
    50%       { transform: scale(1.2) translate(-30px,15px); opacity: 0.7; }
}

/* ════════════════════════════════════════════════════════════
   HERO WORD REVEAL
   ════════════════════════════════════════════════════════════ */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) rotateX(-40deg);
    transform-origin: bottom center;
    transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1),
                transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.hero-word.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* ════════════════════════════════════════════════════════════
   HERO BADGE ANIMATION
   ════════════════════════════════════════════════════════════ */
@keyframes badgeSlide {
    from { opacity:0; transform: translateX(-40px) scale(0.8); }
    to   { opacity:1; transform: translateX(0) scale(1); }
}

/* ════════════════════════════════════════════════════════════
   TYPEWRITER CURSOR
   ════════════════════════════════════════════════════════════ */
#hero-typed::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    color: #da1705;
    margin-left: 3px;
}

/* ════════════════════════════════════════════════════════════
   SCROLL INDICATOR
   ════════════════════════════════════════════════════════════ */
@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity:1; }
    50%       { transform: translateX(-50%) translateY(10px); opacity:0.3; }
}

/* ════════════════════════════════════════════════════════════
   FEATURE ICON
   ════════════════════════════════════════════════════════════ */
.feature-item:hover .feature-icon i {
    animation: iconSpin 0.6s ease;
}
@keyframes iconSpin {
    0%   { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* ════════════════════════════════════════════════════════════
   PRODUCT CARD BADGE
   ════════════════════════════════════════════════════════════ */
.badge-new {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #da1705, #ff6b6b);
    color: #fff;
    font-size: 0.68rem;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 5;
    animation: badgeSlide 0.5s ease both;
    box-shadow: 0 4px 15px rgba(218,23,5,0.4);
}

/* ════════════════════════════════════════════════════════════
   SHIMMER EFFECT
   ════════════════════════════════════════════════════════════ */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer {
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.15) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
}

/* ════════════════════════════════════════════════════════════
   SECTION TITLE ANIMATED UNDERLINE
   ════════════════════════════════════════════════════════════ */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #da1705, #ff6b6b);
    transition: width 1s cubic-bezier(0.16,1,0.3,1) 0.2s;
    border-radius: 2px;
}
.section-title.visible::after {
    width: 70px;
}

/* ════════════════════════════════════════════════════════════
   STATS COUNTER BOX
   ════════════════════════════════════════════════════════════ */
.hero-stat-item {
    text-align: center;
    padding: 14px 28px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.hero-stat-item:hover {
    transform: translateY(-6px) scale(1.03);
    background: rgba(218,23,5,0.12);
    box-shadow: 0 15px 35px rgba(218,23,5,0.2);
    border-color: rgba(218,23,5,0.3);
}

/* ════════════════════════════════════════════════════════════
   MARQUEE STRIP
   ════════════════════════════════════════════════════════════ */
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.marquee-track {
    animation: marquee 18s linear infinite;
    display: flex;
    gap: 0;
    white-space: nowrap;
}
.marquee-track:hover { animation-play-state: paused; }

/* ════════════════════════════════════════════════════════════
   INSTA GRID OVERLAY
   ════════════════════════════════════════════════════════════ */
.insta-item {
    position: relative;
    overflow: hidden;
}
.insta-item::after {
    content: '\f16d';
    font-family: 'Font Awesome 6 Brands';
    position: absolute;
    inset: 0;
    background: rgba(218,23,5,0.75);
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.insta-item:hover::after { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   SECTION ENTRANCE — for any section
   ════════════════════════════════════════════════════════════ */
@keyframes sectionReveal {
    from { opacity: 0; transform: translateY(80px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   FLOATING PAGE DECORATIONS
   ════════════════════════════════════════════════════════════ */
.floating-decor {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    opacity: 0.4;
}

/* ════════════════════════════════════════════════════════════
   PRODUCT CARD — Enhanced
   ════════════════════════════════════════════════════════════ */
.product-card {
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.5s cubic-bezier(0.16,1,0.3,1),
                opacity 0.5s ease !important;
}

/* ════════════════════════════════════════════════════════════
   CATEGORY CARD HOVER SHINE
   ════════════════════════════════════════════════════════════ */
.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0) 60%);
    background-size: 200% 200%;
    background-position: -100% -100%;
    transition: background-position 0.6s ease;
    z-index: 1;
}
.category-card:hover::after {
    background-position: 200% 200%;
}

/* ════════════════════════════════════════════════════════════
   TESTIMONIAL CARD GLOW
   ════════════════════════════════════════════════════════════ */
@keyframes cardGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(218,23,5,0); }
    50%       { box-shadow: 0 0 30px rgba(218,23,5,0.12); }
}

/* ════════════════════════════════════════════════════════════
   SCROLL PROGRESS BAR
   ════════════════════════════════════════════════════════════ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #da1705, #ff6b6b);
    z-index: 99998;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(218,23,5,0.6);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #cursor-glow { display: none; }
    .pl-spin-ring-2, .pl-spin-ring-3 { display: none; }
}
