@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
         url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
body, h1, h2, h3, h4, h5, h6, p, a, div, span, input, button, select, textarea, label, code, td, th {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

/* =========================================================
   توکن‌ها (هماهنگ با صفحات آمار / قیمت پایه صادراتی)
   ========================================================= */
:root {
    --primary: #2563eb; --primary-hover: #1d4ed8; --primary-soft: #eff6ff; --primary-soft-border: #bfdbfe;
    --success: #15803d; --success-soft: #f0fdf4; --success-soft-border: #bbf7d0;
    --danger: #dc2626; --danger-soft: #fef2f2; --danger-soft-border: #fecaca;
    --warning: #b45309; --warning-soft: #fffbeb; --warning-soft-border: #fde68a;
    --secondary: #64748b; --bg-main: #f8fafc; --bg-box: #ffffff;
    --text-main: #1e293b; --text-muted: #64748b; --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    --radius: 10px; --radius-sm: 6px; --transition: all 0.2s ease;
    --fs-xs: 0.8125rem; --fs-sm: 0.9375rem; --fs-base: 1rem; --fs-md: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-2xl: 1.75rem;
    --fw-regular: 400; --fw-medium: 600; --fw-bold: 700;
}
body { background-color: var(--bg-main); color: var(--text-main); }
.icon { width: 1.2em; height: 1.2em; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.is-hidden { display: none !important; }

.cc-page { max-width: 1300px; margin: 30px auto 60px; padding: 0 15px; }

/* ---------- هیرو ---------- */
.cc-hero {
    position: relative; overflow: hidden; border-radius: var(--radius); padding: 40px 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); box-shadow: var(--shadow-md);
}
.cc-hero__decor {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 88% -15%, rgba(255,255,255,0.16) 0%, transparent 55%),
                radial-gradient(circle at -10% 115%, rgba(255,255,255,0.12) 0%, transparent 45%);
}
.cc-hero__content { position: relative; max-width: 780px; }
.cc-hero__badge {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.16); color: #fff;
    border: 1px solid rgba(255,255,255,0.28); border-radius: 50rem; padding: 5px 14px; font-size: var(--fs-xs); font-weight: var(--fw-medium); margin-bottom: 16px;
}
.cc-hero__badge .icon { width: 13px; height: 13px; }
.cc-hero__title { margin: 0 0 10px; color: #fff; font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.cc-hero__subtitle { margin: 0; color: rgba(255,255,255,0.88); font-size: var(--fs-sm); line-height: 1.9; }

/* ---------- چیدمان ---------- */
.cc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; margin-top: 24px; align-items: start; }
.cc-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cc-results { position: sticky; top: 90px; }

/* ---------- کارت ---------- */
.cc-card { background: var(--bg-box); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.cc-card__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-color); }
.cc-card__head--results { justify-content: space-between; align-items: center; }
.cc-card__title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-main); }
.cc-card__subtitle { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.7; }
.cc-step {
    width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: var(--fw-bold); font-size: var(--fs-sm); flex-shrink: 0; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* ---------- فرم ---------- */
.cc-grid { display: grid; gap: 16px; }
.cc-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-field--full { grid-column: 1 / -1; }
.cc-field label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-main); }
.cc-required { color: var(--danger); }
.cc-hint { font-size: 12px; color: var(--text-muted); line-height: 1.6; min-height: 1em; }
.cc-input {
    width: 100%; padding: 11px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: var(--fs-sm);
    background: var(--bg-main); color: var(--text-main); transition: var(--transition); font-variant-numeric: tabular-nums;
}
.cc-input:focus { outline: none; border-color: var(--primary); background: var(--bg-box); box-shadow: 0 0 0 4px var(--primary-soft); }
.cc-input-group { display: flex; align-items: stretch; }
.cc-input-group .cc-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.cc-input-group__unit, .cc-input-group__select, .cc-input-group__btn {
    display: flex; align-items: center; padding: 0 12px; border: 2px solid var(--border-color); border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--bg-box); color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap;
}
.cc-input-group__select { cursor: pointer; }
.cc-input-group__btn { cursor: pointer; color: var(--primary); font-weight: var(--fw-medium); transition: var(--transition); }
.cc-input-group__btn:hover { background: var(--primary-soft); }

