
/* ================================================================
   ADVANCE FINANCIAL — MARKET DATA COMPONENTS
   Datos dinámicos cargados desde /api/market-data.php
   ================================================================ */

.market-ticker {
    position: relative;
    z-index: 25;
    min-height: 40px;
    overflow: hidden;
    background: #0d0d0d;
    border-bottom: 1px solid #2d2d2d;
}

.market-ticker__track {
    display: flex;
    align-items: center;
    min-height: 40px;
    width: max-content;
    gap: 0;
    animation: af-market-scroll 48s linear infinite;
}

.market-ticker:hover .market-ticker__track {
    animation-play-state: paused;
}

.market-ticker__item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 22px;
    border-right: 1px solid #292929;
    white-space: nowrap;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: .72rem;
}

.market-ticker__label {
    color: #8c8c8c;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.market-ticker__value {
    color: #fdfdfd;
}

.market-ticker__change {
    color: #8c8c8c;
}

.market-ticker__change.is-up { color: #75923C; }
.market-ticker__change.is-down { color: #a86767; }

.market-ticker__status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 22px;
    color: #666;
    font-size: .68rem;
    white-space: nowrap;
}

.market-ticker__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #75923C;
}

@keyframes af-market-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Market intelligence section */
.market-intelligence {
    padding: 90px 0 96px;
    background: #141414;
    border-top: 1px solid #303030;
    border-bottom: 1px solid #303030;
}

.market-intelligence__header {
    display: grid;
    grid-template-columns: .78fr 1.22fr;
    gap: 70px;
    align-items: start;
    margin-bottom: 46px;
}

.market-intelligence__header .eyebrow {
    display: block;
    margin-bottom: 17px;
}

.market-intelligence__header h2 {
    max-width: 560px;
    margin: 0;
    font-size: clamp(2.15rem, 3vw, 3rem);
    line-height: 1.03;
}

.market-intelligence__intro {
    padding-top: 6px;
}

.market-intelligence__intro p {
    max-width: 700px;
    color: #bdbdbd;
    line-height: 1.72;
    margin: 0 0 12px;
}

.market-intelligence__updated {
    color: #666;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: .7rem;
    letter-spacing: .04em;
}

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

.market-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    padding: 26px 25px 24px;
    background: #1d1d1d;
    border: 1px solid #343434;
}

.market-card__top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 27px;
}

.market-card__label {
    color: #bcbcbc;
    font-size: .79rem;
    line-height: 1.4;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.market-card__source {
    color: #666;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: .63rem;
    text-align: right;
}

.market-card__value {
    margin: auto 0 10px;
    color: #fdfdfd;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: clamp(1.7rem, 2.2vw, 2.25rem);
    line-height: 1;
}

.market-card__change {
    min-height: 18px;
    color: #777;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: .72rem;
}

.market-card__change.is-up { color: #75923C; }
.market-card__change.is-down { color: #a86767; }

.market-card__date {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #303030;
    color: #686868;
    font-size: .67rem;
}

.market-card.is-unavailable .market-card__value {
    color: #777;
    font-family: "Neue Haas Grotesk Text", "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
}

.market-intelligence__legal {
    max-width: 900px;
    margin: 30px 0 0;
    color: #626262;
    font-size: .72rem;
    line-height: 1.55;
}

/* Manual refresh control */
.market-refresh {
    appearance: none;
    border: 0;
    background: none;
    color: #75923C;
    padding: 0;
    margin-left: 10px;
    font: inherit;
    cursor: pointer;
}

.market-refresh:hover {
    color: #8ca856;
}

@media (max-width: 1100px) {
    .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .market-intelligence__header {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .market-ticker__track { animation-duration: 38s; }
    .market-intelligence { padding: 72px 0; }
    .market-grid { grid-template-columns: 1fr; }
    .market-card { min-height: 160px; }
}
