/* ==========================================
   OBSERVATORIO DE COMPETITIVIDAD
========================================== */

.observatorio {
    --obs-green: #087f45;
    --obs-green-dark: #076b3b;
    --obs-blue: #203c63;
    --obs-orange: #ff890d;
    --obs-text: #292929;
    --obs-muted: #737f92;
    --obs-border: #e1e6eb;
    --obs-bg: #f5f6f8;

    padding: 16px 24px 60px;
    color: var(--obs-text);
    box-sizing: border-box;
}

.observatorio *,
.observatorio *::before,
.observatorio *::after {
    box-sizing: border-box;
}

.observatorio-container {
    width: 100%;
    max-width: 1460px;
    margin: 0 auto;
}


/* ==========================================
   HERO
========================================== */

.observatorio-hero {
    position: relative;
    background: #fff;
    border: 1px solid var(--obs-border);
    border-radius: 19px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.observatorio-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
            #078447 0%,
            #a6a13b 55%,
            #203e66 100%);
}

.observatorio-hero-content {
    padding: 32px 29px 28px;
}

.observatorio-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 30px;
    border: 1px solid #d9e7df;
    background: #f2f8f4;
    color: var(--obs-green);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 17px;
}

.observatorio-hero h1 {
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -1.1px;
    color: #292929;
    margin: 0 0 10px;
}

.observatorio-hero p {
    max-width: 820px;
    margin: 0;
    color: #707b8d;
    font-size: 16px;
    line-height: 1.55;
}


/* ==========================================
   TABS DE NAVEGACIÓN
========================================== */

.observatorio-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--obs-border);
    border-radius: 19px;
    margin-bottom: 38px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.observatorio-tabs::-webkit-scrollbar {
    display: none;
}

.observatorio-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 49px;
    padding: 0 19px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: #737e90;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s ease;
}

.observatorio-tab i {
    font-size: 15px;
}

.observatorio-tab:hover {
    background: #f3f6f5;
    color: var(--obs-green);
}

.observatorio-tab.active {
    color: #fff;
    background: var(--obs-green);
    box-shadow: 0 3px 7px rgba(8, 127, 69, .18);
}

.active-btn {
    color: #fff;
    background: var(--obs-green);
    box-shadow: 0 3px 7px rgba(8, 127, 69, .18);
}

.observatorio-tab.active:hover {
    background: var(--obs-green-dark);
}


/* ==========================================
   FILTROS
========================================== */

.observatorio-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
}

.observatorio-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 37px;
    padding: 0 17px;
    border: 1px solid #dce2e8;
    border-radius: 30px;
    background: #fff;
    color: #707b8e;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s ease;
}

.observatorio-filter:hover {
    border-color: #a6cdb8;
    color: var(--obs-green);
    background: #f5faf7;
}

.observatorio-filter.active {
    color: #fff;
    background: var(--obs-green);
    border-color: var(--obs-green);
}


/* ==========================================
   GRID DE INDICADORES
========================================== */

.observatorio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 19px;
}


/* ==========================================
   TARJETAS
========================================== */

.indicador-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 205px;
    padding: 25px 24px 18px;
    background: #fff;
    border: 1px solid #e6e9ed;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .035);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.indicador-card:hover {
    transform: translateY(-3px);
    border-color: #cddbd3;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}


/* Detalles superiores */

.indicador-card.indicador-highlight::before,
.indicador-card.indicador-highlight-dark::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.indicador-card.indicador-highlight::before {
    background: #cce6d9;
}

.indicador-card.indicador-highlight-dark::before {
    background: #269665;
}


/* Parte superior */

.indicador-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
}

.indicador-category {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border: 1px solid #dce2e9;
    border-radius: 30px;
    color: #748094;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.indicador-variation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.indicador-variation.positive {
    color: #078747;
    background: #f0f8f3;
}

.indicador-variation.negative {
    color: #dc2626;
    background: #fff1f1;
}

.indicador-variation.neutral {
    color: #697586;
    background: #e5e8eb;
}


/* Valores */

.indicador-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #303030;
    font-size: 37px;
    font-weight: 750;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 3px;
    white-space: nowrap;
}

.indicador-value small {
    color: #778195;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
}

