/* Variables globales */
:root {
    --primary-color: #0056b3;
    --secondary-color: #07770d;
    --accent-color: #ffd700;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --white: #ffffff;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    padding-top: 80px; 
}

/* Estilos de la barra de navegación */
.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background-color: var(--white);
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    max-width: 1200px;
    margin: 0 auto;
    left: 0;
    right: 0;
}

.nav-brand {
    justify-self: start;
}

.nav-brand a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 5rem;
    width: auto;
    display: block;
}

.nav-toggle {
    justify-self: center;
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-icon {
    width: 30px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.nav-menu {
    justify-self: end;
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.nav-menu a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 0;
    font-size: 1.1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7));
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
    padding: 8rem 2rem 4rem;
}

.hero-content h1 {
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1rem;
}

/* Services Section */
.services {
    padding: 4rem 2rem;
    background-color: var(--light-color);
}

.services h2 {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card h3 {
    padding: 1rem;
    color: var(--primary-color);
}

.service-card p {
    padding: 0 1rem 1rem;
    line-height: 1.8;
}

.service-link {
    display: block;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease;
}

.service-link:hover {
    background: var(--secondary-color);
}

/* Why Us Section */
.why-us {
    padding: 2rem 2rem;
}

.why-us h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: var(--light-color);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-3px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Sección de Contacto Rápido */
.quick-contact {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
}

.quick-contact h2 {
    margin-bottom: 1rem;
}

.quick-contact p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.emergency-button {
    background-color: #dc3545;
    margin-right: 1rem;
    transition: background-color 0.3s ease;
}

.emergency-button:hover {
    background-color: #c82333;
}

.contact-button {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    color: var(--white);
    font-weight: bold;
    margin: 1rem 0.5rem;
    transition: background-color 0.3s ease;
}

.contact-button:not(.emergency-button) {
    background-color: var(--secondary-color);
}

.contact-button:not(.emergency-button):hover {
    background-color: #ec0f34;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.25rem 0;
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logo{
    width: 10rem;
    display: flex;
    margin: 0 auto 1.5rem auto;
}

.whatsapp-float {
    position: fixed; 
    bottom: 25px;
    right: 25px;
    z-index: 10000;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);

    padding: 0; 
    
    display: block; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-radius: 50%;
    
    width: 60px; 
    height: 60px;
    
    transition: box-shadow 0.2s;
}

.whatsapp-float:hover {
    box-shadow: 0 5px 16px rgba(0,0,0,0.3);
}

.whatsapp-float img {
    display: block;
    width: 100%; 
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        text-align: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .contact-button {
        display: block;
        margin: 1rem auto;
        max-width: 250px;
    }

    .emergency-button {
        margin-right: 0;
    }

    .navbar {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .nav-toggle {
        justify-self: end;
    }

    .whatsapp-float {
        width: 50px; 
        height: 50px;
        bottom: 15px; 
        right: 15px;
        /* Re-aplicar el z-index para evitar cualquier anulación local */
        z-index: 10000; 
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 70px;
    }

    .navbar {
        padding: 0.5rem;
    }

    .logo-img {
        height: 4rem;
    }

    .hero {
        padding: 5rem 1rem 2rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .services,
    .why-us,
    .quick-contact {
        padding: 2rem 1rem;
    }

    .service-card img {
        height: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .contact-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .features-grid,
    .services-grid {
        gap: 1.5rem;
    }

   .whatsapp-float {
        width: 50px; 
        height: 50px;
        bottom: 15px; 
        right: 15px;
        /* Re-aplicar el z-index para evitar cualquier anulación local */
        z-index: 10000; 
    }
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.feature {
    animation: fadeIn 0.6s ease-out;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles para mejor accesibilidad */
a:focus,
button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Mejora el contraste para mejor legibilidad */
.service-card h3,
.feature h3 {
    color: var(--secondary-color);
}

.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}