/* ═══════════════════════════════════════════════
   Floating Gallery Hero — Premium Showcase
   Infinite scrolling product image marquee
   ═══════════════════════════════════════════════ */

/* === Hero Container === */
.hero-gallery-wrapper {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 520px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .hero-gallery-wrapper {
        min-height: 580px;
    }

    .hero-gallery-bg {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 8px 0;
    }

    .hero-gallery-bg .side-fade-left,
    .hero-gallery-bg .side-fade-right {
        width: 40px;
    }

    .hero-gallery-bg::before {
        height: 20px;
    }

    .hero-gallery-bg::after {
        height: 20px;
    }
}

/* === Background Image Rows === */
.hero-gallery-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-gallery-bg.loaded {
    opacity: 1;
}

/* Gradient fading edges */
.hero-gallery-bg::before,
.hero-gallery-bg::after {
    content: '';
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.hero-gallery-bg::before {
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom,
            var(--hero-bg, rgb(248, 250, 252)) 0%,
            transparent 100%);
}

.hero-gallery-bg::after {
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top,
            var(--hero-bg, rgb(248, 250, 252)) 0%,
            transparent 100%);
}

/* Side fades */
.hero-gallery-bg .side-fade-left,
.hero-gallery-bg .side-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 2;
    pointer-events: none;
}

.hero-gallery-bg .side-fade-left {
    left: 0;
    background: linear-gradient(to right,
            var(--hero-bg, rgb(248, 250, 252)) 0%,
            transparent 100%);
}

.hero-gallery-bg .side-fade-right {
    right: 0;
    background: linear-gradient(to left,
            var(--hero-bg, rgb(248, 250, 252)) 0%,
            transparent 100%);
}

/* Dark mode support */
.dark .hero-gallery-bg::before {
    background: linear-gradient(to bottom, rgb(15, 23, 42) 0%, transparent 100%);
}

.dark .hero-gallery-bg::after {
    background: linear-gradient(to top, rgb(15, 23, 42) 0%, transparent 100%);
}

.dark .hero-gallery-bg .side-fade-left {
    background: linear-gradient(to right, rgb(15, 23, 42) 0%, transparent 100%);
}

.dark .hero-gallery-bg .side-fade-right {
    background: linear-gradient(to left, rgb(15, 23, 42) 0%, transparent 100%);
}

/* === Marquee Row === */
.marquee-row {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 8px 0;
}

.marquee-row.scroll-left {
    animation: marqueeLeft 45s linear infinite;
}

.marquee-row.scroll-right {
    animation: marqueeRight 50s linear infinite;
}

.marquee-row.scroll-left-slow {
    animation: marqueeLeft 60s linear infinite;
}

@keyframes marqueeLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marqueeRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* Pause on hover for interactivity */
.hero-gallery-bg:hover .marquee-row {
    animation-play-state: paused;
}

/* === Image Cards === */
.gallery-card {
    flex-shrink: 0;
    width: 220px;
    height: 170px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease;
    transform: rotate(-2deg);
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.marquee-row:nth-child(2) .gallery-card {
    transform: rotate(1deg);
}

.marquee-row:nth-child(3) .gallery-card {
    transform: rotate(-1deg);
}

.gallery-card:hover {
    transform: rotate(0deg) scale(1.08);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover img {
    transform: scale(1.05);
}

/* Shimmer loading effect */
.gallery-card.loading {
    background: linear-gradient(-45deg, #e2e8f0, #f8fafc, #e2e8f0, #f1f5f9);
    background-size: 400% 400%;
    animation: shimmer 2s ease infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Card type badge */
.gallery-card .card-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .card-badge {
    opacity: 1;
    transform: translateY(0);
}

.card-badge.studio {
    background: rgba(59, 130, 246, 0.8);
    color: white;
}

.card-badge.banner {
    background: rgba(168, 85, 247, 0.8);
    color: white;
}

.card-badge.product {
    background: rgba(16, 185, 129, 0.8);
    color: white;
}

/* === Hero Text Overlay === */
.hero-text-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
    max-width: 720px;
}

.hero-glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 40px 48px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark .hero-glass-card {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(71, 85, 105, 0.3);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .hero-glass-card {
        padding: 20px 16px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }

    .dark .hero-glass-card {
        background: rgba(15, 23, 42, 0.75);
    }

    .hero-text-overlay {
        padding: 0 12px;
    }

    .hero-text-overlay h1 {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }

    .hero-text-overlay p {
        font-size: 0.85rem !important;
    }
}

/* Stats bar */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .hero-stats {
        gap: 20px;
    }

    .hero-stat-number {
        font-size: 1rem;
    }
}

/* === Responsive card sizing === */
@media (max-width: 768px) {
    .gallery-card {
        width: 130px;
        height: 100px;
        border-radius: 10px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
        transform: rotate(-1deg);
    }

    .marquee-row:nth-child(2) .gallery-card {
        transform: rotate(0.5deg);
    }

    .marquee-row:nth-child(3) .gallery-card {
        transform: rotate(-0.5deg);
    }

    .marquee-row {
        gap: 8px;
        padding: 2px 0;
    }

    .marquee-row.scroll-left {
        animation-duration: 25s;
    }

    .marquee-row.scroll-right {
        animation-duration: 30s;
    }

    .marquee-row.scroll-left-slow {
        animation-duration: 35s;
    }
}

@media (max-width: 480px) {
    .gallery-card {
        width: 110px;
        height: 85px;
        border-radius: 8px;
    }

    .marquee-row {
        gap: 6px;
        padding: 2px 0;
    }
}