/* =====================================
  カスタム複数選択ドロップダウン
===================================== */

.drop-wrapper {
  width: 100%;
  max-width: 480px;
}

.drop-dropdown {
  position: relative;
  width: 100%;
}

.drop-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
  background: #f4f4f4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.drop-trigger:focus {
  outline: none;
  border-color: #0072bc;
  box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.15);
}

.drop-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.drop-arrow {
  margin-left: 12px;
  font-size: 12px;
  color: #777;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.drop-trigger[aria-expanded="true"] .drop-arrow {
  transform: rotate(180deg);
}

.drop-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

.drop-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 280px;
  overflow-y: auto;
}

.drop-list-item {
  margin: 0;
  padding: 0;
}

.drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.drop-item:hover {
  background: #f4f7fa;
}

.drop-checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #0072bc;
  cursor: pointer;
  flex-shrink: 0;
}

.drop-item-text {
  display: inline-block;
}

.drop-panel-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 12px;
  border-top: 1px solid #e2e6ea;
}

.drop-confirm-btn {
  min-width: 88px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #0072bc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.drop-confirm-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.drop-confirm-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.drop-result {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  box-sizing: border-box;
}

.drop-result-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #777;
}

.drop-result-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.drop-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  background: #0072bc;
  border-radius: 20px;
}

.drop-empty {
  font-size: 13px;
  color: #999;
}

.drop-confirm-value {
  width: 100%;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}

@media screen and (max-width: 767px) {
  .drop-wrapper {
    max-width: 100%;
  }

  .drop-trigger {
    font-size: 14px;
  }

  .drop-panel {
    position: static;
    margin-top: 6px;
  }
}

/* ドロップダウンパネル全体 */
.drop-panel {
  display: flex;
  flex-direction: column;
  max-height: min(360px, 55vh);
  overflow: hidden;
}

/* hidden のときはちゃんと非表示 */
.drop-panel[hidden] {
  display: none;
}

/* 選択肢リストだけスクロールさせる */
.drop-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 下部の閉じるボタンを見えやすく固定 */
.drop-panel-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 1;
}

/* 選択済みタグを×付きボタンにする */
/* 選択済みタグを × 付きボタンにする */
.drop-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 5px 10px 5px 12px;
  font-size: 13px;
  line-height: 1.4;

  color: #fff;
  background: #0072bc;
  border: none;
  border-radius: 20px;

  cursor: pointer;
  font-family: inherit;
}

/* 項目名部分 */
.drop-tag-text {
  display: inline-block;
}

/* 右側の×部分 */
.drop-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* hover時 */
.drop-tag:hover {
  opacity: 0.85;
}

/* スマホ時 */
@media screen and (max-width: 767px) {
  .drop-panel {
    position: static;
    max-height: 48vh;
  }

  .drop-list {
    max-height: none;
  }
}