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

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    overflow-x: hidden;
    color: var(--color-parrafos, #4f5f6f);
    background: var(--bg-general, #ffffff);
}

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

a {
    color: inherit;
}

.detail-body p.detail-list-item {
    position: relative;
    padding: 16px 18px 16px 52px;
    margin: 12px 0;
    border: 1px solid rgba(var(--marca-rgb, 23, 70, 125), 0.12);
    border-radius: 16px;
    background: color-mix(in srgb, var(--section-blog, #f8fafc) 64%, #fff);
    line-height: 1.7;
}

.detail-body p.detail-list-item::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 23px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--line-color, var(--marca));
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--line-color, var(--marca)) 14%, transparent);
}

.detail-body ul,
.detail-body ol {
    display: grid;
    gap: 12px;
    margin: 18px 0 24px;
    padding: 0;
    list-style: none;
}

.detail-body li {
    position: relative;
    padding: 14px 18px 14px 52px;
    border: 1px solid rgba(var(--marca-rgb, 23, 70, 125), 0.12);
    border-radius: 16px;
    background: #fff;
}

.detail-body li::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 22px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--line-color, var(--marca));
}

.detail-heading,
.detail-subheading,
.detail-question {
    color: var(--color-titulos, #173f73);
}

.detail-body .detail-heading {
    font-weight: 900;
}

.detail-subheading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 30px 0 12px;
    font-size: clamp(1.14rem, 2vw, 1.35rem);
    line-height: 1.28;
}

.detail-subheading strong,
.detail-question strong,
.detail-inline-lead {
    color: var(--color-titulos, #173f73);
    font-weight: 900;
}

.detail-section-number {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--color-titulos, #173f73), var(--marca, #17467d));
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 12px 26px rgba(var(--marca-rgb, 23, 70, 125), 0.2);
}

.detail-subheading--plain {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--marca-rgb, 23, 70, 125), 0.12);
}

.detail-subheading--intro {
    padding: 18px 20px;
    border: 1px solid rgba(var(--marca-rgb, 23, 70, 125), 0.12);
    border-radius: 18px;
    background: color-mix(in srgb, var(--section-blog, #f8fafc) 72%, #fff);
}

.detail-question {
    padding: 18px 20px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--line-color, var(--marca)) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--line-color, var(--marca)) 28%, transparent);
    line-height: 1.55;
}

.navbar {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    z-index: 1000;
}
/* ===== HERO BASE ===== */
#inicio {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: #000;
    padding: 0;
    margin: 0;
    min-height: 680px;
}

/* Solo si usas la clase .hero adicionalmente en el HTML */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

/* ===== SLIDER ===== */
.hero-slider {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    /* En escritorio centramos normal */
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 8s linear;
    transform: scale(1.1);
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

/* ===== OVERLAY ===== */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(
        to top,
        rgba(var(--marca-rgb), var(--hero-overlay-opacity, 0.68)) 0%,
        rgba(var(--marca-rgb), calc(var(--hero-overlay-opacity, 0.68) * 0.52)) 50%,
        rgba(var(--marca-rgb), calc(var(--hero-overlay-opacity, 0.68) * 0.22)) 75%,
        transparent 100%
    );
    pointer-events: none;
}

/* ===== CONTENT ===== */
.hero-content {
    position: relative;
    z-index: 10;
    padding: 70px 5% 120px;
    width: 100%;
    max-width: 1100px;
}

.hero-content h1 {
    font-size: clamp(2.6rem, var(--hero-title-vw, 7vw), var(--hero-title-max, 4.5rem));
    font-weight: 800;
    color: #fff;
    line-height: 1.08;
    margin: 0 auto 22px;
    max-width: 1120px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: #fff;
    max-width: 750px;
    margin: 0 auto 40px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    opacity: 0.95;
}

/* ===== BUTTON ===== */
.btn-hero {
    display: inline-block;
    position: relative;
    z-index: 35;
    background-color: var(--btn-bg, var(--marca));
    color: var(--btn-text, #fff);
    padding: 18px 50px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(var(--marca-rgb), 0.4);
    border: none;
}

.btn-hero:hover {
    transform: translateY(-3px) scale(1.03);
    filter: brightness(1.1);
    box-shadow: 0 15px 35px rgba(var(--marca-rgb), 0.6);
}

/* ===== RESPONSIVE OPTIMIZADO ===== */
@media (max-width: 768px) {
    #inicio {
        height: 88vh; /* Evita que la imagen se estire demasiado en vertical */
        min-height: 620px;
    }

    .hero-slide {
        /* IMPORTANTE: Centra al personaje/ingeniero que está a la derecha */
        background-position: 85% center;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 9vw, 2.7rem);
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .btn-hero {
        padding: 14px 30px;
    }
}

.counters-section {
    position: relative;
    z-index: 20;
    padding: 0 8%;
    margin-top: -24px;
}

.counters-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: center;
    align-items: center;
    background: #fff;
    padding: 46px 50px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    gap: 30px;
}

.counter-box {
    width: 100%;
    text-align: center;
}

