/* =====================================================================
   GRUPO ENFOQUE PERÚ — Componentes de Servicios
   - Tarjetas compactas del home (con botón Explorar)
   - Mega-menú "Servicios" en el header
   - Página dedicada por unidad (servicio.php)
   Usa las variables de marca definidas en styles.css (:root).
   ===================================================================== */

/* ---------- HOME: tarjeta compacta de unidad ---------- */
.unidad-mini {
    list-style: none; margin: 16px 0 22px; padding: 0;
    display: grid; gap: 10px;
}
.unidad-mini li {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.92rem; font-weight: 600; color: var(--azul-navy);
    padding: 9px 14px; background: var(--gris-claro); border-radius: 8px;
    border-left: 3px solid var(--cian);
}
.unidad-mini li i { color: var(--naranja); font-size: 1rem; flex: 0 0 auto; }

.unidad-actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.unidad-explorar {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 13px 20px !important; font-weight: 700;
    background: linear-gradient(135deg, var(--naranja), var(--naranja-hover)) !important;
    color: #fff !important; border-radius: 10px; letter-spacing: .3px;
}
.unidad-explorar i { transition: transform .3s ease; }
.unidad-explorar:hover i { transform: translateX(5px); }
.unidad-actions .unidad-link {
    text-align: center; font-weight: 600; color: var(--cian-oscuro); font-size: .9rem;
}
.unidad-actions .unidad-link:hover { color: var(--naranja); }

/* ---------- HEADER: mega-menú "Servicios" (solo desktop) ---------- */
.nav-menu .has-mega { position: relative; }
.nav-menu .mega-menu {
    display: none;
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
    min-width: 280px; background: #fff; border-radius: 14px; padding: 10px;
    box-shadow: 0 22px 50px rgba(13,59,94,.22); list-style: none;
    border-top: 3px solid var(--naranja); z-index: 1200;
}
@media (min-width: 1181px) {
    .nav-menu .has-mega:hover .mega-menu { display: block; animation: megaIn .25s ease; }
}
@keyframes megaIn { from { opacity: 0; transform: translateX(-50%) translateY(0); } to { opacity: 1; transform: translateX(-50%) translateY(8px); } }
.nav-menu .mega-menu li { width: 100%; }
.nav-menu .mega-menu a {
    display: flex !important; align-items: center; gap: 12px;
    padding: 12px 14px !important; border-radius: 9px; font-size: .92rem; color: var(--azul-navy) !important;
    background: transparent !important;
}
.nav-menu .mega-menu a i { color: var(--cian); width: 22px; text-align: center; font-size: 1.05rem; }
.nav-menu .mega-menu a:hover { background: var(--gris-claro) !important; color: var(--naranja) !important; }
.nav-menu .mega-menu a:hover i { color: var(--naranja); }

/* ===================== PÁGINA DEDICADA (servicio.php) ===================== */

