/**
 * Main stylesheet for the Zebra products landing page.
 *
 * @project     Landing Page Zebra Products
 * @author      Armando Pérez / More Pepper Agency
 * @copyright   Copyright (c) 2025, More Pepper Agency
 * @version     1.5.0
 * @since       2024-05-28
 */

:root {
    --green: #71a850;
    --dark-blue: #00567d;
    --bright-blue: #0073e6;
    --white: #ffffff;
    --light-gray: #f4f4f4;
    --text-dark: #333333;
    --text-light: #fdfdfd;
    --font-family: 'Montserrat', sans-serif;

    /* Font Sizes */
    --font-size-lg: 2.8rem; /* Titles */
    --font-size-md: 1.8rem; /* Subtitles & key paragraphs */
    --font-size-sm: 1.4rem; /* Body text & inputs */
}

/* Local Font Definitions */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Utility Classes for Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* This padding is the height of the scrolled header, ensuring anchor links land correctly. */
    scroll-padding-top: 90px; 
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden; /* Prevents scrollbar from hero banner overflow */
}

main {
    /* The hero image will now appear under the transparent header */
    padding-top: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: var(--font-size-lg);
    font-weight: 700; /* Made titles thinner */
    text-align: center;
    color: var(--dark-blue);
}

h3 {
    font-size: var(--font-size-md);
}

p {
    font-size: var(--font-size-sm);
}

a {
    color: var(--bright-blue);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    box-shadow: none;
    padding: 40px 0;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.main-header.scrolled {
    background-color: rgba(0, 86, 125, 0.9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 15px 0;
}

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.main-header .logo {
    height: 140px; /* Reduced logo size */
    width: auto;
    transition: height 0.3s ease-in-out;
}

.main-header.scrolled .logo {
    height: 70px; /* Reduced logo size on scroll */
}

/* Shared CTA Button Styles */
.cta-button-img {
    height: 64px; /* Reduced by 20% */
    width: auto;
    transition: transform 0.3s ease, height 0.3s ease-in-out;
    animation: pulse 2.5s infinite;
}

.main-header.scrolled .cta-button-img {
    height: 42px; /* Increased by 30% */
}

a:hover .cta-button-img {
    transform: scale(1.05);
}


/* Hero Section */
.hero {
    /* The background is now an img element for better responsive scaling without cropping. */
    background-color: var(--white); /* Fallback color */
    line-height: 0; /* Prevents extra space below the image */
}

.hero img {
    width: 100%;
    height: auto;
    display: block; /* Removes bottom margin/space */
}

@media (max-width: 768px) {
    /* No specific mobile styles needed for the hero section itself, the image will scale naturally. */
}

/* Equipment Section */
.equipment {
    padding: 60px 0;
    background-color: var(--white);
}

.equipment-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.equipment-item {
    text-align: center;
    flex: 1 1 320px;
    max-width: 400px;
    /* Initial state for scroll animation */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.equipment-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px; /* Reduced space between image and title */
    cursor: pointer;
    /* The image will have its own transition for the scroll and hover effects */
    transform: scale(1.1); /* Start image slightly zoomed in */
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.equipment-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.equipment-item.is-visible img {
    transform: scale(1); /* Animate to normal size when visible */
}

.equipment-item:hover img {
    transform: scale(1.05); /* On hover, zoom in a little bit more */
}

.equipment-item h3 {
    color: var(--dark-blue);
    margin-bottom: 10px;
    min-height: 4.4rem; /* Ensures two lines of space for consistent alignment */
    display: flex;
    align-items: flex-start; /* Aligns the title at the top of the container */
    justify-content: center;
}
.equipment-item p {
    color: var(--dark-blue);
}

/* Video Section */
.video-section {
    padding: 80px 0;
    background: url('../images/MC-Landing-Zebra_Fondo2.png') no-repeat center center/cover;
    text-align: center;
}

.video-section h2 {
    color: var(--white);
    margin-bottom: 40px;
}

.video-container {
    position: relative;
    max-width: 1200px; /* Increased size */
    margin: 0 auto 40px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.video-container video {
    width: 100%;
    height: 100%;
    display: block;
}

/* Forcefully hide video player options menu (three dots) in WebKit browsers */
.video-container video::-webkit-media-controls-overflow-button {
    display: none;
}

/* Also hide the fullscreen button for good measure in WebKit browsers */
.video-container video::-webkit-media-controls-fullscreen-button {
    display: none;
}

#play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: rgba(0,0,0,0.4);
    border: 3px solid var(--white);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
#play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid var(--white);
}

#play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(0,0,0,0.6);
}

.video-section .cta-button {
    display: inline-block;
    margin-top: 40px; /* Vertically centers the button in the available space */
}


/* Advantages Section */
.advantages {
    padding: 80px 0;
    background-color: var(--white);
}

.advantages .container {
    /* Increase the max-width for this specific section,
       reducing side margins and making content wider. */
    max-width: 1000px;
}

.advantages-list {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.advantage-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.advantage-item img {
    max-width: 150px;
    width: 100%;
    height: auto;
    flex-shrink: 0;
}

.advantage-item p {
    color: var(--dark-blue);
    font-size: var(--font-size-md); /* Increased size */
}

.advantage-item p strong {
    color: var(--dark-blue);
}

/* Experience Section */
.experience-section {
    padding: 80px 0;
    background: url('../images/MC-Landing-Zebra_Fondo3.png') no-repeat center center/cover;
    text-align: center;
}

.experience-section h2 {
    color: var(--white);
    font-weight: 700;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.experience-section p {
    color: var(--white);
    font-size: var(--font-size-md);
    margin: 20px auto 0;
    max-width: 850px;
}


/* Form Section */
.form-section {
    padding: 80px 0 0; /* Removed bottom padding to join with the footer */
    background-color: var(--white);
}

.form-section .container > h2 {
    margin-bottom: 30px;
}

.form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark-blue);
    font-size: 1.4rem;
}

.form-group input, .form-group select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.4rem;
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
}

.form-group select:invalid {
    /* Makes the placeholder option appear gray */
    color: #666;
}

.form-group select option {
    /* Ensures that the actual options in the dropdown are not gray */
    color: var(--text-dark);
}

.form-group input::placeholder {
    color: transparent;
}

form.submitted .form-group input:invalid,
form.submitted .form-group select:invalid {
    border-color: #e74c3c;
}

.form-footer-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start; /* Aligns content (checkbox and Turnstile) to the end of the container */
    justify-content: flex-end; 
}

