/* Variables CSS para colores corporativos */
:root {
    --primary-red: #c41e3a;
    --dark-red: #a01729;
    --light-red: #e53e5a;
    --white: #ffffff;
    --black: #1a1a1a;
    --gray-light: #f8f9fa;
    --gray-medium: #6c757d;
    --gray-dark: #343a40;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-strong: rgba(0, 0, 0, 0.25);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Prevenir solapamiento con anclas */
html {
    scroll-padding-top: 100px; /* Altura de la cabecera + margen */
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--black);
    background-color: var(--white);
    font-size: 16px;
}

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

/* Navegación */
.main-nav {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow-light);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.logo strong {
    color: var(--primary-red);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--black);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-red);
}

.contact-buttons {
    display: flex;
    gap: 1rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.btn-primary:hover {
    background-color: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

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

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

.btn-emergency {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    animation: pulse 2s infinite;
}

.btn-emergency-light {
    background: var(--white);
    color: var(--primary-red);
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Contenido principal */
main {
    margin-top: 80px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-pattern.svg') repeat;
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

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

/* Secciones */
.section {
    padding: 4rem 0;
}

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

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--black);
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-title p {
    font-size: 1.1rem;
    color: var(--gray-medium);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid de servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-medium);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.service-card h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.service-card p {
    color: var(--gray-medium);
    margin-bottom: 1.5rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: var(--white);
}

.feature h3 {
    color: var(--black);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature p {
    color: var(--gray-medium);
    font-size: 0.95rem;
}

/* Testimonios */
.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px var(--shadow-light);
    position: relative;
}

.testimonial::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-red);
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    line-height: 1;
}

.testimonial-content {
    margin-top: 2rem;
}

.testimonial p {
    color: var(--gray-dark);
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-red);
}

/* Formulario de contacto */
.contact-form {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-light);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--black);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.main-footer {
    background: var(--black);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section li {
    color: #cccccc;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li::before {
    content: '✓ ';
    color: var(--primary-red);
    font-weight: bold;
}

.contact-info p {
    margin-bottom: 0.75rem;
}

.emergency-contact {
    margin-top: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid var(--gray-dark);
    padding-top: 1rem;
    text-align: center;
    color: #999999;
}

/* Responsive Design */

@media (max-width: 992px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Optimizar cabecera para móviles */
    .main-nav {
        padding: 0rem 0;
    }

    /*
        .nav-content {
        padding: 0.5rem 0;
        gap: 0.5rem;
    }
    */
    
    .nav-content {
        flex-direction: column;
        padding: 0.4rem 0;
        gap: 0.5rem; /* Espacio entre elementos */
    }
    
    .logo strong {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 0.1rem 1.5rem;
        font-size: 0.9rem;
        padding: 0.4rem 0;
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .contact-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Ajustar espacio superior dinámicamente */
    main {
        margin-top: calc(
            2 * var(--logo-height) + 
            2 * var(--nav-links-height) + 
            2 * var(--button-height) + 
            20px
        );
    }
    
    :root {
        --logo-height: 1.5rem;
        --nav-links-height: 1.5rem;
        --button-height: 2rem;
    }

    /*
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    */
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 600px) {
    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .service-card,
    .testimonial {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Utilidades */
.text-center { text-align: center; }
.text-red { color: var(--primary-red); }
.bg-red { background-color: var(--primary-red); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Efectos especiales */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Print styles */
@media print {
    .main-nav,
    .btn,
    .hero-buttons {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero {
        background: none !important;
        color: var(--black) !important;
    }
}