.comte-market-chart-block {
  position: relative;
  margin: 20px auto 10px;
}

.comte-market-chart-block__scroll {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.comte-market-chart-scroll-button {
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 60px;
  height: auto;
  border: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  touch-action: pan-x;
}

.comte-market-chart-scroll-button--left {
  left: var(--comte-axis-width, 56px);
  background: linear-gradient(90deg, rgba(241, 241, 241, 1), rgba(241, 241, 241, 0.9) 45%, rgba(241, 241, 241, 0));
}

.comte-market-chart-scroll-button--right {
  right: 0;
  background: linear-gradient(90deg, rgba(241, 241, 241, 0), rgba(241, 241, 241, 0.9) 55%, rgba(241, 241, 241, 1));
}

.comte-market-chart-scroll-button:hover,
.comte-market-chart-scroll-button:active {
  box-shadow: none;
  filter: none;
}

.comte-market-chart-scroll-button--left:hover,
.comte-market-chart-scroll-button--left:active {
  background: linear-gradient(90deg, rgba(241, 241, 241, 1), rgba(241, 241, 241, 0.9) 45%, rgba(241, 241, 241, 0));
}

.comte-market-chart-scroll-button--right:hover,
.comte-market-chart-scroll-button--right:active {
  background: linear-gradient(90deg, rgba(241, 241, 241, 0), rgba(241, 241, 241, 0.9) 55%, rgba(241, 241, 241, 1));
}

.comte-market-chart-sticky-axis {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 8px;
  width: 0;
  opacity: 0;
  z-index: 20;
  pointer-events: none;
  background: #fff;
  transition: opacity 0.2s ease;
}

.comte-market-chart-sticky-axis__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.comte-market-chart-scroll-button::before {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  width: 28px;
  height: 28px;
  background: center / contain no-repeat url("../img/scroll-arrow.svg");
  border-radius: 50%;
  z-index: 31;
}

.comte-market-chart-scroll-button--left::before {
  left: 10px;
  transform: translateY(-50%) rotate(180deg);
}

.comte-market-chart-scroll-button--right::before {
  right: 10px;
  transform: translateY(-50%);
}

.comte-market-chart-scroll-button--left:hover::before,
.comte-market-chart-scroll-button--left:active::before {
  transform: translateY(-50%) rotate(180deg);
}

.comte-market-chart-scroll-button--right:hover::before,
.comte-market-chart-scroll-button--right:active::before {
  transform: translateY(-50%);
}

.comte-market-chart-scroll-button:focus-visible {
  outline: none;
}

.comte-market-chart-block.is-overflowing:not(.is-at-start) .comte-market-chart-scroll-button--left {
  opacity: 1;
  pointer-events: auto;
}

.comte-market-chart-block.is-overflowing:not(.is-at-end) .comte-market-chart-scroll-button--right {
  opacity: 1;
  pointer-events: auto;
}

.comte-market-chart-block.is-overflowing:not(.is-at-start) .comte-market-chart-sticky-axis {
  opacity: 1;
}

.comte-market-chart-scroll-button:focus-visible::before {
  outline: 2px solid rgba(115, 115, 115, 0.65);
  outline-offset: 2px;
}

.comte-market-chart-block__canvas-wrap {
  position: relative;
  min-width: 540px;
  height: 340px;
}

.comte-market-chart-block__canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.comte-market-chart-block--consumption .comte-market-chart-block__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.comte-market-chart-block__consumption-item {
  background-color: #f5f1e7;
  border-radius: 6px;
  padding: 16px;
}

.comte-market-chart-block__consumption-canvas {
  position: relative;
  height: 280px;
}

.comte-market-chart-block__consumption-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.comte-market-chart-block__consumption-label {
  color: #116a4d;
  font-weight: 700;
  margin: 10px 0 0;
  text-align: center;
}

@media (max-width: 767px) {
  .comte-market-chart-block__canvas-wrap {
    min-width: 640px;
    height: 300px;
  }

  .comte-market-chart-block--consumption .comte-market-chart-block__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .comte-market-chart-block__consumption-canvas {
    height: 240px;
  }

  .comte-market-chart-scroll-button {
    width: 54px;
  }

  .comte-market-chart-scroll-button--left::before {
    left: 8px;
    width: 24px;
    height: 24px;
  }

  .comte-market-chart-scroll-button--right::before {
    right: 8px;
    width: 24px;
    height: 24px;
  }
}
