/* ============================================
   SERVICIOS - Página rediseñada (Figma)
   ============================================ */

.page-servicios {
    padding-top: 70px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ----- Secciones ----- */
.svc-section {
    position: relative;
    z-index: 1;
}

/* Presencia Digital: imagen de fondo y cabecera de módulos #02002D */
.svc-section--presencia-digital {
    background-image: url('../img/servicios/fondo-presencia-digital.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.svc-section--presencia-digital .svc-module-header {
    background-color: #02002D;
}

.svc-section--presencia-digital .svc-module-header:hover {
    background-color: #0a0040;
}

.svc-section--presencia-digital .svc-module:not(.is-expanded) .svc-module-header {
    background-color: #02002D;
}

.svc-section--presencia-digital .svc-module:not(.is-expanded) .svc-module-header:hover {
    background-color: #0a0040;
}

/* Comunicación Corporativa: color de fondo y stretchers #4431EC */
.svc-section--comunicacion-corporativa {
    background-color: #02002D;
}

.svc-section--comunicacion-corporativa .svc-module {
    background-color: #4431EC;
}

.svc-section--comunicacion-corporativa .svc-module-header {
    background-color: #4431EC;
}

.svc-section--comunicacion-corporativa .svc-module-header:hover {
    background-color: #5545f0;
}

.svc-section--comunicacion-corporativa .svc-module:not(.is-expanded) .svc-module-header {
    background-color: #4431EC;
}

.svc-section--comunicacion-corporativa .svc-module:not(.is-expanded) .svc-module-header:hover {
    background-color: #5545f0;
}

.svc-section--comunicacion-corporativa .svc-module-body,
.svc-section--comunicacion-corporativa .svc-module.is-expanded .svc-module-body {
    background-color: #4431EC;
}

/* PR: imagen de fondo y cabecera de módulos #02002D */
.svc-section--pr {
    background-image: url('../img/servicios/fondo-presencia-digital.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.svc-section--pr .svc-module-header {
    background-color: #02002D;
}

.svc-section--pr .svc-module-header:hover {
    background-color: #0a0040;
}

.svc-section--pr .svc-module:not(.is-expanded) .svc-module-header {
    background-color: #02002D;
}

.svc-section--pr .svc-module:not(.is-expanded) .svc-module-header:hover {
    background-color: #0a0040;
}

.svc-section-title {
    font-family: var(--font-inter);
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    color: var(--soul-white);
    margin-bottom: 0.75rem;
}

.svc-section-subtitle {
    font-family: var(--font-dm-sans);
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--soul-text-light);
    margin-bottom: 0;
}

/* ----- Acordeón de módulos (horizontal como en Figma) ----- */
.svc-accordion {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.25rem;
    height: 280px; /* altura fija: no cambia al abrir/cerrar */
}

.svc-module {
    display: flex;
    flex-direction: column;
    background-color: var(--soul-dark-blue);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    transition: flex 0.3s ease, border-color 0.2s ease;
    flex: 0 0 56px;
}

.svc-module.is-expanded {
    flex: 1 1 280px;
    min-width: 240px;
}

.svc-module:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Cabecera del módulo */
.svc-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 1rem 1.25rem;
    background-color: rgba(97, 79, 255, 0.25);
    border: none;
    cursor: pointer;
    font-family: var(--font-inter);
    font-weight: 600;
    font-size: 1rem;
    color: var(--soul-white);
    text-align: left;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.svc-module-header:hover {
    background-color: rgba(97, 79, 255, 0.35);
}

.svc-module-header:focus {
    outline: 2px solid var(--soul-purple);
    outline-offset: 2px;
}

.svc-module-icon {
    flex-shrink: 0;
    margin-left: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.9;
}

/* Colapsado: barra vertical con título rotado */
.svc-module:not(.is-expanded) .svc-module-header {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0.75rem 0.5rem;
    min-height: 100%;
    height: 100%;
    flex: 1;
}

.svc-module:not(.is-expanded) .svc-module-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.svc-module:not(.is-expanded) .svc-module-icon {
    margin-left: 0;
    margin-bottom: 0.25rem;
    order: -1;
}

.svc-module:not(.is-expanded) .svc-module-header {
    background-color: var(--soul-dark-blue);
}

.svc-module:not(.is-expanded) .svc-module-header:hover {
    background-color: rgba(97, 79, 255, 0.15);
}

/* Cuerpo expandido: altura fija, sin transición de altura */
.svc-module-body {
    height: 0;
    padding: 0 1.25rem;
    background-color: var(--soul-dark-blue);
    overflow: hidden;
    flex-shrink: 0;
    transition: none; /* la altura no se anima */
}

.svc-module.is-expanded .svc-module-body {
    height: 232px; /* 280px acordeón - 48px cabecera = altura fija del cuerpo */
    padding: 1.25rem 1.25rem 1.5rem;
    overflow: hidden;
}

.svc-module:not(.is-expanded) .svc-module-body {
    padding-top: 0;
    padding-bottom: 0;
}

/* Texto: solo fade in / fade out */
.svc-module-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
    transition: opacity 0.3s ease;
}

.svc-module:not(.is-expanded) .svc-module-body ul {
    opacity: 0;
}

.svc-module.is-expanded .svc-module-body ul {
    opacity: 1;
    transition-delay: 0.15s; /* breve delay al abrir para que coincida con el ancho */
}

.svc-module-body li {
    font-family: var(--font-dm-sans);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--soul-text-light);
    margin-bottom: 0.6rem;
    padding-left: 1.25rem;
    position: relative;
}

.svc-module-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 5px;
    height: 5px;
    background-color: var(--soul-purple);
    border-radius: 50%;
}

.svc-module-body li:last-child {
    margin-bottom: 0;
}

/* Módulo colapsado: barra vertical con título rotado (solo en desktop si se desea) */
.svc-module:not(.is-expanded) .svc-module-header {
    background-color: var(--soul-dark-blue);
}

.svc-module:not(.is-expanded) .svc-module-header:hover {
    background-color: rgba(97, 79, 255, 0.15);
}

/* Sección alternada: texto a la derecha */
.svc-section--alt .svc-section-subtitle {
    margin-bottom: 0;
}

/* Responsive: en móvil/tablet los módulos vuelven a apilarse en vertical */
@media (max-width: 991.98px) {
    .svc-accordion {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }
    .svc-module {
        flex: none;
        width: 100%;
    }
    .svc-module.is-expanded {
        min-width: 0;
    }
    .svc-module.is-expanded .svc-module-body {
        height: auto; /* en móvil el cuerpo crece con el contenido */
    }
    .svc-module:not(.is-expanded) .svc-module-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.25rem;
        min-height: 48px;
        height: auto;
        flex: none;
    }
    .svc-module:not(.is-expanded) .svc-module-title {
        writing-mode: horizontal-tb;
        transform: none;
        margin: 0;
        font-size: 1rem;
    }
    .svc-module:not(.is-expanded) .svc-module-icon {
        margin-left: 0.5rem;
        margin-bottom: 0;
        order: 0;
    }
    .svc-section--alt .col-lg-5.order-lg-2 {
        text-align: left !important;
    }
}

@media (max-width: 768px) {
    .svc-section-title {
        font-size: 1.5rem;
    }
    .svc-section-subtitle {
        font-size: 0.95rem;
    }
    .svc-module-header {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    .svc-module-body {
        padding: 1rem 1rem 1.25rem;
    }
    .svc-module-body li {
        font-size: 0.9rem;
    }
}
