/* ==========================================
   SHOE POSITION MAP
========================================== */

.shoe-map-section {
  background: #f4feff;
  margin-top: 90px;
  padding: clamp(70px, 10vw, 130px) clamp(22px, 6vw, 90px);
}

.shoe-map-heading {
  display: grid;
  gap: 24px;
  grid-template-columns:
    minmax(150px, 0.8fr)
    minmax(260px, 1fr)
    minmax(240px, 0.9fr);
  margin: 0 auto 48px;
  max-width: 1440px;
}

.shoe-map-heading h2 {
  color: #16383b;
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.86;
}

.shoe-map-heading > p:last-child {
  align-self: end;
  color: #557477;
  font-size: 0.82rem;
  line-height: 2;
  max-width: 360px;
}

/* 凡例 */

.shoe-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 auto 24px;
  max-width: 1440px;
}

.map-legend-item {
  align-items: center;
  color: #557477;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.62rem;
  gap: 8px;
  letter-spacing: 0.04em;
}

.legend-dot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-dot-cushion {
  background: #75cfd5;
}

.legend-dot-balanced {
  background: #179daa;
}

.legend-dot-speed {
  background: #16383b;
}

.legend-dot-carbon {
  background: #c8482b;
}

.legend-dot-pick {
  background: #179daa;
  box-shadow: 0 0 0 3px rgba(23, 157, 170, 0.25);
}

/* チャートの外側 */

.shoe-map-scroll {
  overflow-x: auto;
  padding: 4px 4px 18px;
  scrollbar-color: #179daa #d8f1f3;
  scrollbar-width: thin;
}

/* チャート本体 */

.shoe-map {
  background: #ffffff;
  border: 1px solid rgba(22, 56, 59, 0.14);
  height: clamp(560px, 62vw, 760px);
  margin: 0 auto;
  max-width: 1440px;
  min-width: 760px;
  overflow: hidden;
  position: relative;
}

/* 背景グリッド */