.indicador-card h3 {
    margin: 0;
    color: #303030;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}


/* Resaltar valores */

.indicador-highlight .indicador-value {
    color: #2c4439;
}

.indicador-highlight-dark .indicador-value {
    color: #087b46;
}


/* Footer de cada tarjeta */

.indicador-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e9edf1;
    color: #788396;
    font-size: 13px;
}

.indicador-footer span {
    white-space: nowrap;
}

.indicador-footer span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.indicador-footer i {
    margin-right: 5px;
    font-size: 11px;
}


/* ==========================================
   TARJETAS FILTRADAS
========================================== */

.indicador-card.hidden {
    display: none;
}


/* ==========================================
   RESPONSIVE - LAPTOP
========================================== */

@media (max-width: 1200px) {

    .observatorio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .observatorio-tabs {
        margin-bottom: 30px;
    }

    .observatorio-tab {
        padding: 0 14px;
        font-size: 14px;
    }

}


/* ==========================================
   RESPONSIVE - TABLET
========================================== */

@media (max-width: 900px) {

    .observatorio {
        padding: 15px 18px 45px;
    }

    .observatorio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .observatorio-hero-content {
        padding: 27px 24px;
    }

    .observatorio-hero h1 {
        font-size: 29px;
    }

    .observatorio-tabs {
        margin-bottom: 26px;
    }

    .indicador-card {
        min-height: 195px;
        padding: 22px 19px 17px;
    }

}


/* ==========================================
   RESPONSIVE - CELULAR
========================================== */

@media (max-width: 600px) {

    .observatorio {
        padding: 12px 13px 35px;
    }

    .observatorio-hero {
        border-radius: 15px;
        margin-bottom: 18px;
    }

    .observatorio-hero-content {
        padding: 24px 19px;
    }

    .observatorio-tag {
        font-size: 11px;
        margin-bottom: 13px;
    }

    .observatorio-hero h1 {
        font-size: 25px;
        line-height: 1.25;
        letter-spacing: -.6px;
    }

    .observatorio-hero p {
        font-size: 14px;
        line-height: 1.6;
    }


    /* Navegación desplazable */

    .observatorio-tabs {
        border-radius: 14px;
        padding: 6px;
        gap: 3px;
        margin-bottom: 24px;
    }

    .observatorio-tab {
        min-height: 43px;
        padding: 0 14px;
        font-size: 13px;
        border-radius: 11px;
    }


    /* Filtros */

    .observatorio-filtros {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 18px;
        scrollbar-width: none;
    }

    .observatorio-filtros::-webkit-scrollbar {
        display: none;
    }

    .observatorio-filter {
        flex: 0 0 auto;
        min-height: 35px;
        padding: 0 14px;
        font-size: 12px;
    }


    /* Tarjetas */

    .observatorio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .indicador-card {
        min-height: 180px;
        padding: 16px 13px 13px;
        border-radius: 15px;
    }

    .indicador-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 12px;
    }

    .indicador-category {
        font-size: 10px;
        padding: 4px 8px;
    }

    .indicador-variation {
        font-size: 11px;
        padding: 4px 8px;
    }

    .indicador-value {
        font-size: clamp(23px, 6vw, 31px);
        letter-spacing: -1px;
    }

    .indicador-value small {
        font-size: 11px;
    }

    .indicador-card h3 {
        font-size: 12px;
        line-height: 1.4;
    }

    .indicador-footer {
        font-size: 10px;
        padding-top: 11px;
        gap: 4px;
    }

    .indicador-footer i {
        font-size: 9px;
        margin-right: 2px;
    }

}


/* ==========================================
   CELULARES PEQUEÑOS
========================================== */

@media (max-width: 370px) {

    .observatorio-grid {
        grid-template-columns: 1fr;
    }

    .indicador-card {
        min-height: 175px;
        padding: 20px;
    }

    .indicador-top {
        flex-direction: row;
        align-items: center;
    }

    .indicador-value {
        font-size: 34px;
    }

    .indicador-card h3 {
        font-size: 14px;
    }

    .indicador-footer {
        font-size: 12px;
    }

}




/* ==========================================
   CONTENEDORES DE PESTAÑAS
========================================== */

