/* Browse by country, region and resort (A7) and offline saving. Uses the tokens in design/tokens.css and the shared
   .sheet, .btn, .list and .segmented styles in friends.css. */

/* The list button in the search bar */
.search-browse {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border: 0; border-left: 1px solid var(--separator); border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent; color: var(--navy);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.search-browse:hover { background: rgba(255, 255, 255, .6); }
.search-browse[aria-expanded="true"] { color: var(--accent); }
.search-browse:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.search-browse svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The panel: shorter than the other sheets on phones, so the country or region it frames stays in view above it */
.browse-sheet #browse-title { outline: none; }
@media (max-width: 699px) {
  .browse-sheet { max-height: min(58vh, 560px); }
}
.browse-sheet .sheet-body { padding-top: var(--space-2); }

.browse-group + .browse-group { margin-top: var(--space-4); }
.browse-group h3 { margin: var(--space-2) 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.browse-crumb { margin: var(--space-1) 0 0 !important; }
.browse-source { margin: var(--space-4) 0 0 !important; }

/* Rows: full-width buttons like an iOS table */
.browse-list li + li { border-top: 1px solid var(--separator-soft); }
.browse-row {
  display: flex; align-items: center; gap: var(--space-3);
  width: calc(100% + 2 * var(--space-2)); min-height: 52px;
  margin: 0 calc(-1 * var(--space-2)); padding: 8px var(--space-2);
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.browse-row:hover { background: var(--fill); }
.browse-row:active { background: var(--fill-hover); }
.browse-row:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.browse-row strong { font-size: var(--text-base); font-weight: 600; white-space: nowrap; }
.browse-row small { white-space: nowrap; }
.browse-flag { font-size: 24px; line-height: 1; width: 28px; text-align: center; flex: none; }
.browse-count { flex: none; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.browse-chevron { flex: none; width: 16px; height: 16px; fill: none; stroke: rgb(var(--navy-rgb) / .3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.browse-icon {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--navy);
}
.browse-icon.saved { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.browse-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Start: Find my resort or Browse all resorts ---------- */

.choice-list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1); }
.choice-card {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; padding: 14px var(--space-3) 14px 14px;
  border: 0; border-radius: var(--radius);
  background: #fff; color: var(--text); box-shadow: 0 1px 3px rgb(var(--navy-rgb) / .1), 0 0 0 1px rgb(var(--navy-rgb) / .05);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease), transform .12s var(--ease-out);
}
.choice-card:hover { box-shadow: 0 4px 14px rgb(var(--navy-rgb) / .12), 0 0 0 1px rgb(var(--navy-rgb) / .06); }
.choice-card:active { transform: scale(.985); }
.choice-card:focus-visible, .finder-last:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.choice-card strong { font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-title); }
.choice-card .grow > span { margin-top: 2px; white-space: normal; line-height: 1.35; }
.choice-icon {
  flex: none; align-self: flex-start;
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--navy);
}
.choice-icon.finder { background: linear-gradient(135deg, var(--accent), var(--piste-blue)); color: #fff; }
.choice-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice-icon.finder svg { stroke-width: 2; }

/* "Your last matches", tucked under the Find my resort card */
.finder-last {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; margin-top: -2px; padding: 8px var(--space-3) 8px 14px;
  border: 0; border-radius: var(--radius-sm);
  background: rgb(var(--accent-rgb) / .08); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.finder-last:hover { background: rgb(var(--accent-rgb) / .13); }
.finder-last strong { font-size: 14px; color: var(--accent); }
.browse-saved { margin-top: var(--space-5); }

/* ---------- Questionnaire ---------- */

.finder-progress { height: 4px; margin-top: var(--space-1); border-radius: 2px; background: var(--fill-hover); overflow: hidden; }
.finder-progress i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width var(--dur) var(--ease-out); }
.finder-step { margin: var(--space-3) 0 2px !important; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.finder-question { margin: 0 0 var(--space-1); font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: var(--tracking-title); line-height: 1.2; }
.finder-hint { margin: 0 0 var(--space-3) !important; }
.finder-question + .finder-options, .finder-question + .finder-countries { margin-top: var(--space-3); }

.finder-options { display: flex; flex-direction: column; gap: var(--space-2); }
.finder-option {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 52px; padding: 9px 14px 9px 10px;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  background: var(--fill); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.finder-option:hover { background: var(--fill-2); }
.finder-option[aria-checked="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .08); }
.finder-option:focus-visible, .finder-country:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.finder-option strong { font-size: var(--text-base); font-weight: 600; white-space: normal; }
.finder-option small { white-space: normal; }
.finder-tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid rgb(var(--navy-rgb) / .2);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.finder-tick svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.finder-option[aria-checked="true"] .finder-tick { background: var(--accent); border-color: var(--accent); }
.finder-option[aria-checked="true"] .finder-tick svg { opacity: 1; }

/* Pictogram tiles beside the answers (finder.js): a tinted rounded square with a line drawing, in the question's
   colour (--ink); the chosen answer's tile fills with that colour. Levels use the piste colours. */
.finder-icon {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  --ink: var(--accent);
  background: var(--fill-2);
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.finder-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.finder-icon .fill { fill: currentColor; stroke: none; }
.finder-icon .soft { fill: currentColor; stroke: none; opacity: .28; }
.finder-icon b { font-size: 13px; font-weight: 700; letter-spacing: -.03em; }
.finder-option[aria-checked="true"] .finder-icon { background: var(--ink); color: #fff; }

.finder-countries { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.finder-country {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border: 1.5px solid rgb(var(--navy-rgb) / .12); border-radius: 999px;
  background: #fff; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.finder-country span { font-size: 18px; line-height: 1; }
.finder-country:hover { border-color: rgb(var(--accent-rgb) / .5); }
.finder-country[aria-pressed="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); color: var(--accent); font-weight: 600; }
.finder-more-countries { display: block; margin-top: var(--space-3); font-size: 14px; }

/* Where are you starting from? */
.finder-from-chosen {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-2); padding: 8px 8px 8px 14px;
  border: 1.5px solid var(--accent); border-radius: var(--radius-sm);
  background: rgb(var(--accent-rgb) / .08);
}
.finder-from-chosen strong { font-size: var(--text-base); }
.finder-from-pin {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.finder-from-pin.locate { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.finder-from-pin svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.finder-locate:disabled { opacity: .6; cursor: default; }
.finder-locate + .form-error { margin: var(--space-2) 0 0; }
.finder-town { display: block; margin-top: var(--space-2); }
.finder-town input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid rgb(var(--navy-rgb) / .16); border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  font: inherit; font-size: 16px;   /* 16 px stops iOS zooming in */
}
.finder-town input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.finder-towns { margin-top: var(--space-1); }
.finder-towns .hint { padding: 8px 0; }
.finder-price { color: var(--text); font-weight: 500; }

/* The Next button stays in reach at the bottom of the panel while the options scroll */
.finder-footer {
  position: sticky; bottom: calc(-1 * var(--space-5)); z-index: 1;
  margin: var(--space-4) calc(-1 * var(--space-5)) calc(-1 * var(--space-5));
  padding: var(--space-3) var(--space-5) var(--space-5);
  background: linear-gradient(to bottom, transparent, var(--glass-solid) 30%);
}

/* ---------- Matches ---------- */

.finder-summary { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-1) 0 var(--space-2); }
.finder-summary p { flex: 1; min-width: 0; margin: 0 !important; }
.finder-summary .btn { flex: none; }
.finder-row { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.finder-row .browse-chevron { align-self: center; }
.finder-row strong { white-space: normal; }
.finder-score {
  flex: none; position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--score) * 1%), var(--fill-hover) 0);
}
.finder-score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--glass-solid); }
.finder-score b { position: relative; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.finder-reasons { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 5px; overflow: visible !important; }
.finder-reasons em {
  padding: 2px 7px; border-radius: 6px;
  background: var(--fill-2); color: var(--text);
  font-size: 12px; font-style: normal; white-space: nowrap;
}
.finder-more { margin-top: var(--space-3); }

/* With the browse panel open on the left, the resort card sits next to it on wide screens */
@media (min-width: 700px) {
  body:has(#browse-sheet.open) .place-card { left: calc(var(--gutter) + 396px); margin-left: 0; }
}

/* ---------- Offline (resort card and status chip) ---------- */

.offline-row {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-3); padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  font-size: var(--text-sm);
}
.offline-row .grow strong { font-size: 14px; }
.offline-row .browse-icon { width: 30px; height: 30px; }
.offline-row.saved .browse-icon { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.offline-row .btn { flex: none; }
.offline-progress { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--fill-hover); overflow: hidden; }
.offline-progress i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--dur-fast) linear; }

.chip.offline {
  border: 0; font: inherit; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--navy);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  cursor: pointer;
}
.chip.offline:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
