@charset "UTF-8";

/**
 * Modern Banner Component
 * 
 * Purpose: Modern, responsive banner display with position-based layout
 * Features:
 * - Position-based display (Slider Right First/Second, Slider Bottom)
 * - Modern card design
 * - Smooth hover effects
 * - 100% responsive
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   HOME HERO SECTION (Left Banners | Slider | Right Banners)
   ============================================================ */

.nx-home-hero-section {
    padding: 2rem 0;
    background: #fafafa;
}

.nx-home-hero-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nx-home-hero-wrapper {
    display: grid;
    gap: 1.5rem;
    align-items: stretch;
    min-height: 400px;
}

/* Dynamic Grid Layout Based on Banner Presence */
/* Scenario 1: Left + Slider + Right */
.nx-home-hero-wrapper {
    grid-template-columns: 1fr;
}

.nx-home-hero-section.has-side-banners .nx-home-hero-wrapper {
    grid-template-columns: 28% 1fr 28%;
}

/* Scenario 2: Only Right Banners */
.nx-home-hero-section.nx-slider-left-expanded .nx-home-hero-wrapper {
    grid-template-columns: 1fr 28%;
}

/* Scenario 3: Only Left Banners */
.nx-home-hero-section.nx-slider-right-expanded .nx-home-hero-wrapper {
    grid-template-columns: 28% 1fr;
}

/* Scenario 4: No Side Banners - Full Width */
.nx-home-hero-section.nx-full-width-slider .nx-home-hero-wrapper {
    grid-template-columns: 1fr;
}

