@import url("hotspots-shared.css");

:root {
  --accent: #DBFC35;
  --ink: #111111;
  --panel-gray: #dfdfdd;
  --dot-size: var(--shared-hotspot-dot-size, clamp(22px, 3vw, 36px));
  --hit-size: var(--shared-hotspot-hit-size, clamp(88px, 12vw, 144px));
  --label-title-size: var(--shared-hotspot-label-title-size, clamp(12px, 1.35vw, 18px));
  --label-pad-x: var(--shared-hotspot-label-pad-x, clamp(10px, 1.3vw, 16px));
  --label-title-pad-y: var(--shared-hotspot-label-title-pad-y, clamp(7px, 0.9vw, 10px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #f5f5f3;
  color: var(--ink);
  font-family: "Barlow", "DIN", "DIN Pro", "DIN 1451", "DIN Alternate", sans-serif;
}

html.is-embedded-accessories,
html.is-embedded-accessories body {
  min-height: 0;
}

.accessories-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

html.is-embedded-accessories .accessories-page {
  min-height: 0;
}

.accessories-left {
  position: relative;
  background: #f6f6f4;
  display: grid;
  align-content: start;
}

.accessories-header {
  display: grid;
  gap: 0;
}

.accessories-title-row {
  background: var(--accent);
}

.accessories-title {
  margin: 0;
  padding: clamp(18px, 2vw, 28px) clamp(18px, 2vw, 28px) clamp(12px, 1.2vw, 16px);
  background: transparent;
  font: 400 clamp(30px, 4vw, 56px) / 0.9 "Michroma", "Barlow", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.accessories-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 0;
  padding: 9px 12px;
  background: #111;
  color: #fff;
  font-size: clamp(14px, 1vw, 18px);
  line-height: 1;
  text-transform: uppercase;
}

.accessories-breadcrumbs[hidden] {
  display: none;
}

.accessories-breadcrumbs span {
  opacity: 0.92;
}

.accessories-breadcrumb-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 0.06em;
  opacity: 0.92;
}

.accessories-breadcrumb-link:hover,
.accessories-breadcrumb-link:focus-visible {
  opacity: 1;
}

.accessory-link[hidden] {
  display: none;
}

.accessories-breadcrumb-separator {
  opacity: 0.92;
  text-decoration: none;
}

.accessories-stage {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 0;
}

html.is-embedded-accessories .accessories-stage {
  min-height: 0;
}

.accessories-bike-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  container-type: inline-size;
}

html.is-embedded-accessories .accessories-bike-wrap {
  height: auto;
}

.accessories-bike {
  width: 100%;
  height: min(80vh, 820px);
  object-fit: contain;
  object-position: center center;
  display: block;
}

html.is-embedded-accessories .accessories-bike {
  height: auto;
  max-height: none;
}

.accessory-hotspots {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.accessory-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--hit-size);
  height: var(--hit-size);
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 1;
}

.accessory-hotspot.is-active,
.accessory-hotspot:hover,
.accessory-hotspot:focus-visible {
  z-index: 10;
}

.accessory-hotspot-hint {
  position: absolute;
  top: 50%;
  width: max-content;
  max-width: min(52ch, 86vw);
  transform: translateY(calc(-50% + var(--shared-hotspot-label-shift-closed, 4px)))
    scale(var(--shared-hotspot-label-scale-closed, 0.98));
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--shared-hotspot-label-transform-transition, 30ms ease);
  overflow: hidden;
}

.accessory-hotspot.label-right .accessory-hotspot-hint {
  left: var(--shared-hotspot-label-side-offset, calc(100% - 10px));
  transform-origin: left center;
}

.accessory-hotspot.label-left .accessory-hotspot-hint {
  right: var(--shared-hotspot-label-side-offset, calc(100% - 10px));
  transform-origin: right center;
}

.accessory-hotspot-hint-title {
  display: block;
  background: #111;
  color: #fff;
  padding: var(--label-title-pad-y) var(--label-pad-x);
  font-size: var(--label-title-size);
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.accessory-hotspot-hint-title::after {
  content: " →";
}

.accessory-hotspot-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot-size);
  height: var(--dot-size);
  transform: translate(-50%, -50%) scale(var(--shared-hotspot-dot-scale-closed, 1));
  transition: transform var(--shared-hotspot-dot-transition, 120ms ease);
}

.accessory-hotspot-dot::before,
.accessory-hotspot-dot::after {
  content: "";
  position: absolute;
  inset: 0;
}

.accessory-hotspot-dot::before {
  border-radius: 50%;
  background: var(--accent);
  opacity: 1;
  transition: opacity 120ms ease;
}

.accessory-hotspot-dot::after {
  background-position: center;
  background-repeat: no-repeat;
  background-image: var(--accessory-hotspot-icon, url("imgs/intern/plus.png"));
  background-size: var(--accessory-hotspot-icon-size, 70%);
}