/* جستجوی تعرفه */
.cc-search { position: relative; margin-bottom: 14px; }
.cc-search .cc-input { padding-right: 42px; }
.cc-search__icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 18px; height: 18px; }
.cc-search__results {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 50; background: var(--bg-box); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 340px; overflow-y: auto;
}
.cc-search__item {
    width: 100%; display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; text-align: right;
    background: none; border: none; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: var(--transition);
}
.cc-search__item:last-child { border-bottom: none; }
.cc-search__item:hover { background: var(--primary-soft); }
.cc-search__item code { font-family: 'Courier New', monospace !important; direction: ltr; text-align: left; color: var(--primary); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.cc-search__item-title { font-size: var(--fs-xs); color: var(--text-main); line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-search__item-tariff { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.cc-search__empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: var(--fs-xs); }

.cc-selected { background: var(--primary-soft); border: 1px solid var(--primary-soft-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.cc-selected__main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-selected__code { font-family: 'Courier New', monospace !important; direction: ltr; color: var(--primary); font-weight: var(--fw-bold); font-size: var(--fs-md); }
.cc-selected__title { font-size: var(--fs-sm); color: var(--text-main); }
.cc-selected__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cc-chip { display: inline-flex; align-items: center; font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--bg-box); border: 1px solid var(--border-color); color: var(--text-muted); }
.cc-chip--primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: var(--fw-medium); }
.cc-chip--warning { background: var(--warning-soft); border-color: var(--warning-soft-border); color: var(--warning); }

/* سوییچ‌ها */
.cc-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cc-toggle { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-xs); color: var(--text-main); transition: var(--transition); background: var(--bg-main); }
.cc-toggle:hover { border-color: var(--primary-soft-border); }
.cc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cc-toggle__box { width: 36px; height: 20px; border-radius: 20px; background: #cbd5e1; position: relative; flex-shrink: 0; transition: var(--transition); }
.cc-toggle__box::after { content: ''; position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: var(--transition); }
.cc-toggle input:checked + .cc-toggle__box { background: var(--primary); }
.cc-toggle input:checked + .cc-toggle__box::after { transform: translateX(-16px); }
.cc-toggle input:focus-visible + .cc-toggle__box { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- نتایج ---------- */
.cc-card--results { padding: 20px 22px; }
.cc-btn-icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-box); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.cc-btn-icon:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.cc-btn-icon:disabled { opacity: .4; cursor: default; }
.cc-empty { text-align: center; padding: 30px 10px; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.8; }
.cc-empty__icon { width: 56px; height: 56px; color: var(--primary-soft-border); margin-bottom: 8px; }
.cc-error { background: var(--danger-soft); border: 1px solid var(--danger-soft-border); color: var(--danger); border-radius: var(--radius-sm); padding: 12px 14px; font-size: var(--fs-xs); line-height: 1.7; }

.cc-total { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); color: #fff; border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }
.cc-total__label { font-size: var(--fs-xs); opacity: .9; }
.cc-total__value { font-size: 1.85rem; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; direction: ltr; text-align: right; line-height: 1.2; }
.cc-total__value small { font-size: var(--fs-xs); font-weight: var(--fw-regular); opacity: .85; }
.cc-total__sub { font-size: 12px; opacity: .85; }

.cc-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.cc-summary__tile { background: var(--bg-main); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cc-summary__tile span { font-size: 12px; color: var(--text-muted); }
.cc-summary__tile strong { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; direction: ltr; text-align: right; color: var(--text-main); }

.cc-notes { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cc-notes__item { background: var(--warning-soft); border: 1px solid var(--warning-soft-border); color: var(--warning); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; line-height: 1.7; }

.cc-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.cc-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.cc-table th { background: var(--bg-main); color: var(--text-muted); font-weight: var(--fw-medium); padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.cc-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.cc-table tr:last-child td { border-bottom: none; }
.cc-table__formula { color: var(--text-muted); font-size: 11.5px; }
.cc-table__amount { font-variant-numeric: tabular-nums; direction: ltr; text-align: right; font-weight: var(--fw-medium); white-space: nowrap; }
.cc-row--base td { color: var(--text-muted); }
.cc-row--base .cc-table__amount { font-weight: var(--fw-regular); }
.cc-row--cif td { background: var(--primary-soft); color: var(--text-main); font-weight: var(--fw-medium); }
.cc-row--total td { background: var(--success-soft); color: var(--success); font-weight: var(--fw-bold); border-top: 2px solid var(--success-soft-border); }
.cc-disclaimer { margin: 14px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.8; }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 1024px) {
    .cc-layout { grid-template-columns: 1fr; }
    .cc-results { position: static; }
}
@media (max-width: 640px) {
    .cc-hero { padding: 28px 20px; }
    .cc-card { padding: 18px 16px; }
    .cc-grid--2, .cc-toggles, .cc-summary { grid-template-columns: 1fr; }
    .cc-search__item { grid-template-columns: 84px 1fr; }
    .cc-search__item-tariff { grid-column: 1 / -1; }
}

/* ---------- چاپ ---------- */
@media print {
    header, footer, nav, .cc-hero, .cc-form, .cc-btn-icon, .cc-empty { display: none !important; }
    .cc-page { margin: 0; padding: 0; max-width: none; }
    .cc-layout { display: block; }
    .cc-results { position: static; }
    .cc-card { box-shadow: none; border: none; }
    .cc-total { background: none !important; color: var(--text-main); box-shadow: none; border: 1px solid var(--border-color); }
}
