/* ── CMC Index Futures Grid  [cmc_index_grid] ────────────────────────────── */

.cmc-ig-wrap {
    width: 100%;
    font-family: inherit;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    direction: rtl;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.cmc-ig-header {
    padding: 13px 16px 11px;
    direction: rtl;
    border-bottom: 1px solid #f1f5f9;
}

.cmc-ig-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cmc-ig-title-arr {
    font-size: 16px;
    color: #4D5B72;
    font-weight: 400;
    line-height: 1;
}

/* ── 2-column RTL grid ───────────────────────────────────────────────────── */

.cmc-ig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.cmc-ig-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    direction: rtl;
    min-width: 0;
}

/* Right-column cells (odd in RTL grid) get center divider */
.cmc-ig-cell:nth-child(odd) {
    border-left: 1px solid #f1f5f9;
}

/* Last row: no bottom border */
.cmc-ig-cell:nth-last-child(-n+2) {
    border-bottom: none;
}

/* ── Badge circle ── */

.cmc-ig-badge-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmc-ig-badge-wrap--sp500   { background: #dc2626; }
.cmc-ig-badge-wrap--nasdaq  { background: #0ea5e9; }
.cmc-ig-badge-wrap--dow     { background: #0d9488; }
.cmc-ig-badge-wrap--russell { background: #7c3aed; }
.cmc-ig-badge-wrap--dax     { background: #475569; }
.cmc-ig-badge-wrap--ftse    { background: #2563eb; }

.cmc-ig-badge {
    color: #ffffff;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    direction: ltr;
}

/* Font sizes by badge character count */
.cmc-ig-badge--xl { font-size: 15px; }
.cmc-ig-badge--lg { font-size: 13px; }
.cmc-ig-badge--md { font-size: 11px; }
.cmc-ig-badge--sm { font-size: 9px; }

/* ── Label: name + code ── */

.cmc-ig-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    text-align: right;
}

.cmc-ig-nameline {
    display: flex;
    align-items: center;
    gap: 7px;
    direction: rtl;
}

.cmc-ig-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f97316;
}

.cmc-ig-name {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cmc-ig-code {
    font-size: 10.5px;
    color: #94a3b8;
    direction: ltr;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
    padding-right: 15px;
}

/* ── Meta: price + change (leftmost in RTL flex) ── */

.cmc-ig-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
    min-width: 110px;
}

.cmc-ig-priceline {
    display: flex;
    align-items: baseline;
    gap: 4px;
    direction: ltr;
    flex-wrap: wrap;
}

.cmc-ig-price {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    direction: ltr;
    white-space: nowrap;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.cmc-ig-unit {
    font-size: 9.5px;
    font-weight: 400;
    color: #64748b;
    direction: ltr;
    white-space: nowrap;
}

.cmc-ig-chg {
    font-size: 12px;
    font-weight: 700;
    direction: ltr;
    white-space: nowrap;
    margin-top: 3px;
}

.cmc-ig-chg--pos { color: #16a34a; }
.cmc-ig-chg--neg { color: #dc2626; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.cmc-ig-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    direction: rtl;
    flex-wrap: wrap;
    gap: 8px;
}

.cmc-ig-link {
    font-size: 12px;
    font-weight: 600;
    color: #4D5B72;
    text-decoration: none;
    white-space: nowrap;
}

.cmc-ig-link:hover { color: #1e293b; text-decoration: underline; }

.cmc-ig-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ── Responsive: single column on narrow screens ─────────────────────────── */

@media (max-width: 600px) {
    .cmc-ig-grid {
        grid-template-columns: 1fr;
    }

    .cmc-ig-cell:nth-child(odd) {
        border-left: none;
    }

    .cmc-ig-cell:nth-last-child(-n+2) {
        border-bottom: 1px solid #f1f5f9;
    }

    .cmc-ig-cell:last-child {
        border-bottom: none;
    }

    .cmc-ig-price { font-size: 17px; }
    .cmc-ig-meta  { min-width: 90px; }
}
