/**
 * フォーム共通スタイル
 * Tailwind CDN の Preflight より後に読み込むこと（inc/head.php で最後の link）。
 * 寸法・余白は !important で固定（Preflight の後勝ち対策）。
 * 狭い入力はテンプレ側で !w-32 等（Tailwind important）を併用する。
 */

.form-radio {
  accent-color: #1a2942;
  width: 1rem;
  height: 1rem;
}

.form-checkbox {
  accent-color: #1a2942;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.125rem;
}

.form-error {
  border-color: #8b2a2a !important;
  background-color: #fff9f9 !important;
}

/* チェックアウト送信中スピナー等 */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid #fff;
  width: 1.25rem;
  height: 1.25rem;
  animation: onSpin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes onSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* マイページ等で使うトースト用（必要ページのみ DOM が存在） */
.toast-enter {
  animation: onSlideUp 0.3s forwards;
}

@keyframes onSlideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
 * テキスト入力・セレクト・テキストエリア
 * -------------------------------------------------------------------------- */
input.form-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([type="reset"]),
select.form-select,
select.form-input,
textarea.form-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box !important;
  margin: 0;

  padding: 0.875rem 1rem !important;
  min-height: 3rem !important;
  line-height: 1.5 !important;
  font-size: 1rem !important;
  font-family: inherit !important;
  font-weight: 400 !important;

  border-width: 1px !important;
  border-style: solid !important;
  border-color: #c9cfd8 !important;
  border-radius: 0.125rem;
  background-color: #ffffff !important;
  color: #1a2942 !important;

  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea.form-textarea {
  min-height: 11rem !important;
  height: auto !important;
  resize: vertical !important;
  overflow: auto;
}

/* カート等: 行内の select は親が幅を決める（width:100% 一括指定を上書き） */
select.cart-inline-select {
  display: inline-block !important;
  width: auto !important;
  min-width: 3.5rem;
  max-width: 100%;
}

select.form-select,
select.form-input {
  cursor: pointer;
  padding-right: 2.5rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23314766' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.65rem auto;
}

input.form-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([type="reset"]):focus,
select.form-select:focus,
select.form-input:focus,
textarea.form-textarea:focus {
  border-color: #1a2942 !important;
  box-shadow: 0 0 0 2px rgba(26, 41, 66, 0.12) !important;
}

input.form-input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([type="reset"]):disabled,
select.form-select:disabled,
select.form-input:disabled,
textarea.form-textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: #f3f2ee !important;
}

/* 入力ではないが見た目を揃える（読み取り専用メール等） */
p.form-input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box !important;
  margin: 0;
  padding: 0.875rem 1rem !important;
  min-height: 3rem !important;
  line-height: 1.5 !important;
  font-size: 1rem !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: #c9cfd8 !important;
  border-radius: 0.125rem;
}

/* フォームセクションのカード（任意クラス） */
.on-form-card {
  background-color: #ffffff;
  border: 1px solid #c9cfd8;
  border-radius: 0.125rem;
  box-shadow: 0 1px 2px rgba(26, 41, 66, 0.06);
}

/* お問い合わせ確認（/contact/confirm/）：SP はラベル上・値下、PC は左ラベル右値の2列 */
.contact-confirm-summary {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.contact-confirm-summary .contact-confirm-label {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.55;
}

.contact-confirm-summary .contact-confirm-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.375rem 2rem;
  min-width: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  align-items: start;
}

.contact-confirm-summary .contact-confirm-row:first-child {
  padding-top: 0;
}

.contact-confirm-summary .contact-confirm-row:last-child {
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .contact-confirm-summary .contact-confirm-row {
    grid-template-columns: minmax(10.5rem, 12.5rem) minmax(0, 1fr);
    row-gap: 0;
    column-gap: 2rem;
  }
}