/* HERO */
.svc-hero {
    background-size: cover; background-position: center; color: #fff;
    padding: 48px 0 64px; position: relative;
}
.svc-breadcrumb { font-size: .85rem; margin-bottom: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; opacity: .92; }
.svc-breadcrumb a { color: #fff; opacity: .8; }
.svc-breadcrumb a:hover { color: var(--dorado); opacity: 1; }
.svc-breadcrumb i { font-size: .65rem; opacity: .6; }
.svc-breadcrumb span { color: var(--dorado); font-weight: 600; }
.svc-hero-content { max-width: 760px; position: relative; }
.svc-number {
    font-family: 'Montserrat'; font-size: 4.5rem; font-weight: 800; line-height: 1;
    color: rgba(255,255,255,.14); display: block; margin-bottom: -28px;
}
.svc-hero-icon {
    width: 74px; height: 74px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--naranja), var(--dorado)); font-size: 1.9rem; color: #fff;
    margin-bottom: 18px; box-shadow: 0 10px 30px rgba(232,101,42,.45);
}
.svc-hero-content h1 { font-size: 2.7rem; margin-bottom: 12px; color: #fff; line-height: 1.12; }
.svc-hero-sub { font-size: 1.15rem; color: var(--dorado); font-weight: 600; margin-bottom: 16px; }
.svc-hero-desc { font-size: 1.02rem; opacity: .9; margin-bottom: 28px; max-width: 640px; }
.svc-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.svc-btn-ghost {
    display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px;
    border: 2px solid rgba(255,255,255,.55); color: #fff !important; border-radius: 50px; font-weight: 700;
}
.svc-btn-ghost:hover { background: #fff; color: var(--azul-navy) !important; border-color: #fff; }

/* DETALLE — grid de los 4 grupos */
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 26px; }
.svc-group {
    background: #fff; border-radius: 16px; padding: 30px; box-shadow: var(--sombra);
    border: 1px solid var(--gris-medio); transition: transform .3s ease, box-shadow .3s ease;
    position: relative; overflow: hidden;
}
.svc-group::before {
    content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%;
    background: linear-gradient(180deg, var(--naranja), var(--cian));
}
.svc-group:hover { transform: translateY(-6px); box-shadow: var(--sombra-hover); }
.svc-group-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--gris-medio); }
.svc-group-num { font-family: 'Montserrat'; font-size: 1.6rem; font-weight: 800; color: var(--cian); opacity: .55; }
.svc-group-head h3 { font-size: 1.25rem; color: var(--azul-navy); }
.svc-group-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.svc-group-list li { display: flex; align-items: flex-start; gap: 12px; font-size: .96rem; color: var(--gris-oscuro); line-height: 1.5; }
.svc-group-list li i { color: #27ae60; margin-top: 4px; flex: 0 0 auto; }

/* CTA */
.svc-cta {
    margin-top: 44px; background: linear-gradient(135deg, var(--azul-navy-oscuro), var(--azul-navy));
    border-radius: 20px; padding: 40px 44px; display: flex; align-items: center; justify-content: space-between;
    gap: 26px; flex-wrap: wrap; box-shadow: var(--sombra);
}
.svc-cta-text h3 { color: #fff; font-size: 1.5rem; margin-bottom: 8px; }
.svc-cta-text p { color: rgba(255,255,255,.82); max-width: 560px; }
.svc-cta .btn { white-space: nowrap; }

/* OTRAS UNIDADES */
.svc-otras { background: var(--gris-claro); }
.svc-otras-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.svc-otra-card {
    display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 14px;
    padding: 22px; box-shadow: var(--sombra); border: 1px solid var(--gris-medio);
    transition: transform .3s ease, box-shadow .3s ease;
}
.svc-otra-card:hover { transform: translateY(-5px); box-shadow: var(--sombra-hover); }
.svc-otra-icon {
    width: 54px; height: 54px; border-radius: 13px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--azul-navy), var(--cian)); color: #fff; font-size: 1.3rem;
}
.svc-otra-info { flex: 1; min-width: 0; }
.svc-otra-num { font-size: .72rem; font-weight: 700; color: var(--naranja); letter-spacing: 1px; }
.svc-otra-info h4 { font-size: 1.05rem; color: var(--azul-navy); margin: 2px 0; }
.svc-otra-info p { font-size: .82rem; color: var(--gris-texto); margin: 0; }
.svc-otra-arrow { color: var(--cian); transition: transform .3s ease; flex: 0 0 auto; }
.svc-otra-card:hover .svc-otra-arrow { transform: translateX(5px); color: var(--naranja); }

/* svc-group ahora es un enlace (a su página propia) */
.svc-group { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.svc-group .svc-group-list { flex: 1 1 auto; }
.svc-group-more {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
    font-weight: 700; font-size: .9rem; color: var(--naranja);
}
.svc-group-more i { transition: transform .3s ease; }
.svc-group:hover .svc-group-more i { transform: translateX(5px); }
.svc-group:hover h3 { color: var(--naranja); }

/* ===================== PÁGINA DE DETALLE (servicio individual) ===================== */
.det-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.det-item {
    position: relative; background: #fff; border-radius: 14px; padding: 30px 28px 28px;
    box-shadow: var(--sombra); border: 1px solid var(--gris-medio); overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}
.det-item::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--naranja), var(--cian)); }
.det-item:hover { transform: translateY(-5px); box-shadow: var(--sombra-hover); }
.det-item-num { position: absolute; top: 16px; right: 20px; font-family: 'Montserrat'; font-weight: 800; font-size: 1.7rem; color: var(--gris-medio); }
.det-item-ic { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--azul-navy), var(--cian)); color: #fff; font-size: 1.1rem; margin-bottom: 16px; }
.det-item h3 { font-size: 1.12rem; color: var(--azul-navy); line-height: 1.35; }
@media (max-width: 768px) { .det-grid { grid-template-columns: 1fr; } }

/* ===================== DECK 3D DE NOSOTROS (tarjetas apiladas) ===================== */
.nosotros-deck { position: relative; width: 100%; height: 430px; perspective: 1500px; }
.deck-card {
    position: absolute; top: 0; left: 0; width: 76%; height: 360px;
    border-radius: 20px; overflow: hidden; background: var(--azul-navy);
    box-shadow: 0 26px 55px rgba(13,59,94,.30); cursor: pointer;
    transform-origin: center center; will-change: transform, opacity, filter;
    transition: transform .75s cubic-bezier(.2,.75,.2,1), opacity .75s ease, filter .75s ease;
}
.deck-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,42,69,.55), transparent 50%); }
.deck-label {
    position: absolute; left: 16px; bottom: 16px; z-index: 3;
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(8,42,69,.85); color: #fff; padding: 8px 16px; border-radius: 30px;
    font-size: .82rem; font-weight: 700; backdrop-filter: blur(4px);
    opacity: 0; transform: translateY(8px); transition: opacity .5s ease .15s, transform .5s ease .15s;
}
.deck-label i { color: var(--dorado); }