.accessory-hotspot:hover .accessory-hotspot-dot,
.accessory-hotspot.is-active .accessory-hotspot-dot,
.accessory-hotspot:focus-visible .accessory-hotspot-dot {
  transform: translate(-50%, -50%) scale(var(--shared-hotspot-dot-scale-open, 3));
}

.accessory-hotspot:hover .accessory-hotspot-hint,
.accessory-hotspot.is-active .accessory-hotspot-hint,
.accessory-hotspot:focus-visible .accessory-hotspot-hint {
  opacity: 1;
  transform: translateY(-50%) scale(var(--shared-hotspot-label-scale-open, 1));
}

.accessories-right {
  position: relative;
  background: #d8d8d6;
  overflow: hidden;
}

.accessory-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 0;
}

.accessory-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.accessory-card {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(88%, 540px);
  z-index: 5;
}

.accessory-badge {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  background: #111;
  color: #fff;
  font-size: clamp(16px, 1.1vw, 24px);
  line-height: 1;
}

.accessory-card-body {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 2vw, 26px);
  background: var(--accent);
}

.accessory-copy {
  display: grid;
  gap: 8px;
}

.accessory-title {
  margin: 0;
  font-size: clamp(20px, 1.5vw, 30px);
  line-height: 1.05;
  font-weight: 400;
}

.accessory-details {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(15px, 1vw, 19px);
  line-height: 1.12;
}

.accessory-details li + li {
  margin-top: 4px;
}

.accessory-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
}

.accessory-bike-tag {
  display: grid;
  gap: 4px;
}

.accessory-bike-tag small {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.accessory-price {
  font: 400 clamp(24px, 2.5vw, 44px) / 0.95 "Michroma", "Barlow", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.accessory-link {
  align-self: center;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 1240px) {
  .accessories-page {
    grid-template-columns: 1fr;
  }

  .accessories-stage {
    min-height: auto;
  }

  .accessories-bike {
    height: auto;
    max-height: min(82vh, 980px);
  }

  .accessories-right {
    min-height: 56vh;
  }

  html.is-embedded-accessories .accessories-bike {
    max-height: clamp(500px, 74vw, 800px);
  }

  html.is-embedded-accessories .accessories-right {
    min-height: 0;
    aspect-ratio: 1 / 0.72;
  }

  .accessory-card {
    width: min(92%, 620px);
  }

  .accessory-hotspot-hint {
    left: 50%;
    right: auto;
    top: calc(50% - 18px);
    transform: translate(-50%, calc(-100% + var(--shared-hotspot-label-shift-closed, 4px)))
      scale(var(--shared-hotspot-label-scale-closed, 0.98));
    transform-origin: center bottom;
    max-width: min(52ch, 92vw);
  }

  .accessory-hotspot.label-right .accessory-hotspot-hint,
  .accessory-hotspot.label-left .accessory-hotspot-hint {
    left: 50%;
    right: auto;
  }

  .accessory-hotspot-hint-title::after {
    content: " ↓";
  }

  .accessory-hotspot:hover .accessory-hotspot-hint,
  .accessory-hotspot.is-active .accessory-hotspot-hint,
  .accessory-hotspot:focus-visible .accessory-hotspot-hint {
    transform: translate(-50%, -100%) scale(var(--shared-hotspot-label-scale-open, 1));
  }
}

@media (max-width: 767px) {
  :root {
    --dot-size: clamp(18px, 6vw, 24px);
    --hit-size: clamp(64px, 18vw, 88px);
    --label-title-size: clamp(10px, 2.7vw, 12px);
    --label-pad-x: 8px;
    --label-title-pad-y: 6px;
  }

  .accessories-breadcrumbs {
    margin-left: 0;
    font-size: 12px;
    padding: 8px 10px;
  }

  .accessory-card {
    position: absolute;
    width: 100%;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
  }

  .accessory-badge {
    position: absolute;
    width: fit-content;
    min-height: 30px;
    left: 0;
    bottom: 100%;
    padding: 0 10px;
    font-size: 13px;
    z-index: 3;
  }

  .accessory-card-body {
    gap: 8px;
    padding: 8px 10px 10px;
  }

  .accessory-copy {
    gap: 4px;
  }

  .accessory-title {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.06;
  }

  .accessory-details {
    display: none;
  }

  .accessory-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .accessory-bike-tag small {
    display: none;
  }

  .accessory-price {
    font-size: clamp(17px, 7vw, 22px);
    letter-spacing: 0.01em;
  }

  .accessory-link {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
    justify-self: end;
  }

  .accessory-hotspot-hint {
    width: max-content;
    max-width: min(32ch, calc(100vw - 28px));
    top: calc(50% - 12px);
  }

  .accessory-hotspot-hint-title {
    display: inline-block;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .accessories-right {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: clamp(250px, 42vh, 360px);
  }

  html.is-embedded-accessories .accessories-right {
    aspect-ratio: auto;
    min-height: clamp(250px, 42vh, 360px);
  }

  .accessory-visual {
    position: relative;
    inset: auto;
    min-height: 0;
  }

  .accessory-visual img {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
  }
}