.nx-home-slider-col {
    width: 100%;
    min-height: 400px;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.nx-home-banner-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.nx-banner-col-left,
.nx-banner-col-right {
    min-height: 400px;
    height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

/* Side Banner Cards - Equal Height Distribution */
.nx-banner-side {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
}

/* When 1 banner: takes 100% height */
.nx-home-banner-col:has(.nx-banner-side:only-child) .nx-banner-side {
    flex: 1 1 100%;
    height: 100%;
}

/* When 2 banners: each takes 50% height */
.nx-home-banner-col:has(.nx-banner-side:nth-child(2)) .nx-banner-side {
    flex: 1 1 calc(50% - 0.5rem);
    height: calc(50% - 0.5rem);
}

/* Small devices (< 768px): Show slider first, then ALL banners below in unified 2-column grid */
@media (max-width: 767px) {
    .nx-home-hero-section .nx-home-hero-wrapper {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Slider always comes first */
    .nx-home-slider-col {
        order: 1 !important;
        width: 100% !important;
        min-height: 250px;
    }
    
    /* Flatten banner column wrappers - banners become direct children */
    .nx-home-banner-col {
        order: 2 !important;
        display: contents !important;
    }
    
    /* Flatten left/right column wrappers */
    .nx-banner-col-left,
    .nx-banner-col-right {
        order: 2 !important;
        display: contents !important;
    }
    
    /* Unified grid: 2 columns, slider full width, banners flow in 2 columns */
    .nx-home-hero-section.has-side-banners .nx-home-hero-wrapper {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    /* Slider spans both columns (full width) */
    .nx-home-hero-section.has-side-banners .nx-home-slider-col {
        grid-column: 1 / -1;
        order: 1 !important;
        margin-bottom: 0.75rem;
    }
    
    /* All banners flow into 2-column grid */
    .nx-home-hero-section.has-side-banners .nx-banner-side {
        order: 2 !important;
        min-height: 180px;
        width: 100% !important;
        height: auto;
    }
    
    /* Position 3 banners section - also below slider, same 2-column grid */
    .nx-banner-section {
        order: 2 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    .nx-banner-container {
        max-width: 100% !important;
        padding: 0 1.5rem;
    }
    
    .nx-banner-slider-bottom {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        width: 100%;
    }
    
    .nx-banner-slider-bottom .nx-banner-card {
        min-height: 180px !important;
        max-height: none !important;
        height: auto !important;
        width: 100% !important;
    }
    
    /* Combine Position 3 banners with Position 1 & 2 visually */
    .nx-home-hero-section + .nx-banner-section {
        margin-top: -1rem !important; /* Remove gap between sections */
    }
}

/* Medium devices and above (>= 768px): Show banners in two rows, one column */
@media (min-width: 768px) {
    .nx-home-banner-col {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nx-banner-side {
        flex: 1 1 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* When 1 banner: takes 100% height */
    .nx-home-banner-col:has(.nx-banner-side:only-child) .nx-banner-side {
        flex: 1 1 100%;
        height: 100%;
    }
    
    /* When 2 banners: each takes 50% height */
    .nx-home-banner-col:has(.nx-banner-side:nth-child(2)) .nx-banner-side {
        flex: 1 1 calc(50% - 0.5rem);
        height: calc(50% - 0.5rem);
    }
}

@media (max-width: 768px) {
    .nx-home-hero-section {
        padding: 1.5rem 0;
    }
    
    .nx-home-banner-col {
        flex-direction: column !important;
        width: 100%;
    }
    
    .nx-banner-side {
        flex: 1 1 100% !important;
        min-height: 200px;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .nx-banner-side:last-child {
        margin-bottom: 0;
    }
    
    .nx-home-slider-col {
        min-height: 300px;
    }
}

/* ============================================================
   BANNER SECTION (Bottom Banners)
   ============================================================ */

.nx-banner-section {
    padding: 2rem 0;
    background: #fafafa;
}

.nx-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   SIDE BANNER IMAGE WRAPPER (Left/Right Columns)
   ============================================================ */

/* Side Banner Image Wrapper - Fills available height */
.nx-banner-side .nx-banner-image-wrapper {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    height: 100%;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
}

.nx-banner-side .nx-banner-image-wrapper picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nx-banner-side .nx-banner-image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* When only 1 banner in column - takes full height */
.nx-home-banner-col:has(.nx-banner-side:only-child) .nx-banner-side .nx-banner-image-wrapper {
    height: 100%;
}

/* When 2 banners in column - each takes 50% height */
.nx-home-banner-col:has(.nx-banner-side:nth-child(2)) .nx-banner-side .nx-banner-image-wrapper {
    height: calc(50% - 0.5rem);
}

@media (max-width: 991px) {
    .nx-banner-side .nx-banner-image-wrapper {
        padding-top: 56.25%; /* 16:9 on tablet */
        height: auto;
        flex: none;
        position: relative;
    }
    
    .nx-banner-side .nx-banner-image-wrapper picture {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .nx-home-banner-col:has(.nx-banner-side:nth-child(2)) .nx-banner-side .nx-banner-image-wrapper {
        height: auto;
        min-height: 200px;
    }
}

.nx-banner-slider-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 991px) {
    .nx-banner-slider-right {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============================================================
   SLIDER BOTTOM BANNERS (Position 3) - Dynamic Spacing
   ============================================================ */

.nx-banner-slider-bottom {
    display: grid;
    gap: 1rem;
    width: 100%;
}

/* 1 Banner: Full width */
.nx-banner-slider-bottom.nx-banner-bottom-one {
    grid-template-columns: 1fr;
}

/* 2 Banners: Half each (50% width) */
.nx-banner-slider-bottom.nx-banner-bottom-two {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 Banners: 1/3 each (33.33% width) */
.nx-banner-slider-bottom.nx-banner-bottom-three {
    grid-template-columns: repeat(3, 1fr);
}

/* Bottom banner cards - Height constraints */
.nx-banner-slider-bottom .nx-banner-card {
    min-height: 150px;
    max-height: 200px;
    height: 200px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nx-banner-slider-bottom .nx-banner-image-wrapper {
    min-height: 150px;
    max-height: 200px;
    height: 100%;
    padding-top: 0 !important;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    .nx-banner-slider-bottom.nx-banner-bottom-three {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nx-banner-slider-bottom .nx-banner-card {
        min-height: 140px;
        max-height: 180px;
        height: 180px;
    }
    
    .nx-banner-slider-bottom .nx-banner-image-wrapper {
        min-height: 140px;
        max-height: 180px;
        height: 100%;
    }
}

@media (max-width: 576px) {
    .nx-banner-slider-bottom {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .nx-banner-slider-bottom .nx-banner-card {
        min-height: 120px;
        max-height: 160px;
        height: 160px;
    }
    
    .nx-banner-slider-bottom .nx-banner-image-wrapper {
        min-height: 120px;
        max-height: 160px;
        height: 100%;
    }
}

/* ============================================================
   BANNER CARD - UNIQUE STYLE
   ============================================================ */

.nx-banner-card {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    isolation: isolate;
    min-height: 200px;
    height: 100%;
    will-change: transform, box-shadow, background;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Minimal hover - Only subtle transform, no background/shadows/borders */
.nx-banner-card:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px) scale(1.01);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1 !important;
    visibility: visible !important;
    border: none;
}

.nx-banner-card:nth-child(1) { animation-delay: 0.1s; }
.nx-banner-card:nth-child(2) { animation-delay: 0.2s; }
.nx-banner-card:nth-child(3) { animation-delay: 0.3s; }
.nx-banner-card:nth-child(n+4) { animation-delay: 0.4s; }

.nx-banner-card::before {
    display: none;
}

.nx-banner-card:hover::before {
    display: none;
}

/* Ensure theme color shows through on hover - Keep banner visible */
.nx-banner-card:hover .nx-banner-image-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1.02);
    z-index: 2;
}

.nx-banner-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 1;
}

.nx-banner-card:hover::after {
    opacity: 0;
    background: transparent;
}

/* ============================================================
   BANNER IMAGE
   ============================================================ */

.nx-banner-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio - default for bottom banners */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #fafafa 100%);
    isolation: isolate;
    border-radius: 18px;
    margin: 2px;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

/* Bottom banners use fixed height, not padding-top */
.nx-banner-slider-bottom .nx-banner-image-wrapper {
    padding-top: 0 !important;
    position: relative;
    height: 100%;
}

.nx-banner-card:hover .nx-banner-image-wrapper {
    margin: 0;
    border-radius: 18px;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2;
}

/* No border, shadow, or background on hover */
.nx-banner-slider-bottom .nx-banner-card:hover {
    /* No additional styles - clean hover */
}

/* No effects on hover */
.nx-banner-slider-bottom .nx-banner-card:hover .nx-banner-image-wrapper::after {
    display: none;
}

/* Side banners (left/right) use height-based sizing, not padding-top */
.nx-banner-side .nx-banner-image-wrapper {
    padding-top: 0 !important;
    height: 100%;
    margin: 0;
    border-radius: 18px;
    background: transparent;
}

@media (max-width: 991px) {
    .nx-banner-side .nx-banner-image-wrapper {
        padding-top: 56.25% !important; /* 16:9 on tablet/mobile */
        height: auto;
        position: relative;
    }
}

.nx-banner-image-wrapper picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.nx-banner-image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s ease;
    will-change: transform;
    filter: brightness(1) contrast(1) saturate(1);
}

.nx-banner-card:hover .nx-banner-image-wrapper img {
    transform: translate(-50%, -50%) scale(1.05) rotate(0.3deg);
    filter: brightness(1.04) contrast(1.06) saturate(1.1);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 3;
}

.nx-banner-side:hover .nx-banner-image-wrapper img {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.05) contrast(1.1) saturate(1.2);
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.nx-banner-image-wrapper img[data-src] {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nx-banner-image-wrapper img[src]:not([data-src]),
.nx-banner-image-wrapper img.loaded {
    opacity: 1;
}

.nx-banner-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
    z-index: 1;
    pointer-events: none;
}

.nx-banner-image-wrapper img.loaded ~ ::after,
.nx-banner-image-wrapper img[src]:not([data-src]) ~ ::after {
    animation: none;
    opacity: 0;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

/* Additional smooth hover effects */
.nx-banner-card {
    will-change: transform, box-shadow, background;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nx-banner-card:hover {
    will-change: transform, box-shadow, background;
}

/* Smooth image transitions */
.nx-banner-image-wrapper img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes gradient-rotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .nx-banner-section {
        padding: 1.5rem 0;
    }
    
    .nx-banner-container {
        padding: 0 1rem;
    }
    
    .nx-banner-card {
        border-radius: 12px;
        min-height: 180px;
    }
    
    .nx-banner-image-wrapper {
        padding-top: 50%;
    }
}

@media (max-width: 576px) {
    .nx-banner-section {
        padding: 1rem 0;
    }
    
    .nx-banner-container {
        padding: 0 0.75rem;
    }
    
    .nx-banner-card {
        border-radius: 8px;
        min-height: 150px;
    }
    
    .nx-banner-image-wrapper {
        padding-top: 45%;
    }
    
    .nx-banner-side .nx-banner-image-wrapper {
        min-height: 150px;
    }
}

/* ============================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================ */

.nx-banner-card {
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nx-banner-image-wrapper img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .nx-banner-card,
    .nx-banner-image-wrapper img {
        transition: none !important;
        animation: none !important;
    }
    
    .nx-banner-card {
        opacity: 1 !important;
        transform: none !important;
    }
}
