/**
 * AFROTOOLS — Import Duty Calculator Styles
 * ═══════════════════════════════════════════
 */

/* ── FOUNDATION ── */
.tool-page { background: var(--color-bg, #FAFAF8); min-height: 100vh; }

/* ── HERO ── */
.duty-hero { background: var(--color-bg-dark, #0A1628); padding: 40px 0 36px; border-bottom: 1px solid rgba(0,122,255,0.1); }
.duty-hero .container { max-width: 900px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; color: rgba(255,255,255,0.35); margin-bottom: 12px; }
.breadcrumb a { color: rgba(255,255,255,0.35); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { color: rgba(255,255,255,0.15); }
.duty-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.15; color: #fff; margin-bottom: 10px; letter-spacing: -0.02em; }
.duty-hero h1 em { color: var(--color-primary); font-style: normal; }
.duty-hero-sub { font-size: 0.9rem; font-weight: 400; color: rgba(255,255,255,0.55); line-height: 1.65; max-width: 600px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; }
.badge-green { background: rgba(0,122,255,0.15); color: var(--color-primary); border: 1px solid rgba(0,122,255,0.3); }
.badge-blue { background: rgba(52,152,219,0.15); color: #7ec8e3; border: 1px solid rgba(52,152,219,0.3); }
.badge-grey { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.12); }
.hero-meta { font-size: 0.7rem; font-weight: 400; color: rgba(255,255,255,0.25); margin-top: 10px; }

/* ── LAYOUT ── */
.duty-main { padding: 24px 0 60px; }
.duty-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ── CARD ── */
.card { background: #ffffff; border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,0.05); }
.card-head { padding: 16px 22px; border-bottom: 1px solid #E2E8F0; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #3D5A80; }
.card-sub { font-size: 0.72rem; font-weight: 400; color: #8B9CB8; }
.card-body { padding: 22px; }

/* ── FORM FIELDS ── */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.f-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.f-label-text { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; color: #2D3A5A; }
.f-hint { font-size: 0.72rem; font-weight: 400; color: #8B9CB8; }
.f-wrap { position: relative; display: flex; align-items: center; }
.f-prefix { position: absolute; left: 12px; font-size: 0.85rem; font-weight: 600; color: #8B9CB8; pointer-events: none; z-index: 1; }
.f-input {
  width: 100%; padding: 11px 13px 11px 13px;
  background: #F4F7FA; border: 1.5px solid #CBD5E1; border-radius: 7px;
  font-size: 1rem; font-weight: 600; color: #1E293B; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
}
.f-input:focus { border-color: var(--color-primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,122,255,0.1); }
.f-input.has-prefix { padding-left: 36px; }
.f-note { font-size: 0.7rem; font-weight: 400; color: #8B9CB8; margin-top: 5px; line-height: 1.5; }

/* ── CALC BUTTON ── */
.calc-btn {
  width: 100%; padding: 14px; background: var(--color-primary); color: #fff;
  border: none; border-radius: 7px; font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.03em; cursor: pointer; transition: all 0.18s; margin-top: 6px;
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
}
.calc-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(0,0,0,0.15); }
.calc-btn.secondary { background: #F4F7FA; border: 1.5px solid #CBD5E1; color: #3D5A80; }
.calc-btn.secondary:hover { background: #E8EFF8; border-color: var(--color-brand); }

/* ── RESULTS ── */
.results-card { display: none; }
.results-card.on { display: block; }
.res-hero { background: var(--color-bg-dark, #0A1628); padding: 24px; text-align: center; border-radius: 10px 10px 0 0; }
.res-hero-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.res-hero-amount { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; color: var(--color-primary); letter-spacing: -0.02em; line-height: 1; }
.res-hero-sub { font-size: 0.78rem; color: rgba(255,255,255,0.35); margin-top: 5px; }
.res-body { padding: 20px 22px; }

/* ── BREAKDOWN ROWS ── */
.brk-section { margin-bottom: 14px; }
.brk-title { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8B9CB8; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid #E2E8F0; }
.brk-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.85rem; }
.brk-row + .brk-row { border-top: 1px solid #F1F5F9; }
.brk-lbl { color: #3D5A80; }
.brk-val { font-weight: 700; color: #1E293B; font-variant-numeric: tabular-nums; }
.brk-val.red { color: #c0392b; }
.brk-val.grn { color: var(--color-primary); }
.brk-row.total { border-top: 2px solid #CBD5E1; margin-top: 4px; padding-top: 10px; }
.brk-row.total .brk-lbl { font-weight: 700; color: #1E293B; }
.brk-row.total .brk-val { font-size: 1.05rem; font-weight: 800; }

/* ── CHART ── */
.chart-section { padding: 0 22px 22px; }
.chart-canvas-wrap { position: relative; height: 220px; }

/* ── COMPARE TABLE ── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 10px; }
.compare-table th { text-align: left; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8B9CB8; padding: 8px 10px; border-bottom: 2px solid #E2E8F0; }
.compare-table td { padding: 8px 10px; border-bottom: 1px solid #F1F5F9; font-variant-numeric: tabular-nums; }
.compare-table td:last-child { text-align: right; font-weight: 700; }
.compare-table tr:hover { background: #F4F7FA; }
.compare-table tr.highlight { background: #EFF6FF; }
.compare-table tr.highlight td { font-weight: 700; }

/* ── ACTION BUTTONS ── */
.action-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 22px 22px; }
.act-btn { padding: 10px; font-size: 0.72rem; font-weight: 700; border-radius: 6px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid #CBD5E1; background: #F4F7FA; color: #3D5A80; font-family: var(--font-body, 'DM Sans', system-ui, sans-serif); }
.act-btn:hover { background: #E8EFF8; border-color: var(--color-brand); }

/* ── HS CODE ── */
.hs-section { margin-top: 20px; }
.hs-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.hs-table th { text-align: left; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8B9CB8; padding: 6px 8px; border-bottom: 1.5px solid #E2E8F0; }
.hs-table td { padding: 6px 8px; border-bottom: 1px solid #F1F5F9; }
.hs-table tr:hover { background: #F4F7FA; cursor: pointer; }
.hs-table .code { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 0.78rem; color: var(--color-brand); font-weight: 600; }

/* ── FREIGHT HELPER ── */
.helper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.helper-card { background: #F4F7FA; border: 1px solid #D1D9E6; border-radius: 8px; padding: 16px; }
.helper-card h3 { font-size: 0.8rem; font-weight: 700; color: #2D3A5A; margin-bottom: 10px; }
.helper-result { background: #EFF6FF; border-radius: 6px; padding: 10px; margin-top: 10px; display: none; font-size: 0.85rem; }
.helper-result.on { display: block; }

/* ── TABS ── */
.duty-tabs { display: flex; gap: 4px; background: #F0F5FF; padding: 3px; border-radius: 7px; margin-bottom: 16px; }
.duty-tab { flex: 1; padding: 10px 12px; font-size: 0.75rem; font-weight: 700; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: #8B9CB8; transition: all 0.15s; text-align: center; font-family: var(--font-body, 'DM Sans', system-ui, sans-serif); }
.duty-tab.on { background: #fff; color: var(--color-brand); box-shadow: 0 1px 5px rgba(0,0,0,0.09); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ── SAVED CALCS ── */
.saved-list { max-height: 300px; overflow-y: auto; }
.saved-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #F1F5F9; cursor: pointer; transition: background 0.15s; }
.saved-item:hover { background: #F4F7FA; }
.saved-item-info { font-size: 0.8rem; color: #2D3A5A; }
.saved-item-total { font-size: 0.85rem; font-weight: 700; color: var(--color-brand); }
.saved-item-del { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: #c0392b; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; }
.saved-item-del:hover { background: #fef2f2; }

/* ── FAQ ── */
.faq-sec { padding: 52px 0; background: #fff; border-top: 1px solid #E2E8F0; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.faq-item { padding: 18px 20px; background: #F4F7FA; border: 1px solid #D1D9E6; border-radius: 8px; }
.faq-q { font-size: 0.85rem; font-weight: 700; color: #1E293B; margin-bottom: 7px; line-height: 1.4; }
.faq-a { font-size: 0.82rem; font-weight: 400; color: #3D5A80; line-height: 1.7; }
.eyebrow { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 6px; }
.sec-title { font-size: clamp(1.3rem, 2.5vw, 1.7rem); font-weight: 800; color: #1E293B; letter-spacing: -0.02em; }

/* ── DISCLAIMER ── */
.disclaimer { font-size: 0.71rem; font-weight: 400; color: #8B9CB8; line-height: 1.6; padding: 13px 16px; background: #F4F7FA; border: 1px solid #D1D9E6; border-radius: 8px; margin-top: 16px; }

/* ── PRINT ── */
@media print {
  .duty-hero, .duty-tabs, .action-row, .chart-section, .hs-section,
  .helper-grid, .faq-sec, afro-navbar, afro-footer, .calc-btn,
  .saved-list, .disclaimer { display: none !important; }
  .duty-grid { grid-template-columns: 1fr !important; }
  .results-card { display: block !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff !important; }
}

/* ── DARK MODE ── */
@media (prefers-color-scheme: dark) {
  .tool-page { background: #0B1120; }
  .card { background: #131D2E; border-color: #1E2D40; }
  .card-head { border-color: #1E2D40; }
  .card-title { color: #8B9CB8; }
  .f-label-text { color: #A8B8D0; }
  .f-input { background: #111D30; border-color: #1E2D40; color: #E2E8F0; }
  .f-input:focus { background: #1E293B; }
  .brk-lbl { color: #8B9CB8; }
  .brk-val { color: #E2E8F0; }
  .brk-title { color: #5A6F8A; border-color: #1E2D40; }
  .brk-row + .brk-row { border-color: #1E2D40; }
  .faq-sec { background: #0B1120; border-color: #1E2D40; }
  .faq-item { background: #131D2E; border-color: #1E2D40; }
  .faq-q { color: #E2E8F0; }
  .faq-a { color: #8B9CB8; }
  .helper-card { background: #111D30; border-color: #1E2D40; }
  .helper-card h3 { color: #A8B8D0; }
  .duty-tabs { background: #111D30; }
  .duty-tab { color: #5A6F8A; }
  .duty-tab.on { background: #1E293B; }
  .compare-table th { border-color: #1E2D40; }
  .compare-table td { border-color: #1E2D40; color: #E2E8F0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 880px) {
  .duty-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .helper-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .card-body { padding: 16px; }
  .res-body { padding: 16px; }
  .action-row { grid-template-columns: 1fr 1fr; }
  .duty-tabs { flex-wrap: wrap; }
}