/* Posiciones de la baraja (las setea el JS) */
.deck-card.pos-0 { transform: translate3d(0, 42px, 0) scale(1) rotateY(0deg); opacity: 1; z-index: 40; filter: none; }
.deck-card.pos-0 .deck-label { opacity: 1; transform: none; }
.deck-card.pos-1 { transform: translate3d(18%, 22px, -70px) scale(.92) rotateY(-8deg); opacity: .95; z-index: 30; filter: brightness(.8); }
.deck-card.pos-2 { transform: translate3d(27%, 4px, -150px) scale(.84) rotateY(-12deg); opacity: .7; z-index: 20; filter: brightness(.66); }
.deck-card.pos-3 { transform: translate3d(34%, -16px, -210px) scale(.78) rotateY(-15deg); opacity: .5; z-index: 10; filter: brightness(.56); }

/* Badge flotante (arriba-izquierda para no chocar con la etiqueta) */
.deck-badge {
    position: absolute; left: -16px; top: 14px; z-index: 50;
    width: 92px; height: 92px; border-radius: 22px;
    background: linear-gradient(135deg, var(--naranja), var(--dorado)); color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    box-shadow: 0 16px 36px rgba(232,101,42,.5); pointer-events: none;
}
.deck-badge-num { font-family: 'Montserrat'; font-weight: 800; font-size: 2rem; line-height: 1; }
.deck-badge-txt { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-top: 4px; }

/* Dots */
.deck-dots { position: absolute; bottom: -34px; left: 0; display: flex; gap: 9px; z-index: 5; }
.deck-dot { width: 11px; height: 11px; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: var(--gris-medio); transition: all .3s ease; }
.deck-dot:hover { background: var(--cian); }
.deck-dot.is-active { background: var(--naranja); width: 30px; border-radius: 6px; }

@media (max-width: 900px) {
    .nosotros-deck { height: 380px; margin-bottom: 30px; }
    .deck-card { width: 80%; height: 310px; }
    .deck-badge { width: 78px; height: 78px; left: 4px; }
    .deck-badge-num { font-size: 1.7rem; }
}
@media (max-width: 480px) {
    .nosotros-deck { height: 320px; }
    .deck-card { width: 84%; height: 260px; }
    .deck-card.pos-1 { transform: translate3d(12%, 16px, -70px) scale(.93) rotateY(-6deg); }
    .deck-card.pos-2 { transform: translate3d(16%, 2px, -140px) scale(.87) rotateY(-9deg); }
    .deck-card.pos-3 { transform: translate3d(20%, -10px, -200px) scale(.82) rotateY(-12deg); }
}

/* ===================== CARRUSEL DE ALIADOS ===================== */
.aliados-carousel { position: relative; padding: 0 58px; z-index: 1; }
.ac-viewport { overflow: hidden; padding: 10px 4px; }
.ac-track {
    display: flex; gap: 24px;
    transition: transform .55s cubic-bezier(.2,.7,.2,1);
    will-change: transform;
}
.ac-track > .ally-card { flex: 0 0 auto; } /* el ancho lo fija el JS */

.ac-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--azul-navy); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; box-shadow: 0 8px 22px rgba(13,59,94,.32); z-index: 6;
    transition: background .25s, transform .25s, box-shadow .25s;
}
.ac-arrow:hover { background: var(--naranja); transform: translateY(-50%) scale(1.1); box-shadow: 0 0 22px rgba(232,101,42,.5); }
.ac-arrow:active { transform: translateY(-50%) scale(.95); }
.ac-prev { left: 0; }
.ac-next { right: 0; }

.ac-dots { display: flex; justify-content: center; gap: 9px; margin-top: 28px; }
.ac-dot {
    width: 11px; height: 11px; border-radius: 50%; padding: 0; border: none; cursor: pointer;
    background: var(--gris-medio); transition: all .3s ease;
}
.ac-dot:hover { background: var(--cian); }
.ac-dot.is-active { background: var(--naranja); width: 30px; border-radius: 6px; }

@media (max-width: 600px) {
    .aliados-carousel { padding: 0 42px; }
    .ac-arrow { width: 38px; height: 38px; font-size: .9rem; }
    .ac-dots { margin-top: 22px; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .svc-grid { grid-template-columns: 1fr; }
    .svc-otras-grid { grid-template-columns: 1fr; }
    .svc-hero-content h1 { font-size: 2.1rem; }
}
@media (max-width: 600px) {
    .svc-hero { padding: 36px 0 48px; }
    .svc-hero-content h1 { font-size: 1.7rem; }
    .svc-number { font-size: 3.4rem; }
    .svc-cta { padding: 30px 24px; }
    .svc-cta-text h3 { font-size: 1.25rem; }
    .svc-group { padding: 24px 20px; }
}
