/* =========================
   RESET GLOBAL
========================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================
   VARIABLES
========================= */
:root {
    --color-primary:   #2C4568;
    --color-accent:    #DE2E3A;
    --color-accent-dk: #c52833;
    --color-light:     #f8f9fa;
    --color-gray:      #DCDCDC;
    --color-white:     #ffffff;
    --color-text:      #2C4568;

    --max-w-nav:   1800px;
    --max-w-sect:  1200px;
    --radius-card: 10px;
    --shadow-card: 0 5px 20px rgba(0,0,0,.10);
    --shadow-map:  0 15px 40px rgba(0,0,0,.15);

    --font-body: 'Helvetica Neue', Arial, sans-serif;
}

/* =========================
   BASE
========================= */
body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background: var(--color-white);
}

/* =========================
   HEADER / NAV
========================= */
header {
    background: var(--color-gray);
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding .3s, box-shadow .3s;
}

nav {
    max-width: var(--max-w-nav);
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 80px;
    display: block;
    width: auto;
    max-width: 100%;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color .3s;
}

.nav-links a:hover { color: var(--color-accent); }

.nav-links a.nav-active {
    color: var(--color-accent);
    font-weight: 700;
}

/* CTA WhatsApp */
.nav-cta {
    background: #25D366;
    color: var(--color-white) !important;
    padding: 0.6rem 1.4rem;
    border-radius: 25px;
    transition: background .3s !important;
}

.nav-cta:hover {
    background: #1ebe57 !important;
    color: var(--color-white) !important;
}

/* Dropdown */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: var(--color-white);
    list-style: none;
    min-width: 220px;
    padding: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    display: none;
    z-index: 999;
}

.dropdown-menu li a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: var(--color-text);
}

.dropdown-menu li a:hover {
    background: #f2f2f2;
    color: var(--color-accent);
}

.dropdown:hover .dropdown-menu { display: block; }

/* Hamburguesa — solo en mobile */
.menu-btn {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

/* Header scrolled */
.header-scrolled nav { padding-top: 0.2rem; padding-bottom: 0.2rem; }
.header-scrolled .logo img { height: 56px; transition: height .3s; }

/* =========================
   HERO PRINCIPAL
========================= */
.hero {
    min-height: 60vh;
    background-image:
        linear-gradient(rgba(44,69,104,.10), rgba(26,41,64,.20)),
        url("../img/hero-bg.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero h1 {
    max-width: 1100px;
    font-size: clamp(2rem, 5vw, 5rem);
    line-height: 1.05;
    margin-left: clamp(2rem, 8vw, 11rem);
    margin-top: clamp(3rem, 8vh, 10rem);
    margin-right: 1.5rem;
    font-weight: 800;
    color: #EAEAEA;
}

.hero .title-top {
    display: block;
    color: var(--color-accent);
    font-weight: 700;
}

.hero .title-top span {
    display: block;
    color: #EAEAEA;
    font-weight: 700;
}

.hero .hero-desc {
    font-size: clamp(0.95rem, 2vw, 1.5rem);
    line-height: 1.5;
    max-width: 850px;
    margin-top: 1.2rem;
    margin-left: clamp(2rem, 8vw, 11rem);
    margin-right: 1.5rem;
    color: #EAEAEA;
}

/* =========================
   SECCIONES GENERALES
========================= */
.section {
    max-width: var(--max-w-sect);
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-subtitle {
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title {
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 0.3rem;
}

/* =========================
   NOSOTROS / ABOUT
========================= */
.about-section { background: var(--color-light); }

.about-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 860px;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    text-align: center;
    background: var(--color-white);
    padding: 1.5rem 1rem;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.feature-item h4 {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* =========================
   SERVICIOS — galería + acordeón
========================= */
.servicios-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-top: 0.5rem;
}

/* --- Slideshow --- */
.servicios-galeria { position: relative; }

.slideshow {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #1a2d47;
    box-shadow: var(--shadow-card);
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .6s ease;
}

.slide.active { opacity: 1; }

.slide img,
.slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f3b63;
    color: rgba(255,255,255,.45);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
}

.slide-placeholder small {
    display: block;
    font-size: 0.78rem;
    opacity: .7;
    margin-top: 4px;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-btn:hover { background: var(--color-accent); }
.slide-prev { left: 10px; }
.slide-next { right: 10px; }

.slide-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}

.slide-dot.active {
    background: var(--color-white);
    transform: scale(1.3);
}

/* --- Recuadros de servicios --- */
.servicios-recuadros {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.servicio-box {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-card);
    padding: 1.2rem 1.4rem;
    background: var(--color-white);
    box-shadow: var(--shadow-card);
    transition: border-color .25s, box-shadow .25s;
}

.servicio-box:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(44,69,104,.13);
}

.servicio-box-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.servicio-box h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.servicio-box p {
    font-size: 0.93rem;
    line-height: 1.7;
    color: #4a5568;
}

/* =========================
   COMPROMISO
========================= */
.compromiso-section { background: var(--color-light); }

.compromiso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.compromiso-item {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-card);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.02em;
}

/* =========================
   CLIENTES
========================= */
.clients-section {
    padding: 50px 20px;
    display: flex;
    justify-content: center;
    background: var(--color-white);
}

.clients-box {
    width: 100%;
    max-width: 1800px;
    position: relative;
    border: 3px solid #1f3b63;
    border-radius: 2px;
    padding: 0 2rem 2.5rem;
    margin-top: 20px;
}

.clients-box::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 6px;
    background: var(--color-white);
    z-index: 1;
}

