/* ═══════════════════════════════════════════════════════════════════════════
   Allied Deals — Master Stylesheet
   Premium 3D Animated E-Commerce Experience
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Font Import ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    --color-primary:    #0B132B; /* Midnight Navy */
    --color-secondary:  #1C2541; /* Royal Slate */
    --color-accent:     #2563EB; /* Premium Cobalt Blue */
    --color-light:      #FDFDFD; /* Pure White */
    --color-border:     #E2E8F0; /* Slate Border */
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --font-sans:        'Inter', system-ui, sans-serif;
    --font-display:     'Outfit', sans-serif;
}

/* ── Base Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3D CANVAS LAYER — THE GLASS CANVAS PATTERN
   Canvas sits at z-index 0, all HTML content at z-index ≥ 10
   ═══════════════════════════════════════════════════════════════════════════ */

#hero-canvas,
#shop-canvas,
#product-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* Reduced motion — hide ALL canvas animations */
@media (prefers-reduced-motion: reduce) {
    #hero-canvas,
    #shop-canvas,
    #product-canvas {
        display: none !important;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Content layer — everything above the 3D canvas */
.content-layer {
    position: relative;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLASSMORPHISM COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-glass-border);
}

.glass-dark {
    background: rgba(10, 10, 11, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.glass-header {
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Header scrolled state — deeper glass */
.scrolled-header {
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT & GRADIENT UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.text-gradient {
    background: linear-gradient(135deg, #D4AF37 0%, #C5A059 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #E6C27A 0%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-premium {
    background: linear-gradient(135deg, #0A0A0B 0%, #151518 50%, #0A0A0B 100%);
}

.bg-gradient-section {
    background: linear-gradient(180deg, rgba(10,10,11,0) 0%, rgba(10,10,11,1) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM CARD EFFECTS WITH CSS 3D TILT
   ═══════════════════════════════════════════════════════════════════════════ */

.card-premium {
    transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth), border-color 0.4s ease;
    border: 1px solid transparent;
    transform-style: preserve-3d;
    will-change: transform;
}

.card-premium:hover {
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.4), var(--glow-primary);
    border-color: rgba(212, 175, 55, 0.25);
}

/* CSS 3D tilt — applied via JS for interactive cards */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    will-change: transform;
}

.tilt-card:hover {
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.08);
}

/* ── Product Card Inner Elements (preserve 3D depth) ── */
.tilt-card .card-image {
    transform: translateZ(20px);
    transform-style: preserve-3d;
}

.tilt-card .card-content {
    transform: translateZ(10px);
    transform-style: preserve-3d;
}

/* ── Glowing Add to Cart Button ── */
.btn-add-cart {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-smooth);
}

.btn-add-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(197,160,89,0.2));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-add-cart:hover::before {
    opacity: 1;
}

.btn-add-cart:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL-REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

[data-reveal] {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s var(--transition-smooth), transform 0.7s var(--transition-smooth);
}

[data-reveal="left"] {
    transform: translateX(-32px);
}

[data-reveal="right"] {
    transform: translateX(32px);
}

[data-reveal="scale"] {
    transform: scale(0.92);
}

[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* Stagger children */
[data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--transition-smooth), transform 0.5s var(--transition-smooth);
}

[data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(7) { transition-delay: 0.47s; opacity: 1; transform: none; }
[data-reveal-stagger].revealed > *:nth-child(8) { transition-delay: 0.54s; opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.hero-section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

/* Floating badge on hero */
@keyframes badge-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

.hero-badge {
    animation: badge-float 4s ease-in-out infinite;
}

/* Glowing orb behind hero headline */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

.hero-orb-primary {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 70%);
    top: -150px; left: -100px;
    animation: orb-drift 15s ease-in-out infinite alternate;
}

.hero-orb-secondary {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    bottom: -100px; right: -100px;
    animation: orb-drift 20s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, 20px) scale(1.05); }
    100% { transform: translate(-20px, 10px) scale(0.95); }
}

/* Ken Burns for hero slider images */
.vertical-text { writing-mode: vertical-rl; }

@keyframes ken-burns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.05); } /* Subtler zoom for premium feel */
}

