/** FancyMeds Kayak-style dropdowns — shared (home / PDP / blog / account)
 *  Closed chrome matches progressive `.fv4-summary` tiles (blog source of truth).
 */

/* Field tile = same box as blog/PDP summary rows */
.fv4-field.is-kayak {
  position: relative;
  z-index: 1;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fv4-field.is-kayak:focus-within,
.fv4-field.is-kayak.is-open {
  z-index: 12;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 96, 240, 0.15);
  background: #fff;
}
.fv4-field.is-kayak.is-locked {
  opacity: 0.72;
}
.fv4-field.is-kayak.is-locked .fv4-dd-trigger {
  cursor: default;
}
.fv4-dd-trigger:disabled {
  cursor: default;
}
.fv4-field.is-kayak > select.fv4-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: none;
  pointer-events: none;
}
/* Blurbs live in the open panel only (blog summary tiles stay one-line) */
.fv4-field.is-kayak .fv4-type-blurb,
.fv4-field.is-kayak .fv4-dd-sub {
  display: none !important;
}
.fv4-field.is-kayak > label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.1rem;
  line-height: 1.2;
}
.fv4-dd-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
}
.fv4-dd-trigger:focus-visible {
  outline: 2px solid var(--blue-bright, #3b7cff);
  outline-offset: 2px;
  border-radius: 4px;
}
.fv4-dd-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-right: 0.15rem;
}
.fv4-field.is-kayak:has(.fv4-dd-trigger.has-med-pill) {
  padding-right: 0.75rem;
}
.fv4-dd-trigger.has-med-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  container-type: inline-size;
  container-name: fv4-med-trigger;
}
.fv4-dd-trigger.has-med-pill .fv4-dd-copy {
  flex: 1 1 auto;
  min-width: max-content;
}
.fv4-dd-trigger.has-med-pill .fv4-dd-value {
  overflow: visible;
  text-overflow: unset;
  font-size: 0.88rem;
}
.fv4-dd-value {
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* LOCKED 2026-08-17 — Quiet Sema/Tirz caption. Do not restyle.
   Not the Duration 4/6/8 pills.
   Colors match PDP intro .form-pill.is-popular / .is-effective (not Weekly injection blue). */
.fv4-dd-med-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 100%;
  padding: 0.18rem 0.48rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e8edf4;
  color: var(--ink, #0b1220);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.fv4-dd-med-pill[hidden] {
  display: none !important;
}
.fv4-dd-med-pill[data-med="semaglutide"] {
  background: #e8f4ed;
  color: #1a6b4a;
  border-color: #b8d9c4;
}
.fv4-dd-med-pill[data-med="tirzepatide"] {
  background: #f6f0dc;
  color: #7a5a12;
  border-color: #dfcf9a;
}
/* Closed trigger — same modest chip as open rows (0.68rem / 500).
   Grouped with chevron on the right. Wash/text/border from [data-med]. */
.fv4-dd-trigger > .fv4-dd-med-pill,
.fv4-summary > .fv4-dd-med-pill {
  margin-left: auto;
  padding: 0.18rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.fv4-field.is-kayak .fv4-dd-trigger.has-med-pill .fv4-dd-chevron {
  position: static;
  top: auto;
  right: auto;
  margin: 0;
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.fv4-field.is-kayak.is-open .fv4-dd-trigger.has-med-pill .fv4-dd-chevron {
  transform: rotate(225deg);
}
@container fv4-med-trigger (max-width: 14.25rem) {
  .fv4-dd-trigger > .fv4-dd-med-pill,
  .fv4-summary > .fv4-dd-med-pill {
    font-size: 0.62rem;
    padding: 0.14rem 0.38rem;
  }
}
@container fv4-med-trigger (max-width: 12rem) {
  .fv4-dd-trigger > .fv4-dd-med-pill,
  .fv4-summary > .fv4-dd-med-pill {
    display: none;
  }
}
@media (max-width: 340px) {
  .fv4-dd-trigger > .fv4-dd-med-pill,
  .fv4-summary > .fv4-dd-med-pill {
    display: none;
  }
}
.fv4-dd-sub {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
}
.fv4-dd-sub:empty { display: none; }
/* Chevron: centered on the whole field tile (matches .fv4-summary-chevron) */
.fv4-field.is-kayak .fv4-dd-chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin: 0;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.85;
  pointer-events: none;
}
.fv4-field.is-kayak.is-open .fv4-dd-chevron {
  transform: translateY(-35%) rotate(225deg);
}

/* Open list panel — body-teleported; sheet/backdrop are 100/95 */
.fv4-dd-panel {
  position: fixed;
  z-index: 90;
  pointer-events: auto;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.14);
  max-height: min(22rem, calc(100vh - 1.5rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
body.sheet-open .fv4-dd-panel,
.fv4-dd-panel-teaser {
  z-index: 125;
}
.fv4-dd-panel[hidden] { display: none !important; }
.fv4-dd-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.65rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
}
.fv4-dd-panel-med .fv4-dd-opt {
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 0.45rem;
}
.fv4-dd-opt-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.14rem;
  min-width: 0;
}
.fv4-dd-opt .fv4-dd-med-pill {
  margin-left: 0;
}
.fv4-dd-opt:hover,
.fv4-dd-opt:focus-visible {
  background: var(--sky, #f2f6fc);
  outline: none;
}
.fv4-dd-opt.is-selected {
  background: rgba(32, 96, 240, 0.06);
}
/* Open list ≤ locked sheet/teaser field value (0.84rem). Med / Duration / Dose type share one rule. */
.fv4-dd-opt-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--ink);
}
.fv4-dd-opt-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.fv4-dd-opt-loc-icon {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--brand, #2060f0);
  display: inline-flex;
}
.fv4-dd-opt-loc-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.fv4-dd-opt--current-loc .fv4-dd-opt-label {
  font-weight: 650;
}
.fv4-dd-panel-type .fv4-dd-opt-blurb {
  font-size: 0.7rem;
}
.fv4-dd-opt.is-selected .fv4-dd-opt-label {
  font-weight: 750;
  color: var(--ink);
}
.fv4-dd-opt-blurb {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
}
.fv4-dd-opt-blurb:empty { display: none; }
/* Kayak-style check on the selected row */
.fv4-dd-opt-check {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  opacity: 0;
  background: no-repeat center / 1.05rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4.5 10.5 8.2 14.2 15.5 5.8' stroke='%232060F0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.fv4-dd-opt.is-selected .fv4-dd-opt-check {
  opacity: 1;
}

/* Type-to-filter (50-state lists). Duration / med / type stay unfiltered. */
.fv4-dd-panel-filterable {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.35rem;
}
.fv4-dd-filter {
  flex: 0 0 auto;
  padding: 0 0.15rem 0.35rem;
}
.fv4-dd-filter-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.fv4-dd-filter-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 96, 240, 0.15);
  background: #fff;
}
.fv4-dd-filter-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.fv4-dd-opts {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.fv4-dd-panel-filterable .fv4-dd-opt {
  min-height: 44px;
}
.fv4-dd-empty {
  margin: 0;
  padding: 0.7rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
  text-align: center;
}
.fv4-dd-empty[hidden] { display: none !important; }
.fv4-dd-opt[hidden] { display: none !important; }
