/* ========================================================
   HEADER SÓLIDO EN CONTÁCTANOS
   Evita la transparencia al inicio de la página para que el logo blanco
   y los enlaces de navegación tengan contraste 100% nítido sobre fondo oscuro.
======================================================== */
header,
header.header,
header.header--fixed {
    background-color: #081C35 !important;
    background: #081C35 !important;
    backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(8, 28, 53, 0.3) !important;
}

header .header-top {
    background-color: #050C16 !important;
}

/* Universal scroll margin for anchors */
#contacto,
#formulario-contacto,
#directorio-panel,
.contact-section {
    scroll-margin-top: 155px;
}

@media (max-width: 991.98px) {
    #contacto,
    #formulario-contacto,
    #directorio-panel,
    .contact-section {
        scroll-margin-top: 115px;
    }
}

.contact-section {
    padding: 145px 0 95px;
    background: linear-gradient(180deg, #E6EDF5 0%, #F8FAFC 240px);
    min-height: 90vh;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 410px 1fr;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    box-shadow: 0 20px 45px -15px rgba(8, 28, 53, 0.08), 0 0 0 1px rgba(8, 28, 53, 0.02);
    background: #FFFFFF;
}

/* ========================================================
   1. PANEL LATERAL IZQUIERDO (CANALES DIRECTOS / INFO)
======================================================== */
.contact-info-panel {
    position: relative;
    background: #081C35 url('../images/index/DesarrolloProyectos.webp') center/cover no-repeat;
    display: flex;
    flex-direction: column;
}

.contact-info-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(8, 28, 53, 0.97) 0%, rgba(1, 63, 123, 0.92) 100%);
}

.contact-info-content {
    position: relative;
    z-index: 2;
    padding: 44px 34px;
    color: #FFFFFF;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-badge,
.contact-badge-alt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    width: fit-content;
}

.contact-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #7DD3FC;
}

.contact-badge-danger {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #FCA5A5;
}

.contact-badge-alt {
    background: #F0F7FF;
    border: 1px solid #BAE6FD;
    color: #0369A1;
}

.contact-badge-danger-alt {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
}

.contact-info-content h2 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.85rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.025em;
    margin-bottom: 10px;
}

.contact-panel-desc {
    font-size: 0.88rem;
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.55;
    margin-bottom: 28px;
}

/* LISTA DE CANALES */
.contact-channels-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.contact-channel-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.contact-channel-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(2px);
}

.channel-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38BDF8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.channel-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.channel-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94A3B8;
    margin-bottom: 2px;
}

.channel-value,
.channel-link {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.86rem;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    transition: color 0.15s ease;
}

.channel-link:hover {
    color: #38BDF8;
}

.channel-email {
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    word-break: break-all;
}

.channel-text {
    font-size: 0.8rem;
    color: #E2E8F0;
    margin: 0;
    line-height: 1.4;
}

/* SLA BOX */
.contact-sla-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    color: #CBD5E1;
    margin-bottom: 20px;
}

