/* Colours category — additions for the live category layout */

.colour-category-heading {
  margin-bottom: 22px;
}

.colour-heading-line {
  display: flex;
  align-items: center;
  gap: 20px;
}

.colour-heading-swatch {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  background: var(--swatch);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 17px;
  box-shadow:
    0 14px 30px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.colour-heading-line .category-heading,
.colour-heading-line h1 {
  min-width: 0;
}

.colour-tabs {
  display: grid;
  grid-template-columns: repeat(10, minmax(0,1fr));
  gap: 8px;
  margin: 0 0 22px;
  padding: 9px;
  background: linear-gradient(180deg, rgba(16,27,45,.96), rgba(8,16,29,.98));
  border: 1px solid var(--csp-line);
  border-radius: 12px;
}

.colour-tab {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 9px;
  overflow: hidden;
  color: #aeb8c7;
  background: rgba(7,16,31,.50);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 720;
  transition:
    color .16s ease,
    background .16s ease,
    border-color .16s ease,
    transform .16s ease;
}

.colour-tab:hover {
  color: #fff;
  background: rgba(24,40,66,.90);
  border-color: rgba(138,160,193,.24);
  transform: translateY(-2px);
}

.colour-tab.active {
  color: #fff;
  background: rgba(24,40,66,.98);
  border-color: var(--swatch);
  box-shadow:
    inset 0 -3px 0 var(--swatch),
    0 0 18px color-mix(in srgb, var(--swatch) 15%, transparent);
}

.colour-tab-swatch {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background: var(--swatch);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
}

.colour-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.colour-tab em {
  display: none;
}

/* Exact same toolbar sizing as the live category page. */
.colour-category-page .filters .control-wrap:nth-of-type(1) {
  flex: 0 0 190px;
}

.colour-category-page .filters .control-wrap:nth-of-type(2) {
  flex: 0 0 158px;
}

.colour-category-page .filters .control-wrap:nth-of-type(3) {
  flex: 1 1 360px;
}

.back-to-top {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 18px));
  z-index: 8500;
  min-width: 54px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  color: #f4f6fa;
  background: linear-gradient(180deg, rgba(19,32,54,.98), rgba(8,16,29,.995));
  border: 1px solid rgba(138,160,193,.22);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0,0,0,.38);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  pointer-events: none;
  transition:
    opacity .2s ease,
    visibility .2s ease,
    transform .2s ease,
    border-color .18s ease,
    background .18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: linear-gradient(180deg, rgba(25,42,69,.99), rgba(11,22,38,.995));
  border-color: var(--csp-accent);
}

.back-to-top-arrow {
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--csp-accent);
  border-left: 2px solid var(--csp-accent);
  transform: translateY(2px) rotate(45deg);
}

@media (max-width: 1180px) {
  .colour-tabs {
    grid-template-columns: repeat(5, minmax(0,1fr));
  }
}

@media (max-width: 700px) {
  .colour-heading-line {
    align-items: flex-start;
    gap: 14px;
  }

  .colour-heading-swatch {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 13px;
  }

  .colour-tabs {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .colour-tab {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .colour-category-page .filters .control-wrap:nth-of-type(1),
  .colour-category-page .filters .control-wrap:nth-of-type(2),
  .colour-category-page .filters .control-wrap:nth-of-type(3) {
    flex: 1 1 100%;
  }

  .back-to-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
  }

  .back-to-top-label {
    display: none;
  }
}


.colour-category-page [hidden] {
  display: none !important;
}
