/* Modern UI effects — hover, stagger, hero, glass header, skeleton */

/* ── Smooth scroll (html already has scroll-behavior; reinforce anchors) ── */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* ── Glass header on scroll ── */
.site-header {
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.site-header.is-scrolled {
    background: rgba(7, 9, 13, 0.72);
    backdrop-filter: blur(20px) saturate(1.35);
    -webkit-backdrop-filter: blur(20px) saturate(1.35);
    border-bottom-color: rgba(251, 146, 60, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ── Input focus glow ── */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(251, 146, 60, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.14), 0 0 20px rgba(251, 146, 60, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form:focus-within {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

/* ── Card hover glow + image zoom ── */
.listing-card,
.product-card {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.28s,
        box-shadow 0.28s;
}
.listing-card:hover,
.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 146, 60, 0.35);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(251, 146, 60, 0.08),
        0 0 28px rgba(251, 146, 60, 0.12);
}
.listing-card-img img,
.product-card-visual img {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.listing-card:hover .listing-card-img img,
.product-card:hover .product-card-visual img {
    transform: scale(1.06);
}

/* ── Price pulse ── */
@keyframes pricePulse {
    0%, 100% { text-shadow: 0 0 0 transparent; opacity: 1; }
    50% { text-shadow: 0 0 14px rgba(245, 158, 11, 0.55); opacity: 1; }
}
.price-pulse {
    animation: pricePulse 2.4s ease-in-out infinite;
}

/* ── Badge bounce ── */
@keyframes badgeBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(1px); }
}
.badge-featured,
.badge-boost {
    animation: badgeBounce 2.8s ease-in-out infinite;
}
.badge-boost { animation-delay: 0.4s; }

/* ── Hero tab underline slide ── */
.hero-tabs {
    position: relative;
}
.hero-tab-indicator {
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--orange), var(--gold));
    box-shadow: 0 0 12px rgba(251, 146, 60, 0.6);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* ── Hero banner crossfade + edge gradient glow ── */
.hero-banner-wrap {
    position: relative;
    aspect-ratio: 1280 / 360;
    max-height: 360px;
    border-radius: var(--radius-xl);
}
.hero-banner-wrap::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: linear-gradient(
        135deg,
        rgba(251, 146, 60, 0.45) 0%,
        rgba(0, 212, 170, 0.25) 50%,
        rgba(56, 189, 248, 0.35) 100%
    );
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    filter: blur(8px);
    transition: opacity 0.4s;
}
.hero-banner-wrap:hover::before {
    opacity: 0.75;
}
.hero-banner-wrap .hero-banner,
.hero-banner-wrap .hero-slide {
    position: absolute;
    inset: 0;
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.55s ease, visibility 0.55s;
    margin: 0;
    max-height: none;
    height: 100%;
}
.hero-banner-wrap .hero-banner.active,
.hero-banner-wrap .hero-slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ── Stagger fade-in ── */
.stagger-grid > .listing-card,
.stagger-grid > .product-card,
.stagger-grid > article {
    opacity: 0;
    transform: translateY(18px);
}
.stagger-grid.is-revealed > .listing-card,
.stagger-grid.is-revealed > .product-card,
.stagger-grid.is-revealed > article {
    animation: staggerFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.stagger-grid.is-revealed > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-grid.is-revealed > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-grid.is-revealed > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-grid.is-revealed > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-grid.is-revealed > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-grid.is-revealed > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-grid.is-revealed > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-grid.is-revealed > *:nth-child(8) { animation-delay: 0.24s; }
.stagger-grid.is-revealed > *:nth-child(n+9) { animation-delay: 0.27s; }

/* ── Skeleton loader ── */
.card-img-skeleton {
    position: relative;
    overflow: hidden;
    background: #121820;
}
.card-img-skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(
        90deg,
        rgba(20, 26, 36, 0) 0%,
        rgba(40, 52, 72, 0.65) 50%,
        rgba(20, 26, 36, 0) 100%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.15s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.35s;
}
.card-img-skeleton.is-loaded::before {
    opacity: 0;
    animation: none;
}
.card-img-skeleton img {
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 2;
}
.card-img-skeleton.is-loaded img {
    opacity: 1;
}
.listing-card-img .badge-featured,
.listing-card-img .badge-boost {
    z-index: 4;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Footer trust badge hover ── */
.trust-badge,
.footer-trust-grid .etbis-badge {
    transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.trust-badge:hover,
.footer-trust-grid .etbis-badge:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 212, 170, 0.4);
    box-shadow: 0 8px 28px rgba(0, 212, 170, 0.12);
    background: rgba(0, 212, 170, 0.04);
}
.trust-badge:hover .ico {
    color: var(--orange);
    filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.45));
    transition: color 0.25s, filter 0.25s;
}

@media (max-width: 768px) {
    .hero-banner-wrap {
        aspect-ratio: 16 / 9;
        max-height: 220px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .price-pulse,
    .badge-featured,
    .badge-boost { animation: none; }
    .listing-card:hover,
    .product-card:hover { transform: none; }
    .listing-card:hover .listing-card-img img,
    .product-card:hover .product-card-visual img { transform: none; }
    .stagger-grid > * {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    .hero-banner-wrap .hero-banner,
    .hero-banner-wrap .hero-slide { transition: none; }
    .card-img-skeleton::before { animation: none; }
    .card-img-skeleton img { opacity: 1; }
}
