/* NNomadic — curated package discovery.
 *
 * Adds ONLY what css/site.css and marketplace/marketplace.css do not already provide.
 * Both are loaded ahead of this file by Chrome::head(), so the results layout
 * (.mk-results-layout, .mk-filters, .mk-filters-shell, .mk-fs, .mk-opts, .mk-opt,
 * .mk-chip, .mk-empty, .mk-sr, .mk-agent-cta, .mk-photo-blank, .mk-card-pin) and the
 * site's own .field, .chips, .card, .btn-*, .pkg-includes, .trust, .band and .wrap are
 * reused as they stand. Nothing here redefines a brand token or an existing class.
 *
 * Breakpoints match the site exactly: 1180 / 1080 / 900 / 720, plus a 420 tightening so
 * that nothing overflows at 400px. Below 900 the filter panel becomes a drawer.
 *
 * There is no price rule to state for this file because there is no price on this page:
 * no selector below styles a figure, a currency or a "from" — the only commercial slot
 * is .pk-priceless, which carries the snapshot's `priceDisplay` sentence.
 */

/* ── hero: search summary and the modify-search panel ─────────────────────────── */

.pk-hero .hero-inner { padding-bottom: 46px; }
.pk-hero h1 { font-size: clamp(30px, 3.6vw, 50px); margin: 18px 0 12px; }
.pk-hero p.lead { margin-bottom: 20px; }