.counter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--marca);
    margin: 0 0 6px;
    line-height: 1;
}

.counter-label {
    font-weight: 700;
    color: var(--color-parrafos);
    opacity: 0.7;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin: 0;
}

@media (max-width: 720px) {
    .counters-section {
        padding: 0 18px;
        margin-top: -18px;
    }

    .counters-container {
        grid-template-columns: 1fr;
        padding: 30px 22px;
        gap: 22px;
    }
}

.nosotros-container {
    padding: 80px 8%;
    background: var(--section-nosotros, var(--bg-general));
    display: flex;
    justify-content: center;
}

.nosotros-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 42px;
}

.nosotros {
    text-align: center;
}

.nosotros-tabs {
    display: inline-flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(23, 70, 125, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
    align-self: center;
}

.nosotros-tab {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 13px 22px;
    background: transparent;
    color: var(--color-titulos);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 900;
    cursor: pointer;
    transition: background .22s ease, color .22s ease, box-shadow .22s ease;
}

.nosotros-tab.active {
    color: var(--btn-text, #fff);
    background: var(--btn-bg, var(--marca));
    box-shadow: 0 12px 26px rgba(23, 70, 125, 0.18);
}

.nosotros-top-row {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    width: 100%;
}

.nosotros-top-row.active {
    display: flex;
}

.nosotros-panel {
    animation: nosotrosFade .24s ease both;
}

@keyframes nosotrosFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nosotros-text-side {
    flex: 1;
    text-align: left;
}

.nosotros-pre {
    color: var(--marca);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: block;
}

.nosotros-title {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 800;
    color: var(--color-titulos);
    margin-bottom: 25px;
    line-height: 1.1;
}

.nosotros-desc {
    font-size: 1.1rem;
    color: var(--color-parrafos);
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 620px;
}

.btn-nosotros-cta {
    display: inline-flex;
    background: var(--btn-bg, var(--marca));
    color: var(--btn-text, white);
    padding: 16px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
}

.nosotros-img-side {
    flex: 0 0 450px;
}

.nosotros-img-side img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 40px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.nosotros-img-side--empty {
    min-height: 360px;
    border-radius: 40px;
    border: 1px dashed rgba(23, 70, 125, 0.22);
    background:
        linear-gradient(135deg, rgba(23, 70, 125, 0.08), rgba(200, 135, 54, 0.12)),
        var(--section-blog, #f8fafc);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 18px 45px rgba(15, 23, 42, 0.06);
}

.nosotros-stats-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 35px;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--color-titulos);
    line-height: 1.2;
    margin-bottom: 8px;
}

.stat-text {
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1.2px;
}

@media(max-width: 1024px) {
    .nosotros-container {
        padding: 64px 18px;
    }

    .nosotros-content {
        display: flex;
        gap: 14px;
    }

    .nosotros-tabs {
        display: contents;
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .nosotros-top-row {
        flex-direction: column;
        text-align: left;
        padding: 24px 20px;
        border: 1px solid rgba(23, 70, 125, 0.12);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.86);
        box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
        gap: 24px;
    }

    .nosotros-tab {
        width: 100%;
        border-radius: 16px;
        padding: 17px 18px;
        text-align: left;
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid rgba(23, 70, 125, 0.12);
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
        color: var(--color-titulos);
    }

    .nosotros-tab.active {
        background: var(--btn-bg, var(--marca));
        color: var(--btn-text, #fff);
    }

    .nosotros-tab[data-nosotros-tab="quienes-somos"] {
        order: 1;
    }

    .nosotros-panel[data-nosotros-panel="quienes-somos"] {
        order: 2;
    }

    .nosotros-tab[data-nosotros-tab="mision"] {
        order: 3;
    }

    .nosotros-panel[data-nosotros-panel="mision"] {
        order: 4;
    }

    .nosotros-tab[data-nosotros-tab="vision"] {
        order: 5;
    }

    .nosotros-panel[data-nosotros-panel="vision"] {
        order: 6;
    }

    .nosotros-stats-wrapper {
        order: 7;
    }

    .nosotros-text-side {
        order: 1;
        text-align: left;
    }

    .nosotros-img-side {
        order: 2;
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .nosotros-img-side--empty {
        min-height: 240px;
    }

    .nosotros-stats-wrapper {
        order: 7;
        grid-template-columns: 1fr;
        border-top: none;
        padding-top: 20px;
    }

    .nosotros-desc {
        margin: 0 0 22px;
        max-width: none;
    }

    .nosotros-title {
        font-size: clamp(1.7rem, 8vw, 2.2rem);
        margin-bottom: 18px;
    }

    .nosotros-pre {
        font-size: 0.76rem;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   SECCIÓN PORTAFOLIO (PROYECTOS) - CORREGIDO
   ========================================================================== */
.portafolio-section {
    padding: 96px 5%;
    text-align: center;
    background: var(--section-proyectos, var(--bg-general)); /* Sincronizado con tu JSON */
}

.portafolio-header {
    max-width: 800px;
    margin: 0 auto 60px auto;
}

.portafolio-header h2 {
    font-size: clamp(2.1rem, 4vw, 3.25rem);
    font-weight: 900;
    color: var(--color-titulos); /* Sincronizado con tu JSON */
    letter-spacing: 0;
    margin-bottom: 15px;
}

.portafolio-header .line {
    width: 60px; /* Un poco más larga para presencia */
    height: 5px;
    background: var(--line-color, var(--marca)); /* Sincronizado con tu JSON */
    border-radius: 10px;
    margin: 0 auto;
}

/* EL GRID CORREGIDO: Ahora coincide perfectamente con portafolio.php */
.proyecto-grid {
    display: grid;
    /* Autogrid inteligente con ancho mínimo de 320px por tarjeta */
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 24px; /* Más espacio entre proyectos */
    max-width: 1180px;
    margin: 0 auto;
}

.proyecto-card {
    background: var(--card-bg, #ffffff);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    /* Animación de entrada suave */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
}

.proyecto-card:hover {
    transform: translateY(-6px); /* Efecto de flotación */
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12); /* Sombra más pronunciada */
}

.proyecto-thumb {
    aspect-ratio: 16/11; /* Proporción ideal para fotos de arquitectura */
    overflow: hidden;
    background: #f0f0f0;
}

.proyecto-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* Efecto de zoom suave en la imagen al pasar el mouse */
.proyecto-card:hover .proyecto-thumb img {
    transform: scale(1.08);
}

.proyecto-info {
    padding: 25px;
    text-align: left;
    flex-grow: 1; /* Para que todas las tarjetas midan lo mismo */
}

.proyecto-info h3 {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--color-titulos); /* Sincronizado con tu JSON */
    line-height: 1.2;
}

.proyecto-info p {
    color: var(--color-parrafos); /* Sincronizado con tu JSON */
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.proyecto-link {
    color: var(--line-color, var(--marca)); /* Sincronizado con tu JSON */
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 992px) {
    .portafolio-header h2 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .portafolio-header h2 {
        font-size: 2.2rem;
    }

    /* Una sola columna en móviles para mejor legibilidad */
    .proyecto-grid {
        grid-template-columns: 1fr;
    }

    .portafolio-section {
        padding: 60px 5%;
    }
}

.blog-section {
    padding: 96px 5%;
    text-align: center;
    background: var(--section-blog, #fbfbfd);
}

.blog-header {
    max-width: 800px;
    margin: 0 auto 60px auto;
}

.blog-header h2 {
    font-size: clamp(2.1rem, 4vw, 3.25rem);
    font-weight: 900;
    color: var(--color-titulos);
    margin-bottom: 15px;
}

.blog-header .line {
    width: 64px;
    height: 5px;
    background: var(--line-color, var(--marca));
    border-radius: 999px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.blog-card {
    background: var(--card-bg, #fff);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07);
    transition: transform .25s ease, box-shadow .25s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.blog-thumb {
    aspect-ratio: 16/10;
    height: clamp(220px, 24vw, 275px);
    min-height: 220px;
    max-height: 275px;
    overflow: hidden;
    background: color-mix(in srgb, var(--section-blog, #f8fafc) 82%, #fff);
    flex: 0 0 auto;
}

.blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.blog-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--color-titulos);
    font-weight: 900;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(23, 70, 125, 0.08), rgba(200, 135, 54, 0.14)),
        var(--section-blog, #f8fafc);
}

.blog-info {
    padding: 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-info h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--color-titulos);
    line-height: 1.22;
    font-weight: 900;
}

.blog-link {
    color: var(--line-color, var(--marca));
    font-weight: 800;
    margin-top: auto;
    padding-top: 16px;
}

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

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

/* ===== SECTION ===== */
.section-contacto {
    width: 100%;
    background: var(--section-contacto, #fbfbfd);
    padding: 80px 20px; /* FIX PRINCIPAL */
    overflow-x: hidden;
}

/* ===== GRID ===== */
.contacto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

/* ===== TEXTO ===== */
.contacto-info h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}

.contacto-info p {
    font-size: 1.2rem;
    line-height: 1.5;
}

/* ===== FORM ===== */
.form-box {
    background: var(--card-bg, white);
    padding: 35px; /* reducido */
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    width: 100%;
}

/* centra contenido */
.form-box form {
    max-width: 480px;
    margin: 0 auto;
}

/* inputs */
.form-control {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--marca, #0071e3);
}

/* botón */
.btn-enviar {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    background-color: var(--btn-bg, var(--marca, #0071e3));
    color: var(--btn-text, white);
    font-weight: 700;
    cursor: pointer;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    .section-contacto {
        padding: 60px 15px;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contacto-info {
        text-align: center;
        max-width: 500px;
        margin: 0 auto;
    }

    .contacto-info h2 {
        font-size: 2.2rem;
    }

    .form-box {
        padding: 25px 15px;
    }

    .form-box form {
        max-width: 100%;
    }
}

.footer {
    text-align: center;
    padding: 40px 20px;
    background: #111;
    color: #fff;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}
