/* =====================================================================
   Metal Next Bazar - components used on inner pages
   Loaded after style.css and reuses the same tokens.
   ===================================================================== */

/* ---------- Rate table -------------------------------------------- */
.rate-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.rate-table thead th {
    text-align: left;
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg-sunk);
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.rate-table tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    font-size: .93rem;
    vertical-align: middle;
}
.rate-table tbody tr:last-child td { border-bottom: 0; }
.rate-table tbody tr { transition: background .2s var(--ease); }
.rate-table tbody tr:hover { background: var(--bg-soft); }
.rate-table b { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

.rate-table__name { display: inline-flex; align-items: center; gap: 11px; }
.rate-table__icon {
    width: 36px; height: 36px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    flex: none;
}
.rate-table__icon svg { width: 18px; height: 18px; color: var(--brand); }

/* Light-theme trend chips need their own colours on white */
:root .trend--up   { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
:root .trend--down { color: var(--danger);  background: color-mix(in srgb, var(--danger) 12%, transparent); }
:root .trend--flat { color: var(--steel);   background: color-mix(in srgb, var(--steel) 12%, transparent); }
.hero .trend--up, .rate-panel .trend--up   { color: #34D399; background: rgba(52, 211, 153, .14); }
.hero .trend--down, .rate-panel .trend--down { color: #F87171; background: rgba(248, 113, 113, .14); }
.hero .trend--flat, .rate-panel .trend--flat { color: #94A3B8; background: rgba(148, 163, 184, .14); }

/* ---------- Rate hero (material detail page) ---------------------- */
.rate-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    margin-bottom: 30px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-lg);
}
.rate-hero__icon {
    width: 60px; height: 60px;
    border-radius: 17px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand) 0%, var(--brand-strong) 100%);
    flex: none;
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 80%, transparent);
}
.rate-hero__icon svg { width: 27px; height: 27px; color: #fff; }
.rate-hero__label {
    display: block;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 4px;
}
.rate-hero__value {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.035em;
    color: var(--ink);
    line-height: 1.15;
}
.rate-hero__unit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--muted);
    margin-top: 5px;
}

/* ---------- Side card --------------------------------------------- */
.side-card {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.side-card h3 { font-size: 1.08rem; margin-bottom: 16px; }

.side-rate {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line-strong);
}
.side-rate:last-of-type { border-bottom: 0; }
.side-rate__icon {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--bg-sunk);
    flex: none;
}
.side-rate__icon svg { width: 16px; height: 16px; color: var(--brand); }
.side-rate__name { flex: 1; min-width: 0; line-height: 1.3; }
.side-rate__name strong { display: block; font-size: .88rem; color: var(--ink); font-weight: 600; }
.side-rate__name span { font-size: .74rem; color: var(--muted); }
.side-rate__price {
    font-family: var(--font-display);
    font-size: .82rem;
    font-weight: 700;
    color: var(--brand);
    white-space: nowrap;
    flex: none;
}
.side-rate:hover .side-rate__name strong { color: var(--brand); }

/* ---------- Mini stats -------------------------------------------- */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 18px;
    margin: 28px 0;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.mini-stat b {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--brand);
    line-height: 1.1;
}
.mini-stat span { font-size: .82rem; color: var(--muted); }

/* ---------- Chips (blog category filter) -------------------------- */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 34px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 17px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-size: .87rem;
    font-weight: 500;
    transition: all .2s var(--ease);
}
.chip span {
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-sunk);
    color: var(--muted);
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.is-active span { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Empty state ------------------------------------------- */
.empty-state {
    text-align: center;
    padding: clamp(38px, 6vw, 68px) 26px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-xl);
}
.empty-state__icon {
    width: 62px; height: 62px;
    margin: 0 auto 20px;
    border-radius: 19px;
    display: grid; place-items: center;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
}
.empty-state__icon svg { width: 28px; height: 28px; color: var(--brand); }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); max-width: 460px; margin-inline: auto; margin-bottom: 22px; }

/* ---------- FAQ ---------------------------------------------------- */
.faq { max-width: 800px; margin: 0 auto; }
.faq__item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 11px;
    overflow: hidden;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.faq__item[open] { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 21px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__chev {
    width: 18px; height: 18px;
    flex: none;
    color: var(--brand);
    transition: transform .28s var(--ease);
}
.faq__item[open] .faq__chev { transform: rotate(90deg); }
.faq__item p {
    padding: 0 21px 19px;
    margin: 0;
    color: var(--muted);
    font-size: .94rem;
}

/* ---------- Contact ------------------------------------------------ */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: 26px;
    align-items: start;
}
.contact-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 3vw, 34px);
    box-shadow: var(--shadow-sm);
}
.contact-card h2 { font-size: 1.4rem; margin-bottom: 20px; }
.contact-card--tight { padding: 26px; margin-bottom: 22px; }

.contact-list { list-style: none; padding: 0; margin: 0 0 22px; }
.contact-list li {
    display: flex;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px dashed var(--line-strong);
}
.contact-list li:last-child { border-bottom: 0; }
.contact-list__icon {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    flex: none;
}
.contact-list__icon svg { width: 18px; height: 18px; color: var(--brand); }
.contact-list li > span:last-child { font-size: .92rem; color: var(--ink-2); line-height: 1.5; }
.contact-list b {
    display: block;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.map-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-sunk);
    aspect-ratio: 4 / 3;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-frame--empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 30px;
    border-style: dashed;
}
.map-frame--empty .empty-state__icon { margin-bottom: 14px; }

/* ---------- Post CTA ----------------------------------------------- */
.post-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 34px;
    padding: 26px;
    border-radius: var(--radius-lg);
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
}
.post-cta h3 { font-size: 1.14rem; margin-bottom: 5px; }
.post-cta p { color: var(--muted); font-size: .92rem; }

/* ---------- Responsive --------------------------------------------- */
@media (max-width: 940px) {
    .contact-grid { grid-template-columns: 1fr; }
    .side-card { position: static; }
}

@media (max-width: 620px) {
    .rate-hero { flex-direction: column; align-items: flex-start; text-align: left; }
    .post-cta { flex-direction: column; align-items: stretch; }
    .post-cta .btn { width: 100%; }
}
