/* --- VARIABLES --- */
:root {
    --primary: #D32F2F;
    /* Rojo Ambulancia */
    --primary-dark: #9A0007;
    /* Rojo Oscuro */
    --secondary: #0a192f;
    /* Azul Marino Oscuro */
    --text-dark: #333;
    --text-light: #555;
    --accent: #f0f4f8;
    /* Gris muy claro fondo */
    --white: #ffffff;
    --whatsapp-green: #25D366;
    /* Verde WhatsApp */
    --blue-link: #1565C0;
    /* Azul Links */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* HEADER & HERO */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.text-highlight {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 600;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* BOTÓN DE HEADER (COTIZA) */
.btn-cta-header {
    background: var(--whatsapp-green);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
}

.btn-cta-header:hover {
    background: #1ebc57;
    transform: translateY(-2px);
}

/* MENÚ MÓVIL */
.hamburger-menu {
    display: none;
    cursor: pointer;
    color: var(--secondary);
    margin-left: auto;
    position: relative; 
    z-index: 3000;
}

.hamburger-menu span {
    font-size: 2rem;
}

.mobile-only {
    display: none;
}

/* BOTÓN WHATSAPP EN EL MENÚ MÓVIL */
.btn-whatsapp-nav {
    background: var(--whatsapp-green);
    color: white !important;
    /* Forzar blanco */
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, var(--secondary) 30%, #1c3a5e 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: relative;
    color: var(--white);
    overflow: hidden;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 80px;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.2rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-3px);
}

.btn-primary:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    border-color: rgba(255, 255, 255, 0.8);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--secondary);
    border-color: var(--white);
}

/* IMAGEN HERO ANIMADA */
.hero-image-container {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.ambulance-reveal {
    max-width: 100%;
    height: auto;
    opacity: 0;
    transform: translateY(80px);
    transition: all 1.2s cubic-bezier(0.2, 1, 0.3, 1);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ambulance-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ESTADÍSTICAS */
.stats-container {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    background: var(--accent);
    padding: 20px;
    border-radius: var(--radius);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

/* SERVICIOS */
.section-padding {
    padding: 80px 0;
}

.bg-light {
    background: var(--accent);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    color: var(--secondary);
    font-size: 2.2rem;
    margin: 10px 0;
}

.badge {
    background: var(--primary);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border-top: 4px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-7px);
    border-top-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card .icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.read-more {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: bold;
}

/* CONTACTO */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-info-box h2 {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.info-items .item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.icon-contact {
    font-size: 2.5rem;
    color: var(--primary);
    background: rgba(211, 47, 47, 0.1);
    padding: 10px;
    border-radius: 50%;
}

.contact-link {
    color: var(--blue-link);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--blue-link-dark);
}

/* FORMULARIO */
.contact-form-box {
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border-top: 5px solid var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
    outline: none;
}

.input-field:focus {
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
    border-color: #ddd;
}

.input-field.is-invalid {
    border-color: #D32F2F;
    background-color: #fff8f8;
}

.input-field.is-valid {
    border-color: #2e7d32;
    background-color: #f9fff9;
}

.error-msg {
    display: none;
    font-size: 0.8rem;
    color: #D32F2F;
    margin-top: 5px;
    font-weight: bold;
}

.input-field.is-invalid+.error-msg {
    display: block;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#extra-fields {
    animation: fadeIn 0.3s ease-in-out;
}

.full-width {
    width: 100%;
    border: none;
    font-size: 1.1rem;
    justify-content: center;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER */
footer {
    background: #111;
    color: #aaa;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 40px;
}

.logo-text-footer {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    display: block;
    margin-bottom: 15px;
}

.footer-contact h3 {
    color: white;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    margin-bottom: 15px;
}

.footer-contact ul {
    list-style: none;
}

.footer-contact li {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    align-items: start;
    font-size: 1rem;
}

.footer-contact li span {
    color: var(--primary);
}

.footer-contact a {
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

.copyright {
    text-align: center;
    padding: 25px 0;
    font-size: 0.9rem;
}

/* WHATSAPP FLOTANTE Y STICKY BAR */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 25px;
    right: 25px;
    background-color: var(--whatsapp-green);
    color: #FFF;
    border-radius: 50px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}

.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.sticky-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    color: var(--white);
    font-weight: 700;
    display: flex;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.sticky-item.call {
    background: var(--primary);
}

.sticky-item.whatsapp {
    background: var(--whatsapp-green);
}

/* MODALES */
.service-modal-overlay,
.lightbox-modal,
.success-modal-overlay {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-modal-overlay.show,
.success-modal-overlay {
    display: flex;
    opacity: 1;
}

.service-modal-box,
.success-modal-box {
    background: var(--white);
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease;
}

.success-modal-box {
    max-width: 400px;
    padding: 30px;
    text-align: center;
    border-top: 5px solid var(--whatsapp-green);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.service-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.service-icon-modal {
    font-size: 2.5rem;
    color: var(--primary);
}

.service-modal-body {
    padding: 30px;
    overflow-y: auto;
    color: var(--text-light);
}

.service-modal-footer {
    padding: 20px 30px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    border-radius: 0 0 15px 15px;
    text-align: center;
}

.modal-cta {
    width: 100%;
    justify-content: center;
    background: var(--whatsapp-green);
    border-color: var(--whatsapp-green);
}

.modal-cta:hover {
    background: #1ebc57;
}

.close-service-modal,
.close-lightbox {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #aaa;
    cursor: pointer;
}

.close-lightbox {
    color: white;
    top: 20px;
    right: 30px;
    font-size: 45px;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 5px;
}

#caption {
    color: #ccc;
    margin-top: 15px;
    text-align: center;
}

/* MODAL ÉXITO */
.success-icon {
    font-size: 4rem;
    color: var(--whatsapp-green);
    margin-bottom: 15px;
}

.success-modal-buttons {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-whatsapp-confirm {
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary-confirm {
    background-color: #f0f0f0;
    color: #555;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* ANIMACIÓN PULSO */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(211, 47, 47, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.pulse-anim {
    animation: pulse 2s infinite;
}

/* ABOUT CAROUSEL */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.check-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.check-list span {
    color: var(--primary);
}

.about-carousel-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #ddd;
}

.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s;
    cursor: zoom-in;
}

.carousel-img.active {
    opacity: 1;
    z-index: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    z-index: 2;
    font-size: 1.5rem;
}

.next-btn {
    right: 0;
}

.prev-btn {
    left: 0;
}

/* RESPONSIVE */
@media (max-width: 960px) {
    body {
        padding-bottom: 60px;
    }

    .btn-cta-header {
        display: none;
    }

    .hamburger-menu {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
        transition: right 0.4s;
        z-index: 2000;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-only {
        display: block;
        margin-top: 20px;
        text-align: center;
    }

    .mobile-sticky-bar {
        display: flex;
    }

    .whatsapp-float {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .whatsapp-float img {
        width: 28px;
        height: 28px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
        padding: 40px 0;
    }

    .hero-text h1 {
        font-size: 32px;
    }

    .hero-actions {
        justify-content: center;
    }

    .about-layout,
    .contact-wrapper,
    .form-row,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .stats-container {
        flex-direction: column;
        gap: 20px;
    }

    .footer-grid {
        text-align: center;
    }

    .footer-contact li {
        justify-content: center;
    }
}