.map-grid-line {
  background: rgba(22, 56, 59, 0.08);
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.map-grid-line-vertical-1,
.map-grid-line-vertical-2,
.map-grid-line-vertical-3 {
  bottom: 8%;
  top: 8%;
  width: 1px;
}

.map-grid-line-vertical-1 {
  left: 25%;
}

.map-grid-line-vertical-2 {
  left: 50%;
}

.map-grid-line-vertical-3 {
  left: 75%;
}

.map-grid-line-horizontal-1,
.map-grid-line-horizontal-2,
.map-grid-line-horizontal-3 {
  height: 1px;
  left: 8%;
  right: 8%;
}

.map-grid-line-horizontal-1 {
  top: 25%;
}

.map-grid-line-horizontal-2 {
  top: 50%;
}

.map-grid-line-horizontal-3 {
  top: 75%;
}

/* 軸 */

.map-axis {
  background: #16383b;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.map-axis-x {
  bottom: 15%;
  height: 2px;
  left: 8%;
  right: 8%;
}

.map-axis-y {
  bottom: 8%;
  left: 50%;
  top: 8%;
  width: 2px;
}

.map-axis-x::after {
  border-bottom: 6px solid transparent;
  border-left: 10px solid #16383b;
  border-top: 6px solid transparent;
  content: "";
  position: absolute;
  right: -2px;
  top: -5px;
}

.map-axis-y::before {
  border-bottom: 10px solid #16383b;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  content: "";
  left: -5px;
  position: absolute;
  top: -2px;
}

/* 軸ラベル */

.map-axis-label {
  color: #16383b;
  font-family: var(--mono);
  font-size: clamp(0.56rem, 1vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  pointer-events: none;
  position: absolute;
  white-space: nowrap;
  z-index: 2;
}

.map-axis-label-left {
  bottom: 10%;
  left: 3%;
}

.map-axis-label-right {
  bottom: 10%;
  right: 3%;
}

.map-axis-label-top {
  left: 52%;
  top: 3%;
}

.map-axis-label-bottom {
  bottom: 2%;
  left: 52%;
}

/* シューズバブル */

.map-shoes {
  inset: 0;
  position: absolute;
  z-index: 3;
}

.map-shoe {
  align-items: center;
  background: #ffffff;
  border: 2px solid #179daa;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(22, 56, 59, 0.13);
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 82px;
  min-width: 112px;
  padding: 11px 13px;
  position: absolute;
  text-align: center;
  text-decoration: none;

  /*
    x・y座標の中心をシューズの中心に合わせる。
    50%にすると、シューズが座標より下にずれます。
  */
  transform: translate(-50%, -50%);

  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease,
    z-index 0.25s ease,
    border-color 0.25s ease;
}

.map-shoe:hover,
.map-shoe:focus-visible {
  border-color: #16383b;
  box-shadow: 0 15px 34px rgba(22, 56, 59, 0.28);
  outline: none;
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 20;
}

.map-shoe.is-carbon {
  border-color: #c8482b;
}

.map-shoe.is-racing {
  background: #16383b;
  color: #ffffff;
}

.map-shoe.is-racing:hover,
.map-shoe.is-racing:focus-visible {
  border-color: #179daa;
}

/* YOUR PICK */

.map-shoe.is-pick {
  border-color: #179daa;
  border-width: 3px;
  box-shadow:
    0 0 0 4px rgba(23, 157, 170, 0.22),
    0 12px 30px rgba(22, 56, 59, 0.2);
}

.map-shoe.is-pick.is-racing {
  border-color: #75cfd5;
  box-shadow:
    0 0 0 4px rgba(117, 207, 213, 0.28),
    0 12px 30px rgba(22, 56, 59, 0.2);
}

.map-shoe-badge {
  align-items: center;
  background: #179daa;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.46rem;
  font-weight: 700;
  gap: 4px;
  left: 50%;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  top: -12px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.map-shoe-badge::before {
  content: "★";
}

.map-shoe-brand {
  font-family: var(--mono);
  font-size: 0.51rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  text-transform: uppercase;
}

.map-shoe-name {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 4px;
}

.map-shoe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 7px;
}

.map-shoe-tag {
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.43rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  padding: 2px 5px;
}

.map-shoe-tag-carbon {
  background: #c8482b;
  border-color: #c8482b;
  color: #ffffff;
}

.map-shoe-tag-buy {
  background: #ffffff;
  color: #16383b;
  font-weight: 700;
}

.map-shoe.is-racing .map-shoe-tag-buy {
  background: #179daa;
  border-color: #179daa;
  color: #ffffff;
}

/* 特徴カード */

.shoe-feature-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px auto 0;
  max-width: 1440px;
}

.shoe-feature-card {
  background: #ffffff;
  border: 1px solid rgba(22, 56, 59, 0.12);
  color: inherit;
  display: block;
  padding: 20px;
  position: relative;
  text-decoration: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.shoe-feature-card:hover,
.shoe-feature-card:focus-visible {
  border-color: #179daa;
  box-shadow: 0 12px 28px rgba(22, 56, 59, 0.14);
  outline: none;
  transform: translateY(-3px);
}

.shoe-feature-card-brand {
  color: #6f8b8e;
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shoe-feature-card h3 {
  color: #16383b;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 7px 0 13px;
}

.shoe-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.shoe-feature-chip {
  background: #e7f8f9;
  border-radius: 999px;
  color: #216d72;
  font-family: var(--mono);
  font-size: 0.52rem;
  line-height: 1.6;
  padding: 4px 7px;
}

.shoe-feature-chip.is-carbon {
  background: #fae1da;
  color: #a53621;
}

.shoe-feature-card-buy {
  color: #179daa;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 16px;
}

.shoe-feature-card-buy::after {
  content: " ↗";
  transition: margin-left 0.2s ease;
}

.shoe-feature-card:hover .shoe-feature-card-buy::after {
  margin-left: 3px;
}

.shoe-map-note {
  color: #6f8b8e;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.8;
  margin: 22px auto 0;
  max-width: 1440px;
}

/* タブレット */

@media (max-width: 900px) {
  .shoe-map-heading {
    display: block;
  }

  .shoe-map-heading h2 {
    margin: 22px 0;
  }

  .shoe-map-heading > p:last-child {
    max-width: 520px;
  }

  .shoe-feature-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* スマートフォン */

@media (max-width: 600px) {
  .shoe-map-section {
    margin-top: 55px;
    padding: 70px 18px;
  }

  .shoe-map {
    height: 600px;
    min-width: 760px;
  }

  .shoe-map-heading h2 {
    font-size: clamp(3rem, 17vw, 5.4rem);
  }

  .map-shoe {
    min-height: 72px;
    min-width: 100px;
    padding: 9px;
  }

  .map-shoe-name {
    font-size: 0.88rem;
  }

  .shoe-feature-summary {
    grid-template-columns: 1fr;
  }
}

/* 34-model chart update */
.shoe-map-section { background:#eef9ff; }
.shoe-map-heading h2,
.map-axis-label { color:#086bc7; }
.map-axis { background:#086bc7; }
.map-axis-x::after { border-left-color:#086bc7; }
.map-axis-y::before { border-bottom-color:#086bc7; }

.map-shoe {
  min-height: 48px !important;
  min-width: 82px !important;
  max-width: 116px;
  padding: 7px 9px !important;
  border-width: 1px !important;
  box-shadow: 0 5px 14px rgba(8,107,199,.10) !important;
  transform: translate(-50%, 50%);
  z-index: 2;
}
.map-shoe:hover,
.map-shoe:focus-visible {
  transform: translate(-50%, 50%) scale(1.08);
  z-index: 20;
}
.map-shoe-brand {
  font-size: .46rem !important;
  letter-spacing: .06em;
}
.map-shoe-name {
  font-size: .58rem !important;
  line-height: 1.1;
}
.map-shoe-mini {
  color:#6b7f8d;
  font-family:var(--d-mono);
  font-size:.40rem;
  line-height:1.15;
  margin-top:3px;
}
.map-shoe.is-cushion { border-color:#43bdf0 !important; }
.map-shoe.is-balanced { border-color:#086bc7 !important; }
.map-shoe.is-speed { border-color:#16383b !important; }

.map-shoe.is-pick {
  border:2px solid #086bc7 !important;
  box-shadow:0 0 0 5px rgba(67,189,240,.25),0 10px 28px rgba(8,107,199,.22) !important;
  min-height:64px !important;
  min-width:108px !important;
  z-index:30;
}
.map-shoe-badge {
  background:#086bc7 !important;
  color:#fff !important;
  font-size:.42rem !important;
}

.shoe-feature-summary.is-pick-summary {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
@media (max-width:760px) {
  .shoe-map { min-width:980px; }
  .shoe-feature-summary.is-pick-summary { grid-template-columns:1fr; }
}

/* YOUR PICK overlap fix */
.map-shoe.is-pick {
  transform:
    translate(-50%, 50%)
    translate(var(--pick-shift-x, 0px), var(--pick-shift-y, 0px)) !important;
}
.map-shoe.is-pick:hover,
.map-shoe.is-pick:focus-visible {
  transform:
    translate(-50%, 50%)
    translate(var(--pick-shift-x, 0px), var(--pick-shift-y, 0px))
    scale(1.06) !important;
  z-index: 60 !important;
}
.map-shoe.is-pick .map-shoe-badge {
  display: block !important;
  left: 50%;
  position: absolute;
  top: -13px;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 3;
}
@media (max-width:760px) {
  .map-shoe.is-pick {
    --pick-shift-x: 0px;
    --pick-shift-y: 0px;
  }
}

/* Automatic collision avoidance for all 34 chart labels */
.map-shoe,
.map-shoe.is-pick {
  transform:
    translate(-50%, 50%)
    translate(var(--auto-shift-x, 0px), var(--auto-shift-y, 0px)) !important;
  transition:
    transform .28s ease,
    box-shadow .2s ease,
    border-color .2s ease,
    opacity .2s ease;
}
.map-shoe:hover,
.map-shoe:focus-visible,
.map-shoe.is-pick:hover,
.map-shoe.is-pick:focus-visible {
  transform:
    translate(-50%, 50%)
    translate(var(--auto-shift-x, 0px), var(--auto-shift-y, 0px))
    scale(1.06) !important;
  z-index: 80 !important;
}

/* PICK remains prominent, but its larger size is included in collision solving. */
.map-shoe.is-pick {
  min-width: 108px !important;
  min-height: 64px !important;
  z-index: 40;
}

/* On narrow screens the map keeps a usable internal width and scrolls,
   so the solver has enough room rather than stacking labels. */
@media (max-width:760px) {
  .shoe-map-scroll {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:12px;
  }
  .shoe-map {
    min-width:1040px;
  }
}