.contact-sla-box .sla-target {
    color: #34D399;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* TARJETA CONCESIÓN / FILIALES */
.contact-consorcio-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.consorcio-text {
    display: flex;
    flex-direction: column;
}

.consorcio-text strong {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.78rem;
    color: #FFFFFF;
    font-weight: 700;
}

.consorcio-text span {
    font-size: 0.7rem;
    color: #94A3B8;
    line-height: 1.3;
}

.consorcio-link {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.consorcio-link:hover {
    background: #0260A8;
    color: #FFFFFF;
    transform: translateX(2px);
}

/* ========================================================
   2. PANEL DERECHO (FORMULARIO EJECUTIVO)
======================================================== */
.contact-form-panel {
    padding: 44px 40px;
    background: #FFFFFF;
}

.contact-form-header {
    margin-bottom: 20px;
}

.contact-form-header h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.7rem;
    font-weight: 800;
    color: #081C35;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}

.contact-form-header p {
    font-size: 0.9rem;
    color: #64748B;
    margin: 0;
    line-height: 1.5;
}

/* ALERTAS */
.contact-success-alert {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
}

.contact-success-alert .success-icon {
    color: #16A34A;
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 1px;
}

.contact-success-alert .success-content strong {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.88rem;
    color: #166534;
    display: block;
    margin-bottom: 2px;
}

.contact-success-alert .success-content p {
    font-size: 0.82rem;
    color: #15803D;
    margin: 0;
    line-height: 1.45;
}

.contact-error-alert {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.84rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

/* ========================================================
   3. BANNER CONTEXTUAL REACTIVO
======================================================== */
.contact-context-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #F0F9FF;
    border: 1px solid #E0F2FE;
    margin-bottom: 22px;
    transition: all 0.25s ease;
}

.context-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #E0F2FE;
    color: #013F7B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.context-banner-body {
    min-width: 0;
}

.context-banner-body strong {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    color: #081C35;
    display: block;
    font-weight: 700;
    line-height: 1.3;
}

.context-banner-body p {
    font-size: 0.77rem;
    color: #475569;
    margin: 2px 0 0;
    line-height: 1.35;
}

/* ========================================================
   4. FORMULARIO E INPUTS PERSONALIZADOS
======================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group-custom {
    display: flex;
    flex-direction: column;
}

.form-label-custom {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 6px;
}

.label-optional {
    text-transform: none;
    font-weight: 400;
    color: #94A3B8;
    font-size: 0.7rem;
}

.form-control-custom {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    color: #0F172A;
    background: #F8FAFC;
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    outline: none;
    background: #FFFFFF;
    border-color: #013F7B;
    box-shadow: 0 0 0 3px rgba(1, 63, 123, 0.12);
}

.form-control-custom::placeholder {
    color: #94A3B8;
    font-size: 0.84rem;
}

.input-locked {
    background-color: #F1F5F9 !important;
    color: #64748B !important;
    cursor: not-allowed;
    border-color: #E2E8F0;
}

.form-textarea-custom {
    resize: vertical;
    min-height: 95px;
    line-height: 1.5;
}

/* ========================================================
   5. SMART CHIPS (RADIO PILLS)
======================================================== */
.chip-source-hint {
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    color: #0260A8;
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    padding: 2px 8px;
    border-radius: 4px;
}

.contact-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-chip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #334155;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
}

.contact-chip-pill input[type="radio"] {
    display: none;
}

.contact-chip-pill i {
    font-size: 0.85rem;
    color: #0260A8;
    transition: color 0.2s ease;
}

.contact-chip-pill:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #0F172A;
    transform: translateY(-1px);
}

/* ESTADO SELECCIONADO / ACTIVO */
.contact-chip-pill.active,
.contact-chip-pill:has(input[type="radio"]:checked) {
    background: #013F7B;
    border-color: #013F7B;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(1, 63, 123, 0.25);
    transform: translateY(-1px);
}

.contact-chip-pill.active i,
.contact-chip-pill:has(input[type="radio"]:checked) i {
    color: #38BDF8;
}

/* ========================================================
   6. FOOTER Y BOTÓN DE ENVÍO
======================================================== */
.contact-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #F1F5F9;
}

.contact-footer-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: #64748B;
}

.contact-submit-btn {
    border: none;
    background: #013F7B;
    color: #FFFFFF;
    padding: 11px 26px;
    border-radius: 8px;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(1, 63, 123, 0.2);
}

.contact-submit-btn:hover {
    background: #0260A8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(1, 63, 123, 0.3);
}

.contact-submit-btn:active {
    transform: translateY(0);
}

/* ========================================================
   7. RESPONSIVE DESIGN: OPCIÓN 1 (APP DIRECT CONTACT HUB)
   (MÓVILES Y TABLETS < 992px - ESCRITORIO INTACTO)
======================================================== */

/* Enlace a Google Maps en Sede Central */
.channel-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #38BDF8;
    text-decoration: none;
    margin-top: 6px;
    transition: all 0.2s ease;
}

.channel-map-btn:hover {
    color: #BAE6FD;
    text-decoration: underline;
}

/* Header Móvil Exclusivo */
.contact-mobile-header {
    margin-top: -10px;
    margin-bottom: 20px;
}

.contact-mobile-title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: clamp(1.45rem, 5vw, 1.95rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    color: #081C35;
    margin-bottom: 6px;
    line-height: 1.15;
}

.contact-mobile-subtitle {
    font-size: 0.84rem;
    color: #64748B;
    margin: 0 auto;
    max-width: 440px;
    line-height: 1.45;
}

/* Barra de Acción Rápida 1-Tap Móvil */
.contact-mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.btn-quick-touch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    padding: 11px 14px;
    border-radius: 12px;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    color: #081C35;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(8, 28, 53, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 44px;
}

.btn-quick-touch:active {
    transform: scale(0.97);
}

.btn-quick-touch.btn-quick-call {
    background: #013F7B;
    color: #FFFFFF;
    border-color: #013F7B;
    box-shadow: 0 4px 14px rgba(1, 63, 123, 0.25);
}

