/* ============================================
   DREAM BEAUTY COSMETICS — PREMIUM UI/UX CSS
   Awwwards-level animations & interactions
   ============================================ */

/* --- Smooth Scroll Body --- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* --- Preloader --- */
.db-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}
.db-preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.db-preloader-logo {
    height: 50px;
    object-fit: contain;
    animation: preloaderPulse 1.5s ease-in-out infinite;
}
.db-preloader-bar {
    width: 120px;
    height: 2px;
    background: #f0efe9;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.db-preloader-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c5a47e, #111);
    border-radius: 2px;
    animation: preloaderProgress 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes preloaderPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}
@keyframes preloaderProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* --- Custom Cursor --- */
.db-cursor {
    width: 20px;
    height: 20px;
    border: 1.5px solid #111;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s,
                background 0.3s,
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    backdrop-filter: invert(1);
    -webkit-backdrop-filter: invert(1);
}
.db-cursor.cursor-hover {
    width: 50px;
    height: 50px;
    border-color: #c5a47e;
    background: rgba(197, 164, 126, 0.08);
}
.db-cursor.cursor-click {
    transform: translate(-50%, -50%) scale(0.8);
}
@media (pointer: coarse), (max-width: 991px) {
    .db-cursor { display: none !important; }
}

/* --- Scroll Reveal System --- */
[data-reveal] {
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="up"] { transform: translateY(60px); }
[data-reveal="down"] { transform: translateY(-60px); }
[data-reveal="left"] { transform: translateX(-60px); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="scale"] { transform: scale(0.92); }
[data-reveal="blur"] { transform: translateY(30px); filter: blur(8px); transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1); }
[data-reveal].revealed {
    opacity: 1;
    transform: none;
    filter: none;
}

/* Stagger delays for children */
[data-stagger] > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger] > *:nth-child(2) { transition-delay: 0.1s; }
[data-stagger] > *:nth-child(3) { transition-delay: 0.15s; }
[data-stagger] > *:nth-child(4) { transition-delay: 0.2s; }
[data-stagger] > *:nth-child(5) { transition-delay: 0.25s; }
[data-stagger] > *:nth-child(6) { transition-delay: 0.3s; }
[data-stagger] > *:nth-child(7) { transition-delay: 0.35s; }
[data-stagger] > *:nth-child(8) { transition-delay: 0.4s; }

/* --- Floating Particles --- */
.db-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.db-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}
@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) rotate(0deg); }
    10% { opacity: 0.4; }
    90% { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-10vh) rotate(720deg); }
}

/* --- Premium Button Effects --- */
.btn-magnetic {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-magnetic::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #111;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}
.btn-magnetic:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}
.btn-magnetic:hover {
    color: #fff;
    border-color: #111;
}

/* --- Premium Hover Glow --- */
.hover-glow {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-glow:hover {
    box-shadow: 0 20px 60px rgba(197, 164, 126, 0.15), 0 0 0 1px rgba(197, 164, 126, 0.1);
    transform: translateY(-4px);
}

/* --- Parallax Depth Layers --- */
[data-parallax] {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* --- Image Reveal Overlay --- */
.img-reveal-wrap {
    position: relative;
    overflow: hidden;
}
.img-reveal-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    transform-origin: right;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}
.img-reveal-wrap.revealed::after {
    transform: scaleX(0);
}

/* --- Luxury Gradient Divider --- */
.luxury-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #c5a47e 20%, #c5a47e 80%, transparent);
    max-width: 200px;
    margin: 0 auto;
    opacity: 0.4;
}

