body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: white;
    color: #333;
}

header {
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* New header styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-container img {
    height: 100px;
}

.main-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.header-button, .cta-button {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
}

.header-button {
    background: transparent;
    color: #1D1E20;
    font-family: 'Roboto', sans-serif;
}

.cta-button {
    background: #007bff;
    color: white;
}

.cta-button:hover {
    background: #0056b3;
}

.user-info span {
    font-size: 0.9em;
}

/* Main content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* space on left and right */
    box-sizing: border-box;
}

main {
    padding: 20px;
}

.hero-section {
    text-align: center;
    padding: 50px 20px;
}

.hero-section-h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.hero-section-h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.hero-section-p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
}
.client-section {
    text-align: center;
    padding: 20px;
}

.client-image {
    margin-left: 5%;
    max-width: 10%;
    height: auto;
    border-radius: 8%;
    cursor: pointer;
    transition: transform 0.2s;
}

.client-image:hover {
    transform: scale(1.05);
}

/* Popup styles */
.popup {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.popup-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.popup-image-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.popup-image {
    max-width: 45%;
    border-radius: 8px;
}

.popup-text {
    flex: 1;
    margin-left: 20px;
}

/* Footer */
footer {
    background: #f8f8f8;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
    border-top: 1px solid #e0e0e0;
}
.burger {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.img1 {
    width: 100%; 
    height: auto;
    border-radius: 8%; 
}
.img2 {
    width: 80%; 
    height: auto;
    border-radius: 8%;
}
.img3 {
    width: 80%; 
    height: auto;
    border-radius: 8%;
}

@media (max-width: 768px) {
    /* Burger visible */
    .burger {
        display: block;
    }

    /* Nav links hidden by default, flex column and centered */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: center;  /* Center burger menu links */
        width: 100%;
        margin-top: 10px;
        text-align: center;   /* Center text in burger menu */
    }

    .nav-links.show {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
    }

    /* Center buttons and allow width shrink */
    .header-button,
    .cta-button {
        width: auto;                  /* Let button size shrink */
        align-self: center;           /* Center within flex */
        text-align: center;
        margin: 5px auto;             /* Center horizontally */
        display: block;               /* Make block for margin auto */
        max-width: 200px;             /* Limit width so it’s not full width */
        box-sizing: border-box;
    }

    /* Specifically target the "Consultoría gratuita" button to limit width */
    .main-nav > .cta-button {
        max-width: 160px;             /* smaller width for that button */
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Header layout stacked */
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Sections stack with text first, image second */
    .opportunity-section,
    .maximo-partido-section,
    .como-ayudar-section {
        flex-direction: column !important;
    }

    /* Enforce text first, image second order */
    .opportunity-section > div:nth-child(1),
    .maximo-partido-section > div:nth-child(2),
    .como-ayudar-section > div:nth-child(1) {
        order: 1;
    }

    .opportunity-section > div:nth-child(2),
    .maximo-partido-section > div:nth-child(1),
    .como-ayudar-section > div:nth-child(2) {
        order: 2;
    }

    /* Text alignment center */
    .hero-section-h2,
    .hero-section-p {
        text-align: center;
    }

    /* Images centered with max width and margin */
    .opportunity-section img,
    .maximo-partido-section img,
    .como-ayudar-section img {
        display: block;
        margin: 20px auto;
        max-width: 90%;
        height: auto;
        border-radius: 8%;
    }

    /* Buttons spacing */
    .opportunity-section div,
    .maximo-partido-section div,
    .como-ayudar-section div {
        padding: 0;
        margin-bottom: 20px;
    }

    /* Smaller font sizes for headings */
    .hero-section-h1 {
        font-size: 1.5em;
    }

    .hero-section-h2 {
        font-size: 1.2em;
    }

    /* Popup styling remains as is */
    .popup-image-text {
        flex-direction: column;
        align-items: center;
    }

    .popup-image {
        max-width: 80%;
        margin-bottom: 20px;
    }

    .popup-text {
        margin-left: 0;
        text-align: center;
    }
    .client-image {
        max-width: 50% !important;  /* Make image bigger on mobile */
        margin: 0 auto;             /* Center horizontally */
        display: block;             /* Ensure block-level for margin auto */
        height: auto;
    }
}
