/* Compare rental shops: the floating modal over the ski-area page (partials/compare-modal.njk,
   assets/js/compare.js). Loaded by resort.njk after resort.css, whose tokens (--rz-*) and
   Font Awesome it reuses. On every screen size it stays a floating window over the dimmed
   page; only the table scrolls sideways when the shops do not fit. */

:root{--cmpm-label-w:124px;--cmpm-col-w:196px;--cmpm-add-w:168px}
@media (max-width:640px){:root{--cmpm-label-w:96px;--cmpm-col-w:150px;--cmpm-add-w:136px}}

/* The open button is hidden until compare.js runs; .rz-cmp sets display, so restate it. */
.rz-cmp[hidden]{display:none}
button.rz-cmp{cursor:pointer}
html.cmpm-lock{overflow:hidden}

/* ---------- window ---------- */
.cmpm{
  width:min(1040px,calc(100vw - 64px));max-width:none;max-height:calc(100vh - 64px);max-height:calc(100dvh - 64px);
  margin:auto;padding:0;border:0;border-radius:16px;
  background:var(--rz-paper);color:var(--rz-ink);
  box-shadow:0 24px 64px rgba(9,20,32,.30),0 2px 8px rgba(9,20,32,.12);
}
.cmpm::backdrop{background:rgba(9,20,32,.55)}
.cmpm[open]{display:flex}
.cmpm-in{display:flex;flex-direction:column;width:100%;min-height:0;padding:22px 26px 18px;overflow-y:auto}

.cmpm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.cmpm-title{margin:0;font-size:22px;line-height:1.15;letter-spacing:-.02em;font-weight:700}
.cmpm-sub{margin:4px 0 0;font-size:13.5px;color:var(--rz-muted)}
.cmpm-x{
  flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;
  margin:-8px -10px 0 0;border:0;border-radius:999px;background:transparent;color:var(--rz-ink);
  font-size:20px;cursor:pointer;
}
.cmpm-x:hover{background:#F2F1EC}
.cmpm-x:focus-visible{outline:2px solid var(--rz-navy);outline-offset:2px}

/* ---------- four selectors ---------- */
.cmpm-ctl{display:flex;flex-wrap:wrap;gap:14px 22px;margin:18px 0}
.cmpm-fg{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.cmpm-fl{font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--rz-muted)}
.cmpm-seg{display:inline-flex;border:1px solid var(--rz-line);border-radius:999px;padding:3px;gap:2px}
.cmpm-opt{position:relative;display:inline-flex}
.cmpm-opt input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.cmpm-opt span{
  display:inline-flex;align-items:center;min-height:34px;padding:0 13px;border-radius:999px;
  font:600 13.5px/1 var(--sans);color:var(--rz-ink);white-space:nowrap;
  transition:background .16s ease,color .16s ease;
}
.cmpm-opt input:hover + span{background:#F2F1EC}
.cmpm-opt input:checked + span{background:var(--rz-navy);color:#fff}
.cmpm-opt input:focus-visible + span{outline:2px solid var(--rz-navy);outline-offset:2px}

/* ---------- table ---------- */
/* Scrolls sideways when the shops do not fit; the duration column stays put. */
.cmpm-scroll{flex:none;overflow-x:auto;border:1px solid var(--rz-line);border-radius:12px}
.cmpm-scroll:focus-visible{outline:2px solid var(--rz-navy);outline-offset:2px}
.cmpm-t{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:14px}
.cmpm-t th,.cmpm-t td{padding:14px 16px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--rz-line);background:var(--rz-paper)}
.cmpm-t tbody tr:last-child th,.cmpm-t tbody tr:last-child td{border-bottom:0}
.cmpm-t td{width:var(--cmpm-col-w);min-width:var(--cmpm-col-w);max-width:var(--cmpm-col-w);border-left:1px solid #EFEDE7}
.cmpm-t tbody th{
  position:sticky;left:0;z-index:1;width:var(--cmpm-label-w);min-width:var(--cmpm-label-w);max-width:var(--cmpm-label-w);
  font-weight:600;white-space:nowrap;color:var(--rz-ink);
}
/* Row label: the level, with the package type under it. */
.cmpm-t .cmpm-rl{white-space:normal;line-height:1.25}
.cmpm-rsub{display:block;margin-top:3px;font-size:12px;font-weight:400;color:var(--rz-muted)}
.cmpm-t thead th{background:#FBFAF7;vertical-align:top;font-weight:400;border-left:1px solid #EFEDE7}
.cmpm-t .cmpm-corner{
  position:sticky;left:0;z-index:2;border-left:0;vertical-align:bottom;
  font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--rz-muted);
}

.cmpm-shop{width:var(--cmpm-col-w);min-width:var(--cmpm-col-w);max-width:var(--cmpm-col-w)}
.cmpm-shead{display:flex;align-items:center;gap:6px}
.cmpm-pick{
  flex:1;min-width:0;width:100%;padding:8px 26px 8px 10px;border:1px solid var(--rz-line);border-radius:8px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2316202B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center;
  -webkit-appearance:none;appearance:none;font:600 14px/1.25 var(--sans);color:var(--rz-ink);cursor:pointer;text-overflow:ellipsis;
}
.cmpm-pick:focus-visible{outline:2px solid var(--rz-navy);outline-offset:2px}
.cmpm-dist{margin:6px 0 0;font-size:12px;color:var(--rz-muted)}
.cmpm-rm{
  flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;
  border:0;border-radius:999px;background:transparent;color:var(--rz-muted);font-size:14px;cursor:pointer;
}
.cmpm-rm:hover{background:var(--danger-soft);color:var(--danger)}
.cmpm-rm:focus-visible{outline:2px solid var(--rz-navy);outline-offset:2px}

/* "Add shop" is the next column of the table itself. */
.cmpm-t .cmpm-addcol,.cmpm-t .cmpm-addcell{width:var(--cmpm-add-w);min-width:var(--cmpm-add-w);max-width:var(--cmpm-add-w);background:#FBFAF7}
.cmpm-add{border-style:dashed;color:var(--rz-navy)}

/* cells: one price, or N/A */
.cmpm-p{font-size:18px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.01em;color:var(--rz-ink)}
.cmpm-cur{font-size:12px;font-weight:600;color:var(--rz-muted)}
.cmpm-inc{display:block;margin-top:3px;font-size:12px;line-height:1.35;color:var(--rz-muted)}
.cmpm-pc{cursor:help}
.cmpm-t td.cmpm-na{background:#FAF9F6;color:#9AA0A6;font-size:13px;font-weight:600;letter-spacing:.04em}
.cmpm-msg{padding:28px;color:var(--rz-muted);font-size:15px}

.cmpm-note{margin:12px 0 0;font-size:12px;line-height:1.5;color:var(--rz-muted)}

/* ---------- phones: still a floating window, a little inset from the edges ---------- */
@media (max-width:640px){
  .cmpm{width:calc(100vw - 20px);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);border-radius:14px}
  .cmpm-in{padding:16px 14px 14px}
  .cmpm-title{font-size:19px}
  .cmpm-sub{font-size:12.5px}
  .cmpm-ctl{gap:10px 12px;margin:14px 0}
  .cmpm-opt span{min-height:32px;padding:0 10px;font-size:13px}
  .cmpm-t th,.cmpm-t td{padding:11px 10px}
  .cmpm-p{font-size:16px}
}