.observatorio-tabs-content {
    width: 100%;
    min-height: 500px;
}

.observatorio-tabs-content .tabs-container {
    width: 100%;
    display: none;
}

/* Animación de entrada */

.observatorio-tabs-content .tabs-container.tab-enter {
    animation: observatorioTabEnter .45s ease both;
}

@keyframes observatorioTabEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
        filter: blur(3px);
    }

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


/* ==========================================
   CONTENIDO EXCLUSIVO
========================================== */

.observatorio-exclusive {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 45px 20px;
    text-align: center;
}

.exclusive-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9edf0;
    color: #203c63;
    border-radius: 20px;
    margin-bottom: 25px;
}

.exclusive-icon i {
    font-size: 29px;
}

.observatorio-exclusive h2 {
    margin: 0 0 12px;
    color: #18283e;
    font-size: 24px;
    font-weight: 750;
    letter-spacing: -.5px;
}

.observatorio-exclusive p {
    max-width: 440px;
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
}


/* ==========================================
   BOTONES DE ACCESO
========================================== */

.exclusive-actions {
    width: 100%;
    max-width: 440px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 35px;
}

.exclusive-btn {
    min-height: 49px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    transition: all .2s ease;
}

.exclusive-btn.primary {
    background: #203c63;
    color: #fff;
}

.exclusive-btn.primary:hover {
    background: #172e4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(32, 60, 99, .18);
}

.exclusive-btn.secondary {
    background: #f8fafc;
    border-color: #dce2e8;
    color: #25364d;
}

.exclusive-btn.secondary:hover {
    background: #edf1f5;
    border-color: #bdc8d4;
    transform: translateY(-2px);
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 600px) {

    .observatorio-tabs-content {
        min-height: 420px;
    }

    .observatorio-exclusive {
        min-height: 440px;
        padding: 30px 16px;
    }

    .exclusive-icon {
        width: 60px;
        height: 60px;
        border-radius: 17px;
    }

    .exclusive-icon i {
        font-size: 25px;
    }

    .observatorio-exclusive h2 {
        font-size: 21px;
    }

    .observatorio-exclusive p {
        font-size: 14px;
    }

    .exclusive-actions {
        max-width: 340px;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 27px;
    }

    .exclusive-btn {
        min-height: 47px;
    }

}


/* Respeta la preferencia de movimiento reducido */

@media (prefers-reduced-motion: reduce) {

    .observatorio-tabs-content .tabs-container.tab-enter {
        animation: none;
    }

    .exclusive-btn {
        transition: none;
    }

}



/* ==========================================
   ANIMACIÓN DE PESTAÑAS
========================================== */

.observatorio-tabs-content .tabs-container {
    display: none;
    width: 100%;
}

.observatorio-tabs-content .tabs-container.tab-enter {
    animation: observatorioContentEnter .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes observatorioContentEnter {

    0% {
        opacity: 0;
        transform: translateY(35px) scale(.985);
    }

    65% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* Animación propia de la tarjeta de acceso */
.observatorio-exclusive .exclusive-icon {
    animation: exclusiveIconEnter .65s cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: .08s;
}

.observatorio-exclusive h2,
.observatorio-exclusive p,
.observatorio-exclusive .exclusive-actions {
    animation: exclusiveDetailsEnter .55s ease both;
}

.observatorio-exclusive h2 {
    animation-delay: .12s;
}

.observatorio-exclusive p {
    animation-delay: .18s;
}

.observatorio-exclusive .exclusive-actions {
    animation-delay: .24s;
}


@keyframes exclusiveIconEnter {
    from {
        opacity: 0;
        transform: translateY(22px) scale(.8);
    }

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

@keyframes exclusiveDetailsEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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


/* SVG */

.exclusive-icon svg {
    display: block;
    width: 32px;
    height: 32px;
}


/* Accesibilidad */

@media (prefers-reduced-motion: reduce) {
    .observatorio-tabs-content .tabs-container.tab-enter,
    .observatorio-exclusive .exclusive-icon,
    .observatorio-exclusive h2,
    .observatorio-exclusive p,
    .observatorio-exclusive .exclusive-actions {
        animation: none !important;
    }
}
