/* ========================================
   HOW IT WORKS - MOBILE HORIZONTAL CAROUSEL
   Professional UI/UX Mobile Optimization
   ======================================== */

@media (max-width: 768px) {

    /* Steps Grid - Professional Horizontal Carousel */
    #how-it-works .steps-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 16px;
        padding: 10px 20px 30px 20px !important;
        margin: 0 -20px;
        -webkit-overflow-scrolling: touch;
        /* Enable momentum scrolling on iOS */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
        grid-template-columns: unset !important;
        /* Override any grid layout */
    }

    /* Hide scrollbar but keep functionality */
    #how-it-works .steps-grid::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    /* Individual Step Cards in Horizontal Layout */
    #how-it-works .step-card {
        flex: 0 0 calc(100% - 40px);
        /* Full width minus padding */
        min-width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        scroll-snap-align: center;
        scroll-snap-stop: always;
        padding: 32px 24px;
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: var(--surface);
        border-radius: 24px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    /* Subtle hover/active effect for touch */
    #how-it-works .step-card:active {
        transform: scale(0.98);
    }

    /* Center all content within step cards */
    #how-it-works .step-card h3,
    #how-it-works .step-card p {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100%;
    }

    /* Step icons centered */
    #how-it-works .step-card .step-icon {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }

    /* Scroll Indicator for How It Works Section */
    #how-it-works .container {
        position: relative;
    }

    /* Add scroll hint indicator */
    #how-it-works .steps-grid::after {
        content: '← Swipe →';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--text-gray);
        opacity: 0.6;
        font-weight: 500;
        letter-spacing: 1px;
        pointer-events: none;
        animation: fadeInOutSteps 3s ease-in-out infinite;
    }

    @keyframes fadeInOutSteps {

        0%,
        100% {
            opacity: 0.4;
        }

        50% {
            opacity: 0.8;
        }
    }
}

@media (max-width: 480px) {

    #how-it-works .step-card {
        padding: 24px 20px;
        text-align: center !important;
    }

    #how-it-works .step-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

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

@media (max-width: 768px) {

    /* GPU acceleration for smooth scrolling */
    #how-it-works .step-card {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}