/* ══════════════════════════════════════════════════════════════════
   BRAND MODAL — shared "Forged by …" popup.
   Identical to the Custom Katana product modal: forge story + a
   "How <brand> compares" table with Price·Lead-time / Features tabs.
   Desktop = centered card; mobile (≤520) = bottom sheet with a sticky
   header and the compare rows collapsed into stacked cards.
   Driven by js/brand-modal.js + window.CKP_PFD.
   ══════════════════════════════════════════════════════════════════ */
@keyframes ckpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ckpRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ckpSheetUp { from { transform: translateY(100%); } to { transform: none; } }

.ckp-bmodal-overlay {
  position: fixed; inset: 0; z-index: 9998; background: rgba(12, 14, 18, .45);
  display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  animation: ckpFade 160ms ease;
}
.ckp-bmodal-overlay[hidden] { display: none; }
/* one dialog per brand, the tab not shown - the mobile sheet's display: flex tables would show anyway */
.ckp-bmodal[hidden], .ckp-cmp-table[hidden] { display: none !important; }
.ckp-bmodal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 860px;
  max-height: 86vh; overflow: auto; box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
  animation: ckpRise 220ms ease;
}
.ckp-bmodal-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; background: #fff; }
.ckp-bmodal-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.ckp-bmodal-name { font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; color: var(--ink-900); }
.ckp-bmodal-where { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; margin-top: 4px; }
.ckp-bmodal-close { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-900); flex-shrink: 0; }
.ckp-bmodal-body { padding: 24px; }
.ckp-bmodal-body p { font-size: 15px; line-height: 1.65; color: var(--ink-800); margin: 0 0 4px; }
.ckp-bmodal-body p:first-child { margin-bottom: 14px; }
.ckp-bmodal-body p strong { color: var(--ink-900); font-weight: 600; }

.ckp-cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; margin-bottom: 12px; flex-wrap: wrap; }
.ckp-cmp-title { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; }
.ckp-cmp-seg { display: inline-flex; background: #f5f5f4; border-radius: 10px; padding: 4px; }
.ckp-cmp-seg button { padding: 6px 12px; border-radius: 8px; border: none; background: transparent; font-family: var(--font-ui); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink-700); }
.ckp-cmp-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); color: var(--ink-900); }
.ckp-cmp-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ckp-cmp-row { display: grid; gap: 10px; align-items: center; padding: 14px 16px; font-size: 13px; color: var(--ink-800); border-top: 1px solid var(--border); position: relative; }
.ckp-cmp-row.is-head { padding: 12px 16px; background: #f5f5f4; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-tertiary); font-weight: 600; border-top: none; }
.ckp-cmp-row.is-active { background: #fdf4ef; }
.ckp-cmp-row.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-500, #c85a3b); }
.ckp-cmp-row .cmp-brand { font-weight: 500; color: var(--ink-900); }
.ckp-cmp-row.is-active .cmp-brand { font-weight: 600; }
.ckp-cmp-row.is-active span:not(.cmp-brand) { font-weight: 500; color: var(--ink-900); }
.ckp-cmp-cell-label { display: none; }

@media (max-width: 960px) {
  .ckp-bmodal-name { font-size: 24px; }
}
@media (max-width: 720px) {
  .ckp-bmodal-overlay { padding: 20px 14px; }
  .ckp-bmodal-body { padding: 20px; }
  .ckp-bmodal-head { padding: 16px 18px; }
}
@media (max-width: 520px) {
  .ckp-cmp-seg button { flex: 1; }
  /* Bottom sheet */
  .ckp-bmodal-overlay { align-items: flex-end; justify-content: stretch; padding: 0; }
  .ckp-bmodal { max-width: none; width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0; animation: ckpSheetUp 260ms cubic-bezier(.22, .61, .36, 1); }
  .ckp-bmodal::before { display: none; }
  .ckp-bmodal-head { padding: 20px 18px 14px; }
  .ckp-bmodal-head::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); }
  .ckp-cmp-seg { width: 100%; }
  /* Compare table → stacked cards */
  .ckp-cmp-table { border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 10px; background: transparent; }
  .ckp-cmp-row.is-head { display: none; }
  .ckp-cmp-row { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; gap: 6px 16px; }
  .ckp-cmp-row::before { display: none; }
  .ckp-cmp-row.is-active { background: #fdf4ef; border-color: var(--accent-500, #c85a3b); }
  .ckp-cmp-row .cmp-brand { grid-column: 1 / -1; font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
  .ckp-cmp-cell { color: var(--ink-800); font-size: 14px; }
  .ckp-cmp-cell-label { display: block !important; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-tertiary) !important; font-weight: 600 !important; margin-bottom: 3px; }
  .ckp-cmp-row--price { grid-template-columns: 1fr 1fr !important; }
  .ckp-cmp-row--features { grid-template-columns: 1fr !important; gap: 10px; }
  .ckp-cmp-row--features .ckp-cmp-cell { display: grid; grid-template-columns: 96px 1fr; align-items: baseline; }
  .ckp-cmp-row--features .ckp-cmp-cell-label { margin-bottom: 0; }
}
