/* =========================
   VARIABLES Y BASE
========================= */
:root {
    --primary: #e60000;
    --primary-hover: #ff2b2b;
    --dark-bg: #0d0d0d;
    --card-bg: #161616;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --glow-shadow: 0 0 20px rgba(230, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    /* Mejora el renderizado de toques en pantallas táctiles */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    /* Evita rebotes incómodos de scroll en iOS Safari */
    overscroll-behavior-y: none;
}

/* =========================
   TITULOS Y EFECTOS
========================= */
.title-glow {
    text-align: center;
    font-size: clamp(28px, 5vw, 40px); /* Adaptable según pantalla */
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 40px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.title-glow::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
    box-shadow: var(--glow-shadow);
}

.subtitle {
    text-align: center;
    font-size: clamp(22px, 4vw, 28px);
    margin: 60px 0 30px;
    color: var(--primary-hover);
}

.section-desc {
    text-align: center;
    color: var(--text-gray);
    margin-top: -25px;
    margin-bottom: 35px;
}

.bg-darker {
    background-color: transparent;
}

/* =========================
   NAVEGACIÓN
========================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(13, 13, 13, 0.8);
    /* Prefijo -webkit- obligatorio para Safari iOS */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 60px;
    /* Soporte para notch de iPhone */
    padding-top: max(15px, env(safe-area-inset-top));
    z-index: 1000;
    box-shadow: transparent;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    border-radius: 50%;
}

.logo h2 {
    font-size: 20px;
    font-weight: 700;
}

.logo h2 span {
    color: var(--primary);
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    margin-left: 25px;
}

.menu a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: .3s;
}

.menu a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 10px rgba(255, 43, 43, 0.6);
}

.menu-btn {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--primary);
}

/* =========================
   HERO / PORTADA
========================= */
header {
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url("fondo.jpeg");
    background-size: cover;
    background-position: center;
    /* Usar min-height y dvh evita saltos de pantalla cuando aparece la barra del navegador */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 20px 40px;
}

.hero-content {
    max-width: 850px;
    /* Se elimina margin-top: 350px que rompía el diseño en móviles */
    margin-top: 0;
}

.badge {
    background: rgba(230, 0, 0, 0.2);
    color: var(--primary-hover);
    border: 1px solid var(--primary);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero h1 {
    font-size: clamp(32px, 6vw, 65px);
    font-weight: 800;
    margin: 20px 0 10px;
    line-height: 1.1;
}

.hero h1 span {
    color: var(--primary);
    text-shadow: var(--glow-shadow);
}

.hero p {
    font-size: clamp(16px, 3vw, 22px);
    color: var(--text-gray);
    margin-bottom: 35px;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: .4s;
}

.btn-primary {
    background: linear-gradient(45deg, #c00000, #ff2b2b);
    color: white;
    box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 0 30px rgba(255, 43, 43, 0.8);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
}

/* =========================
   BARRA DE ESTADÍSTICAS
========================= */
.stats-bar {
    background: #111;
    border-top: 1px solid #222;
    border-bottom: 2px solid var(--primary);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 30px 10%;
    gap: 20px;
    text-align: center;
}

.cert img {
    max-width: 100%;
    width: 200px;
    height: auto; /* Mantiene la proporción de aspecto sin deformarse */
}

.stat-item i {
    font-size: 35px;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-item h3 {
    font-size: 32px;
    font-weight: 800;
}

.stat-item p {
    color: var(--text-gray);
    font-size: 14px;
}

/* =========================
   SECCIONES Y MARCOS
========================= */
section {
    padding: 90px 10%;
}

.quienes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.quienes-texto p {
    font-size: 17px;
    color: #ccc;
    margin-bottom: 20px;
}

.puntos-clave {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    font-weight: 600;
}

.puntos-clave i {
    color: var(--primary);
    margin-right: 8px;
}

.img-frame {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: var(--glow-shadow);
}

.img-frame img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s;
}

.img-frame:hover img {
    transform: scale(1.04);
}

/* =========================
   TARJETAS
========================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.cards-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card, .servicio, .cert, .valor {
    background: var(--card-bg);
    border: 1px solid #282828;
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    transition: all .4s ease;
    position: relative;
}

.card:hover, .servicio:hover, .cert:hover, .valor:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: var(--glow-shadow);
    background: #1c1c1c;
}

.card i, .servicio i, .cert i, .valor i {
    font-size: 42px;
    color: var(--primary);
    margin-bottom: 20px;
}

.card h3, .servicio h3, .cert h3, .valor h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.servicio p, .card p {
    color: var(--text-gray);
    font-size: 14px;
}

/* =========================
   ESTADOS DE COBERTURA
========================= */
.estados {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.estados span {
    background: #1f1f1f;
    border: 1px solid var(--primary);
    color: white;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    transition: .3s;
}

.estados span:hover {
    background: var(--primary);
    box-shadow: 0 0 15px rgba(230, 0, 0, 0.6);
    transform: scale(1.05);
}

.mapa-container {
    max-width: 850px;
    margin: 0 auto;
}

/* =========================
   CONTACTO
========================= */
.contacto-box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: var(--glow-shadow);
}

.contacto-info h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary-hover);
}

.contacto-info p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    word-break: break-word; /* Previene desbordamiento de correos largos */
}

.contacto-item i {
    font-size: 26px;
    color: var(--primary);
    background: rgba(230, 0, 0, 0.1);
    padding: 15px;
    border-radius: 50%;
    flex-shrink: 0;
}

.contacto-item a {
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: bold;
}

/* =========================
   BOTONES FLOTANTES Y FOOTER
========================= */
footer {
    background: #000;
    text-align: center;
    padding: 25px 20px;
    padding-bottom: max(25px, env(safe-area-inset-bottom));
    border-top: 1px solid #222;
    color: var(--text-gray);
    font-size: 14px;
}

.whatsapp-float {
    position: fixed;
    bottom: max(25px, env(safe-area-inset-bottom));
    left: 25px;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: transform .3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.top {
    position: fixed;
    bottom: max(25px, env(safe-area-inset-bottom));
    right: 25px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    text-decoration: none;
    box-shadow: var(--glow-shadow);
    z-index: 1000;
}

/* =========================
   RESPONSIVE EN MÓVIL
========================= */
@media (max-width: 900px) {

    nav { padding: 15px 20px; }

    .menu-btn { display: block; }

    .menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Adapta el menú full-screen en Safari */
        background: #0d0d0d;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left .4s ease;
        z-index: -1;
    }

    .menu.active { left: 0; }

    .menu li { margin: 18px 0; }

    .menu a { font-size: 22px; }

    .hero-btns { flex-direction: column; gap: 12px; }

    .quienes-grid { grid-template-columns: 1fr; }

    section { padding: 60px 20px; }
}