.btn-quick-touch.btn-quick-call i {
    color: #FDBD06;
}

.btn-quick-touch.btn-quick-mail {
    background: #FFFFFF;
    color: #013F7B;
    border-color: #CBD5E1;
}

.btn-quick-touch.btn-quick-mail i {
    color: #0260A8;
}

/* Selector Segmentado Táctil Móvil */
.contact-mobile-segmented {
    background: #E2E8F0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    width: 100%;
}

.btn-contact-seg {
    flex: 1;
    border: none;
    background: transparent;
    color: #475569;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
}

.btn-contact-seg.active {
    background: #013F7B;
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(1, 63, 123, 0.25);
}

.btn-contact-seg.active i {
    color: #38BDF8;
}

/* REGLAS EXCLUSIVAS PARA TABLET Y MÓVIL (< 992px) */
@media (max-width: 991.98px) {
    .contact-section {
        padding-top: 95px !important;
        padding-bottom: 55px;
        background: linear-gradient(180deg, #E6EDF5 0%, #F1F5F9 200px, #F8FAFC 100%);
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(8, 28, 53, 0.08);
        border: 1px solid #CBD5E1;
        overflow: hidden;
    }

    /* Alternancia de Paneles con Selector Segmentado */
    .contact-wrapper.show-form .contact-info-panel {
        display: none !important;
    }

    .contact-wrapper.show-form .contact-form-panel {
        display: block !important;
    }

    .contact-wrapper.show-info .contact-info-panel {
        display: flex !important;
    }

    .contact-wrapper.show-info .contact-form-panel {
        display: none !important;
    }

    /* Panel de Información / Directorio en Móvil */
    .contact-info-panel {
        min-height: auto;
    }

    .contact-info-content {
        padding: 24px 18px;
    }

    .contact-info-content h2 {
        font-size: 1.35rem;
        margin-bottom: 6px;
    }

    .contact-panel-desc {
        font-size: 0.82rem;
        margin-bottom: 18px;
    }

    .contact-channels-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .contact-channel-item {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 12px 14px;
        backdrop-filter: blur(8px);
        margin-bottom: 0;
        transition: background 0.2s ease;
    }

    .contact-channel-item:active {
        background: rgba(255, 255, 255, 0.12);
    }

    .channel-icon-box {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 1.05rem;
    }

    .channel-label {
        font-size: 0.68rem;
    }

    .channel-link,
    .channel-value {
        font-size: 0.88rem;
    }

    .channel-text {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .contact-sla-box {
        margin-top: 14px;
        padding: 12px 14px;
        border-radius: 12px;
        background: rgba(8, 28, 53, 0.7);
        border: 1px solid rgba(56, 189, 248, 0.25);
    }

    .contact-consorcio-card {
        margin-top: 14px;
        padding: 14px;
        border-radius: 12px;
    }

    /* Panel del Formulario en Móvil */
    .contact-form-panel {
        padding: 24px 18px;
    }

    .contact-form-header h3 {
        font-size: 1.35rem;
        margin-bottom: 4px;
    }

    .contact-form-header p {
        font-size: 0.82rem;
        margin-bottom: 16px;
    }

    .contact-context-banner {
        padding: 10px 14px;
        border-radius: 12px;
        gap: 10px;
        margin-bottom: 18px;
    }

    .context-banner-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .context-banner-body strong {
        font-size: 0.82rem;
    }

    .context-banner-body p {
        font-size: 0.74rem;
    }

    .form-label-custom {
        font-size: 0.74rem;
        margin-bottom: 5px;
    }

    .form-control-custom {
        min-height: 46px;
        font-size: 16px; /* Evita auto-zoom en iOS Safari */
        border-radius: 10px;
        padding: 10px 12px;
    }

    .form-textarea-custom {
        min-height: 100px;
        font-size: 16px;
        border-radius: 10px;
    }

    .contact-chips-grid {
        gap: 6px;
    }

    .contact-chip-pill {
        min-height: 42px;
        font-size: 0.76rem;
        padding: 8px 12px;
        border-radius: 9px;
    }

    .contact-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
        margin-top: 18px;
        padding-top: 14px;
    }

    .contact-submit-btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        border-radius: 11px;
        font-size: 0.92rem;
    }

    .contact-footer-note {
        justify-content: center;
        font-size: 0.7rem;
        text-align: center;
    }
}

/* REGLAS EXCLUSIVAS PARA SMARTPHONES COMPACTOS (< 640px) */
@media (max-width: 639.98px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .contact-chip-pill {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }
}
