/* ── CMC Energy Futures Grid  [cmc_energy_grid] ──────────────────────────── */

.cmc-eg-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-eg-header {
    padding: 13px 16px 11px;
    direction: rtl;
    border-bottom: 1px solid #f1f5f9;
}

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

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

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

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

/* Each cell */
.cmc-eg-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 = col 1 in RTL grid) get left divider border */
.cmc-eg-cell:nth-child(odd) {
    border-left: 1px solid #f1f5f9;
}

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

/* ── Icon circle (rightmost in RTL flex) ── */

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

.cmc-eg-icon--gas  { background: #1d4ed8; }
.cmc-eg-icon--oil  { background: #1e293b; }
.cmc-eg-icon--fuel { background: #ea580c; }

/* SVGs inside icon circles */
.cmc-eg-ico { fill: rgba(255, 255, 255, 0.92); }
.cmc-eg-ico-inner { fill: rgba(255, 255, 255, 0.35); }

.cmc-eg-ico--flame  { width: 13px; height: 17px; }
.cmc-eg-ico--barrel { width: 14px; height: 18px; }
.cmc-eg-ico--pump   { width: 13px; height: 16px; }

/* ── Label: name + code (flex:1, middle) ── */

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

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

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

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

.cmc-eg-code {
    font-size: 10.5px;
    color: #94a3b8;
    direction: ltr;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
    padding-right: 15px; /* align under name, past the dot + gap */
}

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

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

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

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

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

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

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

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

.cmc-eg-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-eg-link {
    font-size: 12px;
    font-weight: 600;
    color: #4D5B72;
    text-decoration: none;
}

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

.cmc-eg-disclaimer {
    font-size: 10px;
    color: #94a3b8;
}

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

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

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

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

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

    .cmc-eg-meta {
        min-width: 90px;
    }

    .cmc-eg-price { font-size: 17px; }
}