.privacy-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}
.privacy-check label {
    font-weight: normal;
}
.cf-turnstile {
    min-height: 65px;
}

.form-submit-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end; /* Aligns the button to the right */
}

.submit-button {
    padding: 12px 30px;
    background-color: var(--green);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-sm); /* Standardized size */
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    font-family: var(--font-family);
}

.submit-button:hover:not(:disabled) {
    background-color: #5a8a40;
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Footer */
.main-footer {
    position: relative; /* Context for positioning content over the image */
    color: var(--white);
    line-height: 0; /* Prevents extra space below the background image */
}

.footer-background-image {
    width: 100%;
    height: auto;
    display: block; /* Similar behavior to the hero image */
}

.footer-container {
    /* Positions the content over the background image */
    position: absolute;
    bottom: 40px; /* Vertical adjustment: distance from the bottom */
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 40px; /* Side padding */
}

.main-footer .logo {
    height: 120px;
    width: auto;
}

.main-footer .footer-link {
    color: var(--white);
    font-weight: bold;
    font-size: var(--font-size-sm);
}
.main-footer .footer-link:hover {
    text-decoration: underline;
}

.copyright-container {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: right;
    padding: 0 40px;
}
.copyright-container p {
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.6;
}
/* Consent Banner */
.consent-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: auto;
    max-width: 420px;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(5px);
    color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    z-index: 2000;
}

.consent-banner p {
    margin: 0;
    font-size: 1.2rem; /* Standardized secondary text size */
    line-height: 1.5;
    color: var(--white);
}

.consent-banner p a {
    color: var(--white);
    text-decoration: underline;
    font-weight: normal;
}

