/*
 * ASTRA フレーバー選択UI の見た目。
 * 読み込むのは商品ID 84・202・440・1560 の商品ページだけ（mu-plugins/astra-flavor-ui.php）。
 * テーマ既存のドロップダウン（component-select-picker.css）と同じ配色・角丸・書体に揃える。
 *   背景 #0E0E0E / 枠 rgba(255,255,255,.3) / 選択色 #4EC3E1 / 文字 #CBCBCB / 角丸 9999px・16px
 */

.astra-flv {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.astra-flv.is-open {
  z-index: 2147483000; /* 実サイトの固定ボタン（LINE等）より前に出す */
}

.astra-flv__trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 6px 5.2rem 6px 2rem;
  text-align: left;
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M9.354.646a.5.5 0 0 0-.708 0L5 4.293 1.354.646a.5.5 0 0 0-.708.708l4 4a.5.5 0 0 0 .708 0l4-4a.5.5 0 0 0 0-.708'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2rem center;
  background-size: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  color: #fff;
  font-family: var(--astra-source-code-pro), sans-serif;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.astra-flv__trigger:hover,
.astra-flv__trigger[aria-expanded='true'] {
  border-color: #4ec3e1;
}

.astra-flv__trigger:focus-visible,
.astra-flv__option:focus-visible {
  outline: 2px solid #4ec3e1;
  outline-offset: 2px;
}

.astra-flv__trigger.is-placeholder {
  color: #8c8c8c;
}

.astra-flv__trigger.is-selected {
  border-color: #4ec3e1;
  color: #4ec3e1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%234EC3E1' d='M9.354.646a.5.5 0 0 0-.708 0L5 4.293 1.354.646a.5.5 0 0 0-.708.708l4 4a.5.5 0 0 0 .708 0l4-4a.5.5 0 0 0 0-.708'/%3E%3C/svg%3E");
}

/* 濃度が未選択のあいだは操作できない。文言（先にニコチン濃度を選択してください）だけを控えめに見せる */
.astra-flv.is-locked .astra-flv__trigger {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.18);
  border-style: dashed;
  background-color: rgba(255, 255, 255, 0.03);
  background-image: none;
  color: #8c8c8c;
}

.astra-flv.is-locked .astra-flv__trigger:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.astra-flv__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: min(600px, 72vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background-color: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.astra-flv__list[hidden] {
  display: none;
}

.astra-flv__option {
  min-height: 48px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  color: #cbcbcb;
  font-family: var(--astra-source-code-pro), sans-serif;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.astra-flv__option:hover,
.astra-flv__option:focus-visible {
  background-color: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.astra-flv__option[aria-selected='true'] {
  color: #4ec3e1;
}

.astra-flv__option[aria-disabled='true'] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 1行の中身: [ロゴ] 名前 [ラベル] （付加情報） */
.astra-flv__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.astra-flv__text {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

.astra-flv__line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.astra-flv__name {
  min-width: 0;
}

.astra-flv__suffix {
  margin-left: auto;
  color: #8c8c8c;
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}

.astra-flv__option[aria-selected='true'] .astra-flv__suffix,
.astra-flv__trigger.is-selected .astra-flv__suffix {
  color: rgba(78, 195, 225, 0.7);
}

.astra-flv__logo {
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ラベル（「おすすめ」）。選択状態の色（シアン）とぶつからないピンク */
.astra-flv__badge {
  flex: none;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #ff8fb0;
  background: rgba(255, 143, 176, 0.14);
  border: 1px solid rgba(255, 143, 176, 0.65);
}

/* テーマ既存のプルダウン（通常商品）は、同じ欄に新UIが出るあいだ隠す */
.astra-flv-host > .astra-picker-dropdown {
  display: none !important;
}

@media (max-width: 640px) {
  .astra-flv {
    max-width: none;
  }

  .astra-flv__trigger {
    padding-left: 1.4rem;
    padding-right: 3.8rem;
    font-size: 15px;
    background-position: right 1.4rem center;
  }

  .astra-flv__option {
    min-height: 48px;
    padding: 6px 12px;
    font-size: 15px;
  }

  .astra-flv__suffix {
    font-size: 10px;
  }

  .astra-flv__row {
    gap: 8px;
  }

  .astra-flv__line,
  .astra-flv__text {
    gap: 2px 6px;
  }

  .astra-flv__badge {
    padding: 2px 7px;
    font-size: 10.5px;
  }

  .astra-flv__list {
    max-height: min(560px, 74vh);
  }
}