/* --- Text Shimmer Effect --- */
.text-shimmer {
    background: linear-gradient(120deg, #111 30%, #c5a47e 50%, #111 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s ease-in-out infinite;
}
@keyframes textShimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* --- Smooth Image Zoom on Hover --- */
.img-zoom {
    overflow: hidden;
    border-radius: inherit;
}
.img-zoom img {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-zoom:hover img {
    transform: scale(1.08);
}

/* --- Product Float Animation --- */
.product-float {
    animation: productFloat 4s ease-in-out infinite;
}
@keyframes productFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* --- Premium Card Glassmorphism --- */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
}

/* --- Typing Cursor Animation --- */
.typing-cursor::after {
    content: '|';
    display: inline-block;
    animation: cursorBlink 1s step-end infinite;
    color: #c5a47e;
    font-weight: 300;
    margin-left: 2px;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Mobile Bottom Nav (Desktop Hidden) --- */
.mobile-bottom-nav, .mobile-sticky-cta {
    display: none;
}

/* --- Mobile Hamburger Menu --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: #111;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 1000;
    padding: 100px 40px 40px;
    transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 0;
}
.mobile-nav-drawer.open {
    right: 0;
}
.mobile-nav-drawer a {
    display: block;
    font-size: 28px;
    font-family: 'Playfair Display', serif;
    color: #111;
    padding: 16px 0;
    border-bottom: 1px solid #f0efe9;
    transition: all 0.3s ease;
    text-decoration: none;
}
.mobile-nav-drawer a:hover {
    color: #c5a47e;
    padding-left: 10px;
}
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.mobile-nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #c5a47e, #d4a853);
    z-index: 99997;
    width: 0%;
    transition: width 0.1s linear;
}

/* === RESPONSIVE OVERRIDES === */

@media (max-width: 991px) {
    /* Header mobile adjustments */
    .header {
        padding: 15px 20px !important;
    }
    .header.scrolled {
        padding: 10px 20px !important;
    }
    .header-logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    .header-logo img {
        height: 45px !important;
    }
    .header.scrolled .header-logo img {
        height: 32px !important;
    }
    .header-spacer {
        height: 80px !important;
    }
    .header-right {
        gap: 16px !important;
    }

    /* Reduce animation intensity for mobile */
    [data-reveal] {
        transition-duration: 0.7s !important;
    }
    [data-reveal="up"] { transform: translateY(30px); }
    [data-reveal="left"] { transform: translateX(-30px); }
    [data-reveal="right"] { transform: translateX(30px); }
    [data-reveal="blur"] { filter: blur(4px); transform: translateY(15px); }

    /* Hero mobile */
    .hero { height: 70vh !important; border-radius: 24px !important; }
    .hero-container { margin: 0 auto 30px !important; }
    .hero-title { font-size: 28px !important; letter-spacing: 1px !important; }
    .hero-subtitle { font-size: 10px !important; letter-spacing: 2px !important; }
    .btn-white { padding: 12px 28px !important; font-size: 10px !important; margin: 0 5px !important; }
    
    /* Section spacing */
    .section-padding { padding: 60px 20px !important; }

    /* Responsive titles */
    .responsive-title {
        font-size: 30px !important;
        line-height: 1.25 !important;
    }

    /* About intro 3-col to 1-col */
    #about-intro > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    #about-intro > div:first-child > div:first-child,
    #about-intro > div:first-child > div:last-child {
        display: none;
    }

    /* SPF feature section */
    #spf-feature > div > div:last-child {
        grid-template-columns: 1fr !important;
        padding: 30px 20px !important;
        gap: 30px !important;
    }
    #spf-feature .feature-card-spf {
        padding: 24px 20px !important;
    }

    /* Shop showcase */
    .shop-showcase-grid {
        grid-template-columns: 1fr !important;
    }
    .shop-left-col {
        border-right: none !important;
        border-bottom: 1px solid #f0efe9;
        padding: 40px 20px !important;
    }
    .shop-right-col {
        padding: 40px 20px !important;
    }
    .shop-features-strip {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px !important;
        padding: 24px 20px !important;
    }

    /* Footer mobile */
    footer > div:first-child {
        flex-direction: column !important;
        gap: 40px !important;
        text-align: center;
    }
    footer > div:first-child > div:last-child {
        justify-content: center !important;
        gap: 40px !important;
    }

    /* CTA Banner */
    .cta-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Mobile App-like Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        border-top: 1px solid rgba(255,255,255,0.5);
        z-index: 9999;
        padding: 12px 20px 26px;
        justify-content: space-between;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.06);
    }

    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #999;
        text-decoration: none;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.5px;
        transition: color 0.3s;
        flex: 1;
        text-transform: uppercase;
        font-family: 'Lato', sans-serif;
    }

    .mobile-bottom-nav a i {
        font-size: 22px;
        margin-bottom: 6px;
        transition: transform 0.3s;
    }

    .mobile-bottom-nav a.active {
        color: #2d4a2e;
    }

    .mobile-bottom-nav a.active i {
        transform: translateY(-2px);
    }
    
    body {
        padding-bottom: 90px;
    }

    /* Sticky Mobile CTA */
    .mobile-sticky-cta {
        display: flex;
        position: fixed;
        bottom: 90px;
        right: 20px;
        background: linear-gradient(135deg, #2b221a 0%, #111 100%);
        color: #fff;
        padding: 16px 24px;
        border-radius: 40px;
        z-index: 9998;
        box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;
        text-decoration: none;
        font-family: 'DM Sans', sans-serif;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.5px;
        align-items: center;
        gap: 10px;
        transform: translateZ(0);
        animation: mobileCtaPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
    }
    @keyframes mobileCtaPulse {
        0% { box-shadow: 0 0 0 0 rgba(43,34,26, 0.4); }
        70% { box-shadow: 0 0 0 15px rgba(43,34,26, 0); }
        100% { box-shadow: 0 0 0 0 rgba(43,34,26, 0); }
    }

    /* Hide Desktop/Hamburger Nav Elements */
    .header-menu-btn, .mobile-nav-drawer, .mobile-nav-overlay {
        display: none !important;
    }

    /* Header adjustments for mobile app feel */
    .header {
        padding: 12px 20px !important;
        background: rgba(255,255,255,0.95) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
    }
    .header.scrolled {
        padding: 10px 20px !important;
    }
    .top-bar {
        display: none;
    }
    
    /* Full-width sections for app-like scrolling */
    #about-intro, #spf-feature, section[style*="margin: 40px auto;"] {
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid #eaeaea;
    }
    
    .hero-container {
        padding: 0 !important;
        margin: 0 !important;
    }
    .hero {
        border-radius: 0 !important;
        height: 100vh !important;
        max-height: calc(100vh - 80px) !important;
    }
    
    .footer-section {
        margin-top: 0 !important;
        border-radius: 0 !important;
        padding-bottom: 100px !important;
    }

    /* Disable particles on mobile for performance */
    .db-particles { display: none; }

    /* Hide custom cursor on mobile */
    body { cursor: auto !important; }
}

@media (max-width: 600px) {
    .hero { height: 55vh !important; }
    .hero-title { font-size: 24px !important; }
    .btn-white { padding: 10px 22px !important; }
    .responsive-title { font-size: 26px !important; }
    .shop-features-strip { grid-template-columns: 1fr !important; }
    
    /* Skincare complex grids */
    #skincare-complex-top, #skincare-complex-bottom {
        grid-template-columns: 1fr !important;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .db-particles { display: none; }
    .product-float { animation: none; }
    [data-reveal] { opacity: 1; transform: none; filter: none; }
}