.pk-summary {
  max-width: 900px; padding: 16px 18px; border-radius: 16px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.16);
}
.pk-summarychips { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0 0 12px; padding: 0; }
.pk-summary-none { margin: 0 0 12px; font-size: 13px; color: #B9C2E4; }

/* The chips are the marketplace chip with a label above the value, because a value on
   its own ("Japan", "October 2026") does not say which field it came out of. */
.pk-chip { flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 13px; line-height: 1.25; }
.pk-chip-group { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-light); }
.pk-chip:hover .pk-chip-group { color: #fff; }
.pk-summarychips .mk-chip.is-clear { border-color: rgba(255,255,255,0.4); color: #C3D4E6; align-self: center; }
.pk-summarychips .mk-chip.is-clear:hover { border-color: #fff; color: #fff; }

.pk-modify { border-top: 1px solid rgba(255,255,255,0.16); padding-top: 12px; }
.pk-modify > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-family: Sora, serif; font-size: 13.5px; font-weight: 600; color: #fff;
}
.pk-modify > summary::-webkit-details-marker { display: none; }
.pk-modify > summary:hover { color: var(--teal-light); }
.pk-modify > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 6px; }
.pk-modify-caret { font-size: 11px; color: var(--teal-light); transition: transform .15s ease; }
.pk-modify[open] .pk-modify-caret { transform: rotate(180deg); }

.pk-modify-form { margin-top: 14px; }
.pk-modify-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1.1fr)) repeat(2, minmax(0, 0.6fr)) auto;
  gap: 10px; align-items: end;
}
.pk-modify-grid .field > span { color: var(--teal-light); }
.pk-modify-grid .field input, .pk-modify-grid .field select { padding: 12px 11px; font-size: 13.5px; }
.pk-modify-go { padding: 14px 20px; font-size: 13.5px; white-space: nowrap; }
.pk-modify-note { color: #B9C2E4; }
.pk-modify-note a { color: var(--teal-light); font-weight: 700; }

/* ── filter sidebar ───────────────────────────────────────────────────────────── */

.pk-filters-shell .mk-opts { max-height: 272px; overflow-y: auto; overscroll-behavior: contain; }
.pk-fs-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* An option that would return nothing stays on the page and says so, rather than
   disappearing and leaving the visitor to wonder whether they mis-read the list. */
.mk-opt.is-dead { color: #9AA4B6; cursor: not-allowed; }
.mk-opt.is-dead:hover { background: transparent; }
.mk-opt.is-dead input { cursor: not-allowed; }
.mk-opt.is-dead > b { color: #B6BFCE; }
.mk-opt.is-dead > span { text-decoration: line-through; text-decoration-color: #D3DAE5; }
.pk-filter-form select option:disabled { color: #9AA4B6; }

.pk-filter-actions { margin-top: 18px; }

/* ── results head ─────────────────────────────────────────────────────────────── */

.pk-sort { display: flex; align-items: flex-end; gap: 8px; }
.pk-sort .field { min-width: 205px; }
.pk-sort-go { white-space: nowrap; }
/* packages.js submits on change; the button stays as the no-JS path. */
.pk-sort-go.is-quiet { opacity: 0.7; }
.pk-sort-go.is-quiet:hover { opacity: 1; }

.pk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pk-list-foot { margin: 22px 0 0; font-size: 13px; color: var(--muted); }

/* ── package card ─────────────────────────────────────────────────────────────── */

.pk-card {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 232px; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.pk-card-photo {
  display: block; position: relative; min-height: 236px;
  background-position: center; background-size: cover;
}
.pk-card-photo:focus-visible { outline: 2px solid var(--teal); outline-offset: -4px; }

.pk-card-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pk-card-body h3 { font-size: 19px; line-height: 1.28; margin: 0; }
.pk-card-body h3 a { color: var(--navy); }
.pk-card-body h3 a:hover { color: var(--ember); }

.pk-card-route {
  margin: 0; font-family: Sora, serif; font-size: 13px; font-weight: 600;
  line-height: 1.5; color: var(--teal-ink); text-wrap: pretty;
}
.pk-card-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px;
  margin: 0; font-size: 12.5px; color: var(--muted);
}
.pk-card-meta b { font-family: Sora, serif; font-size: 13px; font-weight: 600; color: var(--navy); }
.pk-card-meta > span[aria-hidden] { color: #C3CEDE; }

.pk-card-styles { margin-top: 1px; }
.pk-stylechip {
  padding: 5px 10px; border-radius: 7px; background: var(--bg);
  font-size: 11px; font-weight: 700; color: #46608B;
}
.pk-stylechip:hover { background: var(--navy); color: #fff; }
.pk-stylechip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.pk-card-incl { margin-top: 2px; }
.pk-card-incl li { font-size: 12.5px; }

.pk-card-side {
  padding: 20px 22px; border-left: 1px solid var(--line-soft); background: #FBFCFE;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}

/* The only commercial line on the card: the snapshot's own priceDisplay sentence,
   given the visual weight the marketplace gives a price so the card does not read as
   though something is missing. */
.pk-priceless {
  margin: 10px 0 2px; font-family: Sora, serif; font-size: 14px; font-weight: 600;
  line-height: 1.42; color: var(--navy); text-wrap: pretty;
}
.pk-card-go { margin-top: auto; }

.pk-card-save { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.pk-save { font-family: Sora, serif; font-size: 13px; font-weight: 600; color: var(--navy); }
.pk-save:hover { color: var(--ember); }
.pk-save:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.pk-save-hint { font-size: 11px; color: var(--faint); }

/* ── empty state ──────────────────────────────────────────────────────────────── */

.pk-empty h2 { margin: 0; font-size: 21px; }
.pk-empty-note { font-size: 12.5px; color: var(--faint); margin: 2px 0 0; }

/* ── drawer trigger (packages.js) ─────────────────────────────────────────────── */

/* Without script the filter panel is an open <details> at every width and the button
   below never exists. With script, and only below 900px, the panel collapses and this
   button opens it — one tap instead of a long scroll past the filters to the results. */
.pk-drawer-btn { display: none; }
.pk-filters.is-drawer .pk-drawer-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font-family: Sora, serif; font-size: 13.5px;
  font-weight: 600; cursor: pointer;
}
.pk-filters.is-drawer .pk-drawer-btn:hover { border-color: var(--navy); }
.pk-filters.is-drawer .pk-drawer-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.pk-drawer-count {
  min-width: 22px; padding: 2px 8px; border-radius: 99px;
  background: var(--teal-ink); color: #fff; font-size: 11.5px; font-weight: 700;
}
.pk-filters.is-drawer .pk-filters-shell > summary { border-top: 1px solid var(--line-soft); }

/* ── responsive · 1180 / 1080 / 900 / 720 / 420 ───────────────────────────────── */

@media (max-width: 1180px) {
  .pk-card { grid-template-columns: 210px minmax(0, 1fr) 212px; }
  .pk-modify-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pk-modify-go { grid-column: span 3; }
}

@media (max-width: 1080px) {
  .pk-filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
  .pk-filter-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 18px; }
  .pk-filter-actions .btn { width: auto; display: inline-block; }
  .pk-filters-shell .mk-opts { max-height: none; }
}

@media (max-width: 900px) {
  .pk-summary { max-width: none; }
  .pk-modify-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-modify-go { grid-column: span 2; }
  .pk-card { grid-template-columns: 180px minmax(0, 1fr); }
  .pk-card-photo { min-height: 190px; }
  .pk-card-side {
    grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line-soft);
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  }
  .pk-priceless { margin: 0; }
  .pk-card-go { margin-top: 0; margin-left: auto; }
  .pk-card-save { flex-direction: row; align-items: baseline; gap: 8px; margin-top: 0; }
}

@media (max-width: 720px) {
  .pk-filter-form { grid-template-columns: minmax(0, 1fr); }
  .pk-filter-actions { flex-direction: column; align-items: stretch; }
  .pk-filter-actions .btn { width: 100%; display: block; }
  .pk-modify-grid { grid-template-columns: minmax(0, 1fr); }
  .pk-modify-go { grid-column: auto; width: 100%; }
  .pk-card { grid-template-columns: minmax(0, 1fr); }
  .pk-card-photo { min-height: 168px; }
  .pk-card-body { padding: 18px; }
  .pk-card-side { padding: 16px 18px; }
  .pk-card-go { margin-left: 0; width: 100%; }
  .pk-sort { width: 100%; }
  .pk-sort .field { flex: 1; min-width: 0; }
}

/* Below 420 the only things that could push the page wider than the viewport are the
   chip rows and the route line; both wrap, and the summary panel loses its inset. */
@media (max-width: 420px) {
  .pk-summary { padding: 13px 13px 14px; }
  .pk-hero .hero-inner { padding-left: 16px; padding-right: 16px; }
  .pk-card-meta { gap: 3px 6px; font-size: 12px; }
  .pk-card-side { align-items: stretch; }
  .pk-card-go { margin-left: 0; }
  .pk-card-save { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .pk-modify-caret { transition: none; }
}