.clients-title {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: -14px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-white);
    padding: 0 16px;
    width: fit-content;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.client-card {
    background: #e0e0e0;
    height: 70px;
    border-radius: 12px;
}

/* =========================
   CONOCEMOS LO QUE HACEMOS
========================= */
.conocemos-lo-que-hacemos {
    position: relative;
    min-height: 50vh;
    background-image:
        linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)),
        url("../img/indu.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
}

.hero2-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
}

.hero2-content h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.hero2-content p {
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.5;
    max-width: 1000px;
    margin: 0 auto;
}

/* =========================
   UBICACIÓN
========================= */
.ubicacion {
    max-width: var(--max-w-sect);
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.ubicacion-titulo {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 40px;
}

.ubicacion-box {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.ubicacion-mapa {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-map);
}

.ubicacion-mapa iframe {
    width: 100%;
    height: 450px;
    border: 0;
    display: block;
}

.ubicacion-escrita {
    margin-top: 30px;
    font-size: 1.3rem;
    color: #1f3c5a;
    line-height: 1.6;
}

/* =========================
   FOOTER
========================= */
footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 4rem 2rem 1.5rem;
}

.footer-content {
    max-width: var(--max-w-sect);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.footer-logo {
    height: 60px;
    width: auto;
    display: block;
    margin-bottom: 0.75rem;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(255,255,255,.7);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 0.75rem;
    max-width: 280px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: var(--color-white);
    transition: background .25s, transform .2s;
}

.footer-social a:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.footer-social svg { width: 18px; height: 18px; }

.footer-section h3 {
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

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

.footer-section li {
    margin-bottom: 0.55rem;
    font-size: 0.92rem;
    color: rgba(255,255,255,.7);
}

.footer-section a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: color .25s;
}

.footer-section a:hover { color: var(--color-white); }

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.footer-contact-list svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 3px;
    fill: var(--color-accent);
}

.footer-divider {
    max-width: var(--max-w-sect);
    margin: 2.5rem auto 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,.12);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.25rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,.45);
}

/* =========================
   BOTÓN VOLVER ARRIBA
========================= */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .3s, transform .3s, background .2s;
    pointer-events: none;
    z-index: 2000;
}

#backToTop.back-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:hover { background: var(--color-accent); }

/* ================================
   RESPONSIVE — TABLET  ≤ 890px
================================ */
@media (max-width: 890px) {
    .conocemos-lo-que-hacemos { min-height: 70vh; padding: 40px 0; }
    .clients-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ================================
   RESPONSIVE — MÓVIL  ≤ 768px
================================ */
@media (max-width: 768px) {
    .menu-btn { display: block; }

    nav { flex-wrap: wrap; padding: 0.5rem 1rem; }

    .logo img { height: 56px; }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.25rem;
        padding: 0.5rem 0 1rem;
    }

    .nav-links.nav-open { display: flex; }

    .nav-links li { width: 100%; }

    .nav-links a { display: block; padding: 0.4rem 0; }

    .nav-cta {
        display: block;
        text-align: center;
        margin-top: 0.5rem;
        border-radius: 8px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        border-left: 2px solid var(--color-gray);
        border-radius: 0;
        min-width: unset;
    }

    .dropdown-menu.dropdown-open { display: block; }

    .hero h1 { margin-left: 1.5rem; margin-right: 1.5rem; margin-top: 2.5rem; }
    .hero .hero-desc { margin-left: 1.5rem; margin-right: 1.5rem; }

    .servicios-layout { grid-template-columns: 1fr; gap: 1.5rem; }

    .clients-grid { grid-template-columns: repeat(2, 1fr); }

    .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-brand p { max-width: 100%; }

    .ubicacion-mapa iframe { height: 300px; }
    .ubicacion-escrita { font-size: 1.1rem; }
}

/* ================================
   RESPONSIVE — MÓVIL  ≤ 576px
================================ */
@media (max-width: 576px) {
    .logo img { height: 48px; }

    .hero { min-height: 70vh; }
    .hero h1 { margin-left: 1rem; margin-right: 1rem; margin-top: 2rem; }
    .hero .hero-desc { margin-left: 1rem; margin-right: 1rem; }

    .conocemos-lo-que-hacemos { min-height: 60vh; padding: 30px 0; }
    .hero2-content { padding: 0 16px; }

    .clients-grid { grid-template-columns: repeat(2, 1fr); }
    .clients-title { font-size: 1.1rem; padding: 0 10px; }

    .section { padding: 3rem 1rem; }
    .section-title { font-size: 1.8rem; }

    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-brand { grid-column: auto; }

    .ubicacion-mapa iframe { height: 250px; }
}