/* ==========================================================================
   BL Electronics — custom CSS
   Supplements Tailwind CDN with utility tweaks, smooth scrolling, and
   component polish. Loaded after Tailwind.
   ========================================================================== */

:root {
    --brand: #0057FF;
    --accent: #00C2FF;
    --ink: #0a0e1a;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--brand);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Scrollbar (WebKit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --------------------------------------------------------------------------
   Focus ring
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Hero gradient background animation
   -------------------------------------------------------------------------- */
@keyframes hero-gradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.hero-gradient-animated {
    background: linear-gradient(120deg, #0057FF, #00C2FF, #0057FF);
    background-size: 200% 200%;
    animation: hero-gradient 8s ease infinite;
}

/* --------------------------------------------------------------------------
   Swiper overrides
   -------------------------------------------------------------------------- */
.swiper { width: 100%; }
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 16px !important;
    font-weight: 800 !important;
}
.hero-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.4;
    width: 10px;
    height: 10px;
}
.hero-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--accent);
    width: 28px;
    border-radius: 5px;
}

/* Full, lossless hero presentation. The foreground always shows the entire
   uploaded file; the softly filled backdrop only prevents letterboxing when
   an older upload does not match the required 25:14 frame. */
.hero-media-frame {
    width: 100%;
    aspect-ratio: 25 / 14;
    overflow: hidden;
    background: var(--ink);
}
.hero-media-backdrop,
.hero-media-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.hero-media-backdrop {
    object-fit: cover;
    filter: blur(20px);
    opacity: .38;
    transform: scale(1.04);
}
.hero-media-image {
    object-fit: contain;
    object-position: center;
}

/* Brand cover area is exactly 600px on every viewport. */
.brand-hero { height: 600px; }
.brand-cover-backdrop,
.brand-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.brand-cover-backdrop {
    object-fit: cover;
    filter: blur(22px);
    opacity: .42;
    transform: scale(1.05);
}
.brand-cover-image {
    object-fit: contain;
    object-position: center;
}
.blog-featured-image {
    object-fit: contain;
    object-position: center;
}

/* --------------------------------------------------------------------------
   Catalogue media frames

   Product and category cards always use a square, edge-to-edge image area.
   Blog listing cards use a 3:2 image area. `object-fit: cover` only affects
   on-screen presentation; uploaded source files are never resized or
   recompressed. The small zoom stays clipped inside the frame.
   -------------------------------------------------------------------------- */
.product-media-frame,
.category-media-frame,
.blog-card-media-frame {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #f1f5f9;
}
.product-media-frame {
    background: #fff;
}
.product-media-frame,
.category-media-frame {
    aspect-ratio: 1 / 1;
}
.blog-card-media-frame {
    aspect-ratio: 3 / 2;
}
.product-media-image,
.category-media-image,
.blog-card-media-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-position: center;
    transform: scale(1);
    transition: transform .5s cubic-bezier(.2, .75, .25, 1), filter .5s ease;
}
.product-media-image {
    object-fit: contain;
    background: #fff;
}
.category-media-image,
.blog-card-media-image {
    object-fit: cover;
}
.group:hover .product-media-image,
.group:hover .category-media-image,
.group:hover .blog-card-media-image {
    transform: scale(1.06);
    filter: saturate(1.04);
}

.product-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbs .swiper-slide {
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
}
.product-thumbs .swiper-slide-active,
.product-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--brand) !important;
}

/* Product gallery: mobile-first fallback when Swiper/Tailwind JS or CDN CSS is unavailable */
.product-swiper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.product-swiper .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}
.product-swiper .swiper-slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    height: 100%;
}
.product-swiper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform .5s cubic-bezier(.2, .75, .25, 1);
}
.product-swiper:hover img {
    transform: scale(1.035);
}
.product-thumbs {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
.product-thumbs .swiper-wrapper {
    display: flex;
    gap: 0.5rem;
}
.product-thumbs .swiper-slide {
    flex: 0 0 4rem;
    width: 4rem !important;
    height: 4rem !important;
}
.product-thumbs .swiper-slide img {
    object-fit: cover;
}
@media (min-width: 640px) {
    .product-thumbs .swiper-slide {
        flex-basis: 5rem;
        width: 5rem !important;
        height: 5rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-media-image,
    .category-media-image,
    .blog-card-media-image,
    .product-swiper img {
        transition: none;
    }
    .group:hover .product-media-image,
    .group:hover .category-media-image,
    .group:hover .blog-card-media-image,
    .product-swiper:hover img {
        transform: none;
    }
}
@media (max-width: 767px) {
    .product-swiper {
        aspect-ratio: 1 / 1;
    }
}

/* --------------------------------------------------------------------------
   Card hover lift
   -------------------------------------------------------------------------- */
.lift-on-hover {
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.lift-on-hover:hover {
    transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   Marquee strip (for brand logos if added)
   -------------------------------------------------------------------------- */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* --------------------------------------------------------------------------
   Glass effect
   -------------------------------------------------------------------------- */
.glass {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.18);
}
.glass-dark {
    background: rgba(10,14,26,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* --------------------------------------------------------------------------
   Image placeholder
   -------------------------------------------------------------------------- */
.image-placeholder {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}
.image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s linear infinite;
}

/* --------------------------------------------------------------------------
   Hide scrollbar utility
   -------------------------------------------------------------------------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --------------------------------------------------------------------------
   Mobile nav — uses Tailwind 'hidden' class toggled by JS.
   (No CSS max-height rules here — they conflict with Tailwind's hidden class.)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Print styles
   -------------------------------------------------------------------------- */
@media print {
    header, footer, aside, .no-print { display: none !important; }
    body { color: #000; }
    a { text-decoration: underline; }
}

/* --------------------------------------------------------------------------
   Swiper indicators
   -------------------------------------------------------------------------- */
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.75);
    opacity: 1;
}
.swiper-pagination-bullet-active {
    background: #00C2FF;
}

/* Product gallery navigation: icon-only, transparent, polished */
.product-gallery-nav {
    width: 2.75rem !important;
    height: 2.75rem !important;
    color: #fff !important;
    background: transparent !important;
    border: 0 !important;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.55));
}
.product-gallery-nav::after {
    font-size: 1.65rem !important;
    font-weight: 900 !important;
}
