/*
 * 買取価格検索システム(WordPress 表示用)
 * テーマとぶつからないよう、クラスはすべて kt- で始める。色はテーマの --ac をそのまま使う。
 */

/* ---------- トップページ: 強化買取カード(do_action amtaf_featured) ---------- */
.kt-featured { display:flex; gap:16px; overflow-x:auto; padding-bottom:12px; scroll-snap-type:x mandatory; }
.kt-featured-card { flex:0 0 220px; scroll-snap-align:start; background:#FFFFFF; border-radius:8px; overflow:hidden; text-decoration:none; display:flex; flex-direction:column; border:1px solid #E4E4DE; color:#15171C; }
.kt-featured-img { position:relative; }
.kt-featured-badge { position:absolute; top:10px; left:10px; background:#0B0D12; color:var(--ac); font-size:12px; font-weight:800; padding:2px 8px; border-radius:4px; font-family:'Noto Sans JP',sans-serif; }
.kt-featured-body { padding:14px 16px 16px; display:flex; flex-direction:column; gap:6px; }
.kt-featured-sub { font-size:12px; color:#5B606B; }
.kt-featured-name { font-size:14px; font-weight:700; line-height:1.5; min-height:3em; }
.kt-featured-price { font-family:Archivo,sans-serif; font-weight:800; font-size:26px; letter-spacing:-.02em; line-height:1.1; }
.kt-featured-empty { padding:24px; color:#5B606B; }

/* ---------- 買取価格検索: スマホでは価格を商品名の下に ---------- */
@media (max-width: 600px) {
  .kt-row { grid-template-columns: 64px minmax(0,1fr) !important; gap: 12px !important; }
  .kt-price { grid-column: 2; font-size: 24px !important; }
}

/* ---------- ポップアップ共通(タイトル選択・画像拡大) ---------- */
.kt-dialog { width:min(720px, calc(100% - 32px)); max-height:calc(100% - 48px); overflow:auto; border:0; border-radius:14px; padding:20px; background:#FFFFFF; color:#15171C; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.kt-dialog::backdrop { background:rgba(11,13,18,.7); }
.kt-dialog a:hover img, .kt-dialog a:hover > div { outline:3px solid var(--ac); outline-offset:-3px; }
/* ふわっと表示・非表示 */
.kt-dialog[open] { animation: kt-in .38s cubic-bezier(.22,1,.36,1) both; }
.kt-dialog[open]::backdrop { animation: kt-fade .38s ease both; }
.kt-dialog.is-closing { animation: kt-out .24s ease-in both; }
.kt-dialog.is-closing::backdrop { animation: kt-fade .24s ease-in reverse both; }
@keyframes kt-in { from { opacity:0; transform:translateY(14px) scale(.97); } to { opacity:1; transform:none; } }
@keyframes kt-out { from { opacity:1; transform:none; } to { opacity:0; transform:translateY(8px) scale(.98); } }
@keyframes kt-fade { from { opacity:0; } to { opacity:1; } }
@media (prefers-reduced-motion: reduce) {
  .kt-dialog[open], .kt-dialog[open]::backdrop { animation: none; }
}

/* 「ほかのタイトル」ボタン */
.kt-other:hover { background:rgba(255,255,255,.06) !important; }
@media (max-width: 600px) {
  .kt-other { width:100%; }
}

/* ---------- サムネイル拡大ポップアップ ---------- */
.kt-zoom-btn { display:block; padding:0; border:0; background:none; cursor:zoom-in; border-radius:4px; }
.kt-zoom-btn:focus-visible { outline:3px solid var(--ac); outline-offset:2px; }
.kt-zoom { width:min(480px, calc(100% - 32px)); padding:16px; position:fixed; overflow:hidden; }
/* 画像の大きさが商品ごとに違っても、ポップアップの大きさが変わらないよう枠を固定 */
.kt-zoom-stage { position:relative; width:100%; aspect-ratio:5/7; max-height:calc(100vh - 190px); max-height:calc(100dvh - 190px); border-radius:8px; background:#F4F4EF; overflow:hidden; touch-action:pan-y; user-select:none; -webkit-user-select:none; }
.kt-zoom-stage img { display:block; width:100%; height:100%; object-fit:contain; cursor:zoom-out; -webkit-user-drag:none;
  transition:transform .3s cubic-bezier(.22,1,.36,1), opacity .3s ease; }
/* 切り替えアニメーション: 進む方向へ流れて消え、反対側から滑り込む */
.kt-zoom-stage img.kt-out-left  { transform:translateX(-56px) scale(.96); opacity:0; transition-duration:.17s; transition-timing-function:ease-in; }
.kt-zoom-stage img.kt-out-right { transform:translateX(56px) scale(.96); opacity:0; transition-duration:.17s; transition-timing-function:ease-in; }
.kt-zoom-stage img.kt-in-right  { transform:translateX(56px) scale(.96); opacity:0; }
.kt-zoom-stage img.kt-in-left   { transform:translateX(-56px) scale(.96); opacity:0; }
.kt-zoom-stage img.kt-no-anim   { transition:none !important; }
.kt-zoom-nav { position:absolute; top:50%; width:44px; height:44px; margin-top:-22px; border:0; border-radius:50%; background:rgba(255,255,255,.92); color:#15171C; box-shadow:0 4px 14px rgba(0,0,0,.18); font-size:30px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0 0 4px; transition:background .2s, transform .2s, opacity .2s; }
.kt-zoom-nav:hover:not(:disabled) { background:var(--ac); transform:scale(1.06); }
.kt-zoom-nav:focus-visible { outline:3px solid var(--ac); outline-offset:2px; }
.kt-zoom-nav:disabled { opacity:.25; cursor:default; }
.kt-zoom-prev { left:10px; }
.kt-zoom-next { right:10px; }
.kt-zoom-cap { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-top:12px; font-size:14px; font-weight:700; line-height:1.5; transition:opacity .25s ease, transform .25s ease; }
.kt-zoom-cap.kt-fade { opacity:0; transform:translateY(4px); transition-duration:.15s; }
.kt-zoom-count { margin-top:4px; font-family:Archivo,sans-serif; font-size:12px; color:#8A8E97; text-align:center; min-height:1em; }
@media (prefers-reduced-motion: reduce) {
  .kt-zoom-stage img, .kt-zoom-cap { transition:none; }
}
.kt-zoom-cap b { font-family:Archivo,sans-serif; font-size:22px; font-weight:800; white-space:nowrap; }
.kt-zoom-close { position:absolute; top:10px; right:10px; width:40px; height:40px; border:0; border-radius:50%; background:rgba(11,13,18,.75); color:#F5F5F1; font-size:22px; line-height:1; cursor:pointer; }

/* ---------- スマホでは検索フォームを収納 ---------- */
.kt-search-toggle { display:none; }
@media (max-width: 600px) {
  .kt-search.is-collapsible .kt-search-toggle { display:flex; width:100%; min-height:52px; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; border:1px solid #2A2F3A; border-radius:12px; background:#161A22; color:#F5F5F1; font-size:15px; font-weight:800; text-align:left; cursor:pointer; }
  .kt-search-label { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-width:0; }
  .kt-search-sum { font-size:12px; font-weight:700; color:var(--ac); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
  .kt-search-arrow { color:var(--ac); transition:transform .3s ease; }
  .kt-search.is-open .kt-search-arrow { transform:rotate(180deg); }
  .kt-search.is-collapsible:not(.is-open) .kt-price-form { display:none !important; }
  .kt-search.is-open .kt-price-form { margin-top:10px; animation:kt-in .32s cubic-bezier(.22,1,.36,1) both; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .kt-search.is-open .kt-price-form { animation:none; }
}