.consent-buttons {
    display: flex;
    gap: 10px;
    align-self: flex-end;
}

.consent-button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-family);
    transition: background-color 0.2s, color 0.2s;
}

.consent-button.primary {
    background-color: var(--green);
    color: var(--white);
    border: 1px solid var(--green);
}

.consent-button.primary:hover {
    background-color: #5a8a40;
    border-color: #5a8a40;
}

.consent-button.secondary {
    background-color: transparent;
    color: var(--white);
    border: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast.error {
    background-color: #e74c3c;
}
.toast.success {
    background-color: var(--green);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* On top of everything */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay p {
    color: var(--white);
    font-size: var(--font-size-md);
    margin-top: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Keyframe Animations for "living" page */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Styles */
@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-footer-left {
        align-items: center;
    }
    .form-submit-group {
        justify-content: center; /* Maintains vertical alignment */
        align-items: center; /* Centers the button horizontally */
    }
    .submit-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    html {
        /* Mobile header height is 90px */
        scroll-padding-top: 90px;
    }

    :root {
        --font-size-lg: 1.9rem; /* Reducido aún más para móvil */
        --font-size-md: 1.3rem; /* Reducido aún más para móvil */
        --font-size-sm: 1.1rem; /* Reducido aún más para móvil */
    }

    main {
        padding-top: 0; /* Allows the hero to be seen behind the transparent header */
    }

    .main-header {
        padding: 20px 0;
        /* On mobile, the header now starts transparent and becomes solid on scroll, like on desktop */
    }
    .main-header.scrolled {
        /* The padding change from the desktop version is overridden to prevent vertical jump
           of header elements on mobile view. */
        padding: 20px 0;
    }
    .header-container {
        padding: 0 15px;
    }
    .footer-container {
        padding: 0 20px;
    }

    /* Logo and button sizes for mobile (constant, no shrinking on scroll) */
    .main-header .logo,
    .main-header.scrolled .logo {
        height: 50px;
    }
    .cta-button-img,
    .main-header.scrolled .cta-button-img {
        height: 31px; /* Increased by 30% */
    }
    
    .equipment {
        padding: 60px 0;
    }

    .equipment-item {
        flex-basis: 100%;
        max-width: 300px; /* Slightly smaller for mobile */
    }

    .equipment-item h3 {
        /* Reset min-height on mobile so the space between title and paragraph
           is consistent, regardless of title lines. */
        min-height: unset;
    }

    .video-section {
        padding: 50px 0;
    }

    .advantages {
        /* Adjust padding to be symmetrical with other sections on mobile */
        padding: 50px 0;
    }

    .experience-section {
        padding: 50px 20px;
    }

    .experience-section p {
        font-size: var(--font-size-md);
    }

    .advantage-item img {
        max-width: 80px;
    }
    .advantage-item p {
        font-size: var(--font-size-sm);
    }

    .form-section {
        /* Adjust top padding to be symmetrical with other sections on mobile */
        padding: 50px 0 0;
    }

    .form-container {
        padding: 20px;
    }
    .form-group input, .form-group select {
        width: 100%;
    }

    /* Use labels as placeholders on mobile */
    .form-group label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border-width: 0;
    }
    .form-group input::placeholder {
        color: #666;
    }

    .privacy-check {
        font-size: 1.0rem; /* Made text smaller */
    }
    
    .footer-container {
        flex-direction: column;
        gap: 25px;
        justify-content: center;
    }
    
    .main-footer .footer-link {
        font-size: var(--font-size-sm); /* Reduced and standardized */
    }

    /* Hide footer logo and website link on responsive */
    .footer-container a:first-child,
    .footer-container a[href="https://www.microcomp.com.mx"] {
        display: none;
    }

    .copyright-container {
        bottom: 8px;
        padding: 0 20px;
        text-align: center;
    }
    .copyright-container p {
        font-size: 0.7rem;
    }

    .consent-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
        width: auto;
    }
    .consent-banner p {
        font-size: var(--font-size-sm); /* Standardized */
    }

    .consent-buttons {
        /* Moves buttons to the left on mobile */
        align-self: flex-start;
    }

    /* Adjustments for Toast on mobile */
    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
    }

    .toast {
        padding: 10px 12px; /* Even more compact for mobile */
        font-size: var(--font-size-sm); /* Standardized */
    }

}

/* --- Thank You Page Styles --- */

.thank-you-legal {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.thank-you-legal p,
.thank-you-legal a {
    color: #aaa;
    font-size: 1.0rem;
    margin: 0 5px;
    display: inline;
    text-decoration: none;
}

.thank-you-legal a:hover {
    color: var(--bright-blue);
    text-decoration: underline;
}

.thank-you-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* This ensures it takes the full viewport height */
    text-align: center;
    padding: 20px;
    background: url('../images/MC-Landing-Zebra_Fondo2.png') no-repeat center center;
    background-size: cover;
}

.thank-you-box {
    background-color: var(--white);
    padding: 40px;
    border-radius: 0; /* Changed to be a square box */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 800px; /* Increased to make the box wider */
    width: 100%;
}

.thank-you-header {
    display: flex; /* Aligns logos to the sides */
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
}

.logo-mc {
    height: 80px; /* Matched logo heights */
}

.logo-zebra {
    height: 80px; /* Matched logo heights */
}

.thank-you-content h1 {
    color: var(--dark-blue);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 30px; /* Increased to create a separation line */
}

.thank-you-content p {
    color: var(--text-dark);
    font-size: var(--font-size-sm);
    margin-bottom: 1.5em; /* Adds space between paragraphs */
    /* The width of the text block is reduced to improve readability */
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.thank-you-content p:last-child {
    margin-bottom: 0; /* The footer will provide the bottom spacing */
}

.thank-you-footer {
    display: flex;
    justify-content: center; /* Centra el contenedor de los botones */
    align-items: center;
    width: 100%;
    margin-top: 25px; /* Aún más cerca del texto superior */
}

.social-icons-and-button {
    display: flex;
    justify-content: center; /* Centra los botones dentro del contenedor */
    align-items: center; /* Vertically aligns all icons */
    gap: 20px; /* Espacio entre cada botón */
    flex-wrap: wrap; /* Allows icons to wrap on smaller screens */
}

.social-icons-and-button a img {
    height: 50px;
    transition: transform 0.3s ease;
}

.social-icons-and-button a:hover img {
    transform: scale(1.1);
}

.website-link {
    /* Ensures the button inside is centered, fixing the alignment issue */
    display: flex;
    align-items: center;
}

.website-button:hover {
    transform: scale(1.05);
}

/* Responsive adjustments for thank you page */
@media (max-width: 768px) {
    .thank-you-header { flex-direction: column; gap: 20px; margin-bottom: 30px; }
    .thank-you-box { padding: 30px 20px; }
    .logo-mc { height: 60px; }
    .logo-zebra { height: 60px; }
    .thank-you-content h1 {
        font-size: 2.0rem; /* Further reduced */
        margin-bottom: 20px;
    }
    .thank-you-footer {
        flex-direction: column;
        align-items: center; /* Centra todos los elementos verticalmente */
        gap: 30px;
        margin-top: 50px;
    }
    .social-icons-and-button { justify-content: center; }
    .social-icons-and-button a img {
        height: 40px;
    }
    .thank-you-legal { margin-top: 40px; }
    .thank-you-legal p,
    .thank-you-legal a {
        font-size: 0.8rem;
        display: block;
        margin: 4px 0;
    }
}

.whatsapp-icon-plain {
    /* Ensures the plain SVG icon has the same dimensions as the others */
    height: 50px;
    width: 50px;
}

@media (max-width: 768px) {
    .whatsapp-icon-plain {
        height: 40px;
        width: 40px;
    }
}

/* --- WhatsApp Floating Action Button (FAB) --- */
.whatsapp-fab {
    position: fixed;
    right: 20px; /* Posición a la derecha */
    bottom: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background-color: transparent; /* Sin fondo */
    box-shadow: none; /* Sin sombra */
    transition: transform 0.3s ease;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
}
.whatsapp-fab img {
    width: 100%; /* La imagen ocupa todo el espacio del contenedor */
    height: 100%;
}