/* =========================================
   VARIABLES Y TOKENS DE DISEÑO
   ========================================= */
:root {
    color-scheme: light only;
    /* Paleta de Colores (Inspirada en Lovable/Modern Design) */
    --color-primary: #02500f;
    --color-primary-hover: #037015;
    --color-secondary: #0B213F;
    --color-secondary-hover: #16365C;
    --color-accent: #00A3C4;

    --color-bg-light: #F8FAFC;
    --color-bg-white: #FFFFFF;
    --color-bg-dark: #0F172A;

    --color-text-main: #1E293B;
    --color-text-muted: #64748B;
    --color-text-light: #F1F5F9;

    /* Card Specific Colors */
    --color-plagas: #155F39;
    --color-extintores: #C42617;
    --color-tanques: #16579D;
    --color-camaras: #C27803;

    /* Tipografía */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Sombras y Bordes */
    --shadow-sm: 0 2px 4px 0 rgb(0 0 0 / 0.15);
    --shadow-md: 0 6px 10px -1px rgb(0 0 0 / 0.2), 0 4px 6px -2px rgb(0 0 0 / 0.15);
    --shadow-lg: 0 12px 20px -3px rgb(0 0 0 / 0.25), 0 6px 10px -4px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 25px 35px -5px rgb(0 0 0 / 0.35), 0 15px 15px -5px rgb(0 0 0 / 0.25);
    --shadow-glow: 0 0 25px rgba(2, 80, 15, 0.4);

    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Transiciones */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   RESETEO BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    /* Compensa la altura del header fijo */
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1400px; /* Agrandado de 1200px a 1400px para tener más espacio horizontal */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   UTILIDADES
   ========================================= */
.text-primary {
    color: var(--color-primary);
}

.text-white {
    color: var(--color-text-light) !important;
}

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

.bg-light {
    background-color: var(--color-bg-light);
}

.bg-dark {
    background-color: var(--color-bg-dark);
}

.w-full {
    width: 100%;
}

.icon-xs {
    width: 16px;
    height: 16px;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

.section {
    padding: 2.5rem 0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   BOTONES
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
    background-color: var(--color-secondary);
    color: white;
}

.btn-whatsapp {
    background-color: #02500f;
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-whatsapp:hover {
    background-color: #037015;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* =========================================
   TOP BAR
   ========================================= */
.top-bar {
    background-color: #02500f;
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.top-bar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
}

.top-bar-link:hover {
    opacity: 1;
    color: var(--color-primary);
}

/* =========================================
   HEADER & NAVEGACIÓN
   ========================================= */
/* Parche para Modo Oscuro Forzado en móviles */
.logo img, .footer-logo img {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 84px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 1rem;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: #02500f;
    background-color: rgba(2, 80, 15, 0.08);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-secondary);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    padding: 1.5rem 0 1.5rem;
    overflow: hidden;
    background-color: var(--color-bg-light);
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-highlight {
    color: var(--color-secondary);
    font-weight: 800;
}

.hero-light {
    color: var(--color-text-muted);
    font-weight: 400;
}

.text-gradient {
    background: linear-gradient(135deg, #02500f, #208f43);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.6));
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Formas decorativas animadas en el fondo */
.hero-shape {
    position: absolute;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.15;
}

.hero-shape-1 {
    width: 450px;
    height: 450px;
    background-color: var(--color-primary);
    top: -100px;
    left: -100px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: blob-float 12s ease-in-out infinite;
}

.hero-shape-2 {
    width: 350px;
    height: 350px;
    background-color: var(--color-accent);
    bottom: -50px;
    right: -50px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blob-float 15s ease-in-out infinite reverse;
}

@keyframes blob-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    33% {
        transform: translateY(-30px) scale(1.05);
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }
    66% {
        transform: translateY(20px) scale(0.95);
        border-radius: 30% 70% 40% 60% / 60% 70% 30% 40%;
    }
}

/* =========================================
   SERVICIOS
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Sombra paralela más oscura para despegar del fondo */
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.8);
}

.service-image-container {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3; /* Proporción estándar de fotografía para que no se corte */
    background-color: #ffffff; /* Fondo blanco por si la foto no llena todo */
    /* Fondo suave por si sobra espacio */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantiene la foto llenando la caja, pero ahora la caja tiene mejor proporción */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.service-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.service-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.service-list li {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-main); /* Negro / Gris muy oscuro */
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--card-color, var(--color-primary));
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--card-color);
    margin-top: auto;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.service-link:hover {
    opacity: 0.7;
    transform: translateX(4px);
}

/* Colores específicos de cada tarjeta */
.card-plagas {
    --card-color: var(--color-plagas);
}
.service-card.card-plagas {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(21, 95, 57, 0.08) 100%);
}
.card-plagas .service-badge {
    background: linear-gradient(135deg, var(--color-plagas), #104a2c);
}

.card-extintores {
    --card-color: var(--color-extintores);
}
.service-card.card-extintores {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(196, 38, 23, 0.08) 100%);
}
.card-extintores .service-badge {
    background: linear-gradient(135deg, var(--color-extintores), #a01d11);
}

.card-tanques {
    --card-color: var(--color-tanques);
}
.service-card.card-tanques {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(22, 87, 157, 0.08) 100%);
}
.card-tanques .service-badge {
    background: linear-gradient(135deg, var(--color-tanques), #10427a);
}

.card-camaras {
    --card-color: var(--color-camaras);
}
.service-card.card-camaras {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(194, 120, 3, 0.08) 100%);
}
.card-camaras .service-badge {
    background: linear-gradient(135deg, var(--color-camaras), #995d02);
}

/* =========================================
   MODALES (MÁS INFORMACIÓN)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 33, 63, 0.8);
    /* Azul oscuro semitransparente */
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--color-bg-white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
}

.close-modal:hover {
    color: var(--card-color, var(--color-primary));
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-icon {
    width: 48px;
    height: 48px;
    background-color: var(--card-color, var(--color-primary));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.75rem;
    color: var(--card-color, var(--color-primary));
}

.modal-body h4 {
    color: var(--color-secondary);
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.modal-quote {
    background-color: var(--color-bg-light);
    border-left: 4px solid var(--card-color, var(--color-primary));
    padding: 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: 2rem;
    font-style: italic;
    color: var(--color-secondary);
    font-weight: 500;
}

/* =========================================
   QUIÉNES SOMOS (ABOUT)
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.title-underline {
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

.about-text {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-quote {
    background-color: var(--color-bg-white);
    padding: 1.5rem;
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: var(--shadow-sm);
    color: var(--color-secondary);
    font-style: italic;
    margin-top: 2rem;
}

.about-services {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-service-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--color-bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.about-service-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.about-icon {
    width: 56px;
    height: 56px;
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-icon.card-plagas {
    color: #155F39;
    background-color: rgba(21, 95, 57, 0.1);
}

.about-icon.card-extintores {
    color: #C42617;
    background-color: rgba(196, 38, 23, 0.1);
}

.about-icon.card-tanques {
    color: #16579D;
    background-color: rgba(22, 87, 157, 0.1);
}

.about-icon.card-camaras {
    color: #C27803;
    background-color: rgba(194, 120, 3, 0.1);
}

.about-service-item h4 {
    color: var(--color-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.about-service-item span {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* =========================================
   CONTACTO
   ========================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info {
    padding-right: 2rem;
}

.contact-desc {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    font-size: 1.125rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-method-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.contact-method h5 {
    color: white;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.contact-method p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.contact-form-wrapper {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: var(--color-bg-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background-color: var(--color-bg-dark);
    color: white;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    margin-bottom: 0;
    text-align: left;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.footer-links p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
}

/* =========================================
   RESPONSIVE DESIGN (MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: white;
        padding: 2rem;
        box-shadow: var(--shadow-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: all 0.3s ease-in-out;
    }

    .nav.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

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

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem 1rem !important;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-info {
        padding-right: 0;
        text-align: center;
    }

    .contact-methods {
        align-items: center;
    }

    .contact-method {
        text-align: left;
    }

    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

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

    .footer-links {
        text-align: center !important;
        justify-content: center;
    }
}