/* ========================================
   HOW IT WORKS SECTION
   ======================================== */

.how-it-works-section {
    background-color: #ffffff;
}

.how-it-works-container {
    padding: 64px 16px;
}

/* Main Title */
.how-it-works-title {
    font-family: "loew-variable", sans-serif;
    font-weight: 700;
    font-stretch: 10%;
    font-size: 38px;
    line-height: 90%;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--color-black);
    margin: 0 0 16px 0;
}

/* Intro Text */
.how-it-works-intro {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 110%;
    letter-spacing: 0%;
    color: #2B2B2B;
    margin: 0 0 40px 0;
}

/* Steps Container */
.how-it-works-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 40px;
}

/* Individual Step */
.how-it-works-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-grey);
}

/* Step Image */
.how-it-works-step-image {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
}

.how-it-works-step-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Step Content */
.how-it-works-step-content {
    flex: 1;
}

/* Step Number */
.how-it-works-step-number {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 110%;
    letter-spacing: 0%;
    text-transform: uppercase;
    color: #2B2B2B;
    display: block;
    margin-bottom: 8px;
}

/* Step Title */
.how-it-works-step-title {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 100%;
    letter-spacing: -2%;
    color: var(--color-charcoal);
    margin: 0 0 8px 0;
}

/* Step Text */
.how-it-works-step-text {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 110%;
    letter-spacing: 0%;
    color: #2B2B2B;
    margin: 0;
}

/* CTA Button */
.how-it-works-cta {
    display: block;
    width: 100%;
    padding: 22px 32px;
    background-color: var(--color-fluoro);
    border: 1px solid var(--color-charcoal);
    border-radius: 8px;
    text-align: center;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 110%;
    letter-spacing: -3%;
    color: var(--color-charcoal);
    text-decoration: none;
    transition: color 300ms ease, border-color 300ms ease, transform 200ms ease, box-shadow 200ms ease;

    /* Fancy Hover Setup */
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.how-it-works-cta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--color-charcoal);
    transition: height 300ms ease;
    z-index: -1;
}

.how-it-works-cta:hover {
    opacity: 1;
    color: var(--color-fluoro);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.how-it-works-cta:hover::after {
    height: 100%;
}

/* Hide desktop button on mobile, show mobile button */
.how-it-works-cta-desktop {
    display: none;
}

.how-it-works-cta-mobile {
    display: block;
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1439px) {
    .how-it-works-steps {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
    }

    .how-it-works-step {
        flex: 1 1 calc(50% - 24px);
        /* 2 per row */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 0;
        border: 1px solid var(--color-grey);
        padding: 24px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .how-it-works-step-content {
        margin-top: 16px;
    }
}

/* Desktop Styles */
@media (min-width: 1440px) {

    /* Show desktop button, hide mobile button */
    .how-it-works-cta-desktop {
        display: flex;
    }

    .how-it-works-cta-mobile {
        display: none !important;
    }

    .how-it-works-container {
        padding: 80px 64px;
    }

    .how-it-works-section {
        position: relative;
    }

    /* Header with title, intro, and button */
    .how-it-works-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 64px;
        gap: 32px;
    }

    .how-it-works-header-content {
        flex: 1;
        max-width: 600px;
    }

    .how-it-works-title {
        font-size: 64px;
        line-height: 90%;
        margin: 0 0 24px 0;
    }

    .how-it-works-intro {
        margin: 0;
    }

    /* Button in header on desktop */
    .how-it-works-cta {
        width: 210px;
        height: 64px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Steps horizontal layout */
    .how-it-works-steps {
        flex-direction: row;
        gap: 32px;
        margin-bottom: 0;
    }

    .how-it-works-step {
        flex-direction: column;
        flex: 1;
        gap: 0;
        border-bottom: 0;
    }

    /* Larger images */
    .how-it-works-step-image {
        width: 100%;
        height: 200px;
        max-width: 294px;
    }

    /* Step title larger on desktop */
    .how-it-works-step-title {
        font-size: 24px;
        margin: 0;
        margin-top: 16px;
        margin-bottom: 8px;
    }

    /* 
       Reordering logic:
       Parent .how-it-works-step is flex column with gap 20px.
       Children: Image, Content.
       
       We unwrap .how-it-works-step-content using display: contents.
       Now effective children of .how-it-works-step are: Image, Number, Title, Text.
       
       Order logic:
       Number: -1 (First)
       Image: Default (0) (Second)
       Title: Default (0) (Third)
       Text: Default (0) (Fourth)
    */
    .how-it-works-step-content {
        display: contents;
    }

    .how-it-works-step-number {
        order: -1;
        margin-bottom: 16px;
    }
}