@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

/* --- Scroll suavizado global --- */
html {
    scroll-behavior: smooth;
}

/* --- Reset universal --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Link de nav activo (agregar clase .activa al <a> de la página actual) --- */
nav a.activa {
    color: #ff6600;
    border-bottom: 2px solid #ff6600;
}

/* --- Base del documento ---
   position: relative convierte al body en el bloque contenedor del footer absoluto.
   min-height: 100vh garantiza que el body ocupe toda la pantalla aunque el contenido sea corto.
   padding-bottom: 80px evita que el footer absoluto tape el final del contenido (alto del footer). */
body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: #ffffff;
    color: #1a1a1a;
    position: relative;
    min-height: 100vh;
    padding-bottom: 80px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header: logo a la izquierda, nav a la derecha usando float ---
   position: sticky mantiene el menú visible al hacer scroll (Posicionamiento Avanzado) */
header {
    background-color: #ffffff;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #ff6600;
}

/* Clearfix con pseudo-elemento en lugar de overflow:hidden,
   para que el menú desplegable mobile no quede recortado */
header::after {
    content: '';
    display: table;
    clear: both;
}

/* Imagotipo en header: enlace flotado a la izquierda */
.logo-link {
    float: left;
    line-height: 64px;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
}

/* Isotipo en footer */
.footer-isotipo {
    height: 30px;
    width: auto;
    display: inline-block;
    margin-bottom: 8px;
    opacity: 0.85;
}

/* Hero de inicio: isologo + título alineados horizontalmente con inline-block
   font-size: 0 elimina el espacio en blanco entre los dos inline-blocks */
.hero-intro {
    font-size: 0;
    margin-bottom: 24px;
}

.hero-isologo {
    display: inline-block;
    width: 160px;
    height: auto;
    vertical-align: middle;
    margin-right: 36px;
}

.hero-titulo {
    display: inline-block;
    vertical-align: middle;
    font-size: 36px; /* reset del font-size: 0 del padre */
    margin-bottom: 0;
}

/* --- Navegación --- */
nav {
    float: right;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li {
    display: inline-block;
}

nav a {
    display: inline-block;
    color: #003366;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0 16px;
    line-height: 64px;
    transition: background-color 0.2s, color 0.2s;
}

nav a:hover {
    background-color: rgba(0, 51, 102, 0.07);
    color: #ff6600;
}

/* --- Contenido principal ---
   max-width en el contenedor unifica la columna de texto: títulos, párrafos
   y botones comparten el mismo ancho en vez de cortarse de forma inconsistente. */
main {
    padding: 60px 40px;
    max-width: 1100px;
}

main h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 20px;
}

main h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 16px;
    margin-top: 48px;
}

main h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 10px;
}

main p {
    font-size: 16px;
    line-height: 1.75;
    color: #444444;
    width: 100%;
    margin-bottom: 24px;
}

main ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 24px;
}

main li {
    margin-bottom: 8px;
    color: #444444;
}

main a {
    color: #ff6600;
    text-decoration: none;
}

main a:hover {
    text-decoration: underline;
}

/* --- Footer ---
   position: absolute + bottom: 0 lo ancla al fondo del body (que tiene position: relative).
   width: 100% asegura que ocupe todo el ancho sin importar el contenido. */
footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f8f8f8;
    padding: 28px 40px;
    text-align: center;
    border-top: 3px solid #ff6600;
}

footer p {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: #555555;
    letter-spacing: 0.5px;
}

/* --- Botón CTA reutilizable --- */
.boton-cta {
    display: inline-block;
    background-color: #ff6600;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 30px;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 0.5px;
    margin-top: 4px;
    margin-bottom: 48px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.boton-cta:hover {
    background-color: #cc5200;
    color: #ffffff;
    text-decoration: none;
}

/* --- Cards de portfolio (index.html) ---
   5 cards en fila: 18% ancho + 2% margen-derecho = 20% por card × 5 = 100%
   font-size: 0 en el contenedor elimina el espacio en blanco entre inline-blocks */
.portfolio-section {
    width: 100%;
    max-width: 1100px;
    margin-top: 16px;
    font-size: 0;
}

.card {
    display: inline-block;
    width: 18%;
    margin-right: 2%;
    margin-bottom: 20px;
    background-color: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 24px 14px;
    text-align: center;
    vertical-align: top;
    font-size: 16px; /* reset del font-size: 0 del padre */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
}

.card-foto {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 14px;
}

.card-foto img {
    width: 100%;
    height: auto;
}

.card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.card .rol {
    font-size: 11px;
    color: #888888;
    margin-bottom: 16px;
    width: auto;
    max-width: none;
    line-height: 1.4;
}

.card a {
    display: inline-block;
    background-color: #ff6600;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.card a:hover {
    background-color: #cc5200;
    color: #ffffff;
    text-decoration: none;
}

/* --- Cards de servicios (servicios.html) ---
   2 cards por fila: 47% ancho + 3% margen-derecho = 50% × 2 = 100%
   font-size: 0 en el contenedor elimina el espacio entre inline-blocks */
.servicios-grid {
    width: 100%;
    max-width: 1100px;
    margin-top: 8px;
    margin-bottom: 40px;
    font-size: 0;
}

.servicio-card {
    display: inline-block;
    width: 47%;
    margin-right: 3%;
    margin-bottom: 28px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: 4px solid #003366;
    border-radius: 8px;
    padding: 0;
    vertical-align: top;
    font-size: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s, border-top-color 0.25s;
}

/* Área de imagen/ícono SVG del servicio */
.servicio-figura {
    background-color: #f0f4fa;
    padding: 28px 24px 18px;
    text-align: center;
    margin: 0;
    transition: background-color 0.25s;
}

.servicio-figura svg {
    width: 72px;
    height: 72px;
}

.servicio-figura figcaption {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    color: #888888;
    font-style: italic;
    margin-top: 10px;
    line-height: 1.4;
    width: auto;
    max-width: none;
    margin-bottom: 0;
}

/* Área de texto del servicio */
.servicio-info {
    padding: 22px 24px 28px;
}

.servicio-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
    border-top-color: #ff6600;
}

/* Al hacer hover en la card, la figura cambia a un tinte cálido naranja */
.servicio-card:hover .servicio-figura {
    background-color: #fff4ee;
}

.servicio-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 12px;
}

.servicio-card p {
    font-size: 14px;
    color: #555555;
    line-height: 1.65;
    width: auto;
    max-width: none;
    margin-bottom: 0;
}

/* --- Formulario de contacto --- */
form {
    width: 100%;
    max-width: 500px;
    margin-top: 8px;
}

form label {
    display: block;
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

form input[type="text"],
form input[type="email"],
form textarea {
    display: block;
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 20px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #fafafa;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
    border-color: #003366;
    outline: none;
}

form textarea {
    height: 130px;
}

form button[type="submit"] {
    background-color: #ff6600;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
}

form button[type="submit"]:hover {
    background-color: #cc5200;
}

/* --- Botón hamburguesa (oculto en escritorio, visible en mobile) --- */
.hamburger {
    display: none;
    float: right;
    background: none;
    border: none;
    color: #003366;
    font-size: 26px;
    line-height: 64px;
    padding: 0 8px;
    cursor: pointer;
}

/* ================================================================
   DISEÑO RESPONSIVE — Breakpoint 768px (dispositivos móviles)
   Leyes de proximidad: elementos apilados con espacio generoso
   ================================================================ */
@media (max-width: 768px) {

    /* -- Header: se adapta en altura y muestra el botón hamburguesa -- */
    header {
        padding: 0 20px;
    }

    .logo-link {
        line-height: 56px;
    }

    .logo-img {
        height: 28px;
    }

    .hamburger {
        display: block;
        line-height: 56px;
    }

    /* -- Menú de navegación: oculto por defecto, se muestra con clase .abierto -- */
    nav {
        display: none;
        float: none;
        position: absolute;
        top: 56px;     /* justo debajo del header mobile */
        left: 0;
        width: 100%;
        background-color: #002255;
        z-index: 99;
    }

    nav.abierto {
        display: block;
    }

    nav ul {
        padding: 8px 0;
    }

    nav li {
        display: block;
    }

    nav a {
        display: block;
        line-height: 1;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        color: #ffffff; /* override: dropdown oscuro necesita texto blanco */
    }

    nav a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffaa55;
    }

    /* -- Hero mobile: isologo y título vuelven a apilarse -- */
    .hero-intro {
        font-size: 16px;
    }

    .hero-isologo {
        display: block;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .hero-titulo {
        display: block;
    }

    /* -- Contenido principal: padding reducido para pantallas chicas -- */
    main {
        padding: 32px 20px;
    }

    main h1 {
        font-size: 26px;
    }

    main h2 {
        font-size: 20px;
        margin-top: 32px;
    }

    main p {
        max-width: 100%;
    }

    /* -- Cards de portfolio: 1 por fila en mobile -- */
    .portfolio-section {
        font-size: 0;
    }

    .card {
        width: 100%;
        margin-right: 0;
    }

    /* -- Cards de servicios: 1 por fila en mobile -- */
    .servicio-card {
        width: 100%;
        margin-right: 0;
    }

    /* -- Footer mobile: padding reducido y padding-bottom del body ajustado al nuevo alto (~65px) -- */
    body {
        padding-bottom: 65px;
    }

    footer {
        padding: 20px;
    }
}