.animate-ken-burns {
    animation: ken-burns 30s ease-out infinite alternate; /* Slower, cinematic */
}

/* ── Hero slide animations ── */
.slide-up {
    animation: fadeInUp 0.9s var(--transition-smooth) forwards;
}
.slide-up-delayed {
    animation: fadeInUp 0.9s var(--transition-smooth) 0.2s both;
}
.slide-up-button {
    animation: fadeInUp 0.9s var(--transition-smooth) 0.4s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRUST BADGE / TICKER STRIP
   ═══════════════════════════════════════════════════════════════════════════ */

.badge-glow {
    position: relative;
    overflow: hidden;
}

.badge-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, transparent, rgba(79,195,247,0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.badge-glow:hover::after {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION BACKGROUNDS (layered with 3D canvas)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Semi-transparent white panels that sit above the WebGL canvas */
.section-light {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    position: relative;
    z-index: 10;
}

.section-dark {
    background: rgba(5, 11, 24, 0.92);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    position: relative;
    z-index: 10;
}

.section-transparent {
    background: transparent;
    position: relative;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOW EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

.glow-primary {
    box-shadow: var(--glow-primary);
}

.glow-secondary {
    box-shadow: var(--glow-secondary);
}

.hover-glow:hover {
    box-shadow: 0 0 25px rgba(79, 195, 247, 0.35);
    transition: box-shadow 0.3s ease;
}

/* Neon border effect */
.border-neon {
    border: 1px solid rgba(79, 195, 247, 0.4);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.15), inset 0 0 10px rgba(79, 195, 247, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS — 3D PREMIUM VARIANTS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-3d-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #007FFF, #4fc3f7);
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 127, 255, 0.4), 0 2px 6px rgba(0,0,0,0.2);
    overflow: hidden;
}

.btn-3d-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}

.btn-3d-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 127, 255, 0.5), 0 4px 12px rgba(0,0,0,0.2);
}

.btn-3d-primary:hover::after {
    left: 100%;
}

.btn-3d-primary:active {
    transform: translateY(0) scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT IMAGE GALLERY (enhanced for product page)
   ═══════════════════════════════════════════════════════════════════════════ */

.product-gallery-wrapper {
    position: relative;
    z-index: 20;
}

.product-gallery-wrapper::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center, rgba(79,195,247,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    border-radius: 2rem;
}

/* Swiper custom */
.swiper-button-next,
.swiper-button-prev {
    color: white !important;
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5) !important;
}

.swiper-pagination-bullet-active {
    background: white !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS — GLOBAL
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(79,195,247,0.3); }
    50%       { box-shadow: 0 0 30px rgba(79,195,247,0.6); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-slide-down  { animation: slideDown 0.35s ease-out; }
.animate-slide-left  { animation: slideLeft 0.35s ease-out; }
.animate-fade-in     { animation: fadeIn 0.5s ease-out forwards; }
.animate-float       { animation: float 5s ease-in-out infinite; }
.animate-pulse-glow  { animation: pulse-glow 2s ease-in-out infinite; }

/* Entrance for cart-count badge */
#cart-count {
    transition: transform 0.2s var(--transition-smooth);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════════════════════════════════════════ */

.spinner {
    border: 3px solid rgba(79,195,247,0.15);
    border-top: 3px solid #4fc3f7;
    border-radius: 50%;
    width: 36px; height: 36px;
    animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f4f8; }
::-webkit-scrollbar-thumb { background: #4fc3f7; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #007FFF; }

/* ═══════════════════════════════════════════════════════════════════════════
   FOCUS / ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

:focus-visible {
    outline: 2px solid #4fc3f7;
    outline-offset: 3px;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    #hero-canvas,
    #shop-canvas,
    #product-canvas {
        /* On mobile — keep canvas but reduce intensity via JS options */
        opacity: 0.7;
    }

    .hero-orb-primary { width: 300px; height: 300px; }
    .hero-orb-secondary { width: 250px; height: 250px; }
}

@media (max-width: 480px) {
    /* Very small screens — disable canvas for battery/performance */
    #shop-canvas,
    #product-canvas {
        display: none;
    }
}