/*
 * Gallery4 Component - Electric Scooter Edition
 * Author: Claude Code
 * Description: Gallery carousel component for showcasing electric scooter benefits
 */

/* ==========================================================================
   Gallery4 Component Styles
   ========================================================================== */

/* Prevent horizontal overflow */
.mkdf-gallery4-section,
.mkdf-gallery4-section * {
    box-sizing: border-box;
}

/* Fix for page-wide overflow issues */
body.mkdf-gallery4-loaded {
    overflow-x: hidden;
}

/* Ensure no horizontal white space on all devices */
.mkdf-wrapper,
.mkdf-wrapper-inner,
.mkdf-container,
.mkdf-container-inner {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.mkdf-gallery4-section {
    padding: 80px 0;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.mkdf-gallery4-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Header */
.mkdf-gallery4-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 2rem;
}

.mkdf-gallery4-content {
    flex: 1;
    max-width: 600px;
}

.mkdf-gallery4-title {
    font-size: 3rem;
    font-weight: 500;
    line-height: 1.1;
    margin: 0 0 1rem 0;
    color: #000;
    font-family: "Rajdhani", sans-serif;
    letter-spacing: -0.02em;
}

.mkdf-gallery4-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Navigation Buttons */
.mkdf-gallery4-nav {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mkdf-gallery4-nav-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
}

.mkdf-gallery4-nav-btn:hover {
    background: rgba(238, 179, 50, 0.1);
    color: #eeb332;
}

.mkdf-gallery4-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto;
}

.mkdf-gallery4-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Carousel Container */
.mkdf-gallery4-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

.mkdf-gallery4-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-left: 0;
    position: relative;
    padding: 0 20px;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Individual Items */
.mkdf-gallery4-item {
    flex: 0 0 320px;
    max-width: 320px;
    padding: 0 10px;
    position: relative;
}

.mkdf-gallery4-card {
    position: relative;
    height: 432px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.mkdf-gallery4-card:hover {
    transform: scale(1.02);
}

.mkdf-gallery4-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mkdf-gallery4-card:hover .mkdf-gallery4-image {
    transform: scale(1.05);
}

.mkdf-gallery4-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(238, 179, 50, 0) 0%,
        rgba(238, 179, 50, 0.4) 60%,
        rgba(238, 179, 50, 0.8) 100%
    );
    mix-blend-mode: multiply;
}

.mkdf-gallery4-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: white;
    z-index: 2;
}

.mkdf-gallery4-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    color: white;
}

.mkdf-gallery4-card-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 2rem 0;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mkdf-gallery4-read-more {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.mkdf-gallery4-read-more svg {
    margin-left: 0.5rem;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.mkdf-gallery4-card:hover .mkdf-gallery4-read-more svg {
    transform: translateX(4px);
}

/* Indicators */
.mkdf-gallery4-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.mkdf-gallery4-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(238, 179, 50, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mkdf-gallery4-indicator.active {
    background: #eeb332;
    width: 24px;
    border-radius: 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .mkdf-gallery4-container {
        max-width: 960px;
        padding: 0 15px;
    }
    
    .mkdf-gallery4-track {
        padding: 0 15px;
    }
    
    .mkdf-gallery4-item {
        flex: 0 0 300px;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    /* Section and container adjustments */
    .mkdf-gallery4-section {
        padding: 60px 0;
        overflow-x: hidden;
    }
    
    .mkdf-gallery4-container {
        padding: 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Header responsive */
    .mkdf-gallery4-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding: 0 15px;
    }
    
    .mkdf-gallery4-title {
        font-size: 2.5rem;
    }
    
    /* Hide navigation on mobile - handled by JS */
    .mkdf-gallery4-nav {
        display: none;
    }
    
    /* Mobile carousel setup */
    .mkdf-gallery4-carousel {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        overflow: hidden;
        position: relative;
    }
    
    /* Mobile track - horizontal scroll enabled */
    .mkdf-gallery4-track {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding: 0 15px;
        margin: 0;
        transition: none;
        transform: none !important;
        width: auto;
        gap: 0;
    }
    
    /* Hide scrollbar on mobile */
    .mkdf-gallery4-track::-webkit-scrollbar {
        display: none;
    }
    
    /* Mobile items - full width cards */
    .mkdf-gallery4-item {
        flex: 0 0 calc(100vw - 60px);
        max-width: calc(100vw - 60px);
        padding: 0 10px;
        scroll-snap-align: start;
    }
    
    .mkdf-gallery4-card {
        height: 380px;
        width: 100%;
    }
    
    .mkdf-gallery4-content-overlay {
        padding: 1.5rem;
    }
    
    /* Mobile indicators - larger and more prominent */
    .mkdf-gallery4-indicators {
        margin-top: 1.5rem;
        gap: 0.75rem;
    }
    
    .mkdf-gallery4-indicator {
        width: 10px;
        height: 10px;
    }
    
    .mkdf-gallery4-indicator.active {
        width: 30px;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .mkdf-gallery4-title {
        font-size: 2rem;
    }
    
    .mkdf-gallery4-item {
        flex: 0 0 calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        padding: 0 8px;
    }
    
    .mkdf-gallery4-track {
        padding: 0 12px;
        gap: 0;
    }
    
    .mkdf-gallery4-card {
        height: 340px;
    }
    
    .mkdf-gallery4-content-overlay {
        padding: 1.25rem;
    }
    
    .mkdf-gallery4-card-title {
        font-size: 1.1rem;
    }
    
    .mkdf-gallery4-card-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mkdf-gallery4-overlay {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.6) 60%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mkdf-gallery4-track,
    .mkdf-gallery4-card,
    .mkdf-gallery4-image,
    .mkdf-gallery4-nav-btn,
    .mkdf-gallery4-indicator,
    .mkdf-gallery4-read-more svg {
        transition: none;
    }
    
    .mkdf-gallery4-card:hover {
        transform: none;
    }
    
    .mkdf-gallery4-card:hover .mkdf-gallery4-image {
        transform: none;
    }
}

/* Loading states */
.mkdf-gallery4-image {
    background-color: #f0f0f0;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.mkdf-gallery4-image[src] {
    background: none;
}

/* Performance optimizations */
.mkdf-gallery4-track {
    contain: layout style;
}

.mkdf-gallery4-item {
    contain: layout style;
}

/* Focus states for accessibility */
.mkdf-gallery4-nav-btn:focus,
.mkdf-gallery4-indicator:focus,
.mkdf-gallery4-card:focus {
    outline: 2px solid #eeb332;
    outline-offset: 2px;
}

/* Ensure proper z-indexing */
.mkdf-gallery4-nav {
    z-index: 10;
}

.mkdf-gallery4-indicators {
    z-index: 5;
}