/* Shared compatibility and finishing layer for curated catalog themes. */
html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) {
  --primary-2: color-mix(in srgb, var(--primary) 68%, #07110c);
}

html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) :is(.catalog-location-link, .catalog-socials a, .category-menu-trigger, .collection-filter) {
  border-color: var(--line);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) :is(.catalog-location-link, .catalog-socials a, .category-menu-trigger, .collection-filter):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
}

html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) .product-detail-label {
  border-color: var(--line);
  background: color-mix(in srgb, var(--primary) 5%, var(--card));
}

html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) .product-detail-label > span {
  color: var(--on-primary);
  background: var(--primary);
}

html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) :is(.category-menu, .catalog-location-card, .rating-card, .sheet-card) {
  color: var(--ink);
  border-color: var(--line);
  background-color: var(--card);
}

html[data-catalog-theme="onyx-oro"] :is(.price-wrap strong, .product-category, .catalog-location-link),
html[data-catalog-theme="flow-calle"] :is(.price-wrap strong, .product-category, .catalog-location-link) {
  color: var(--primary);
}

/* Navigation stays crisp and tactile without theme glows leaking outside controls. */
html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) .catalog-header :is(.icon-button, .cart-button, .catalog-socials a, .catalog-location-link),
html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) .catalog-header :is(.icon-button, .cart-button, .catalog-socials a, .catalog-location-link):hover,
html:is(
  [data-catalog-theme="tech-blue"],
  [data-catalog-theme="onyx-oro"],
  [data-catalog-theme="flow-calle"],
  [data-catalog-theme="ember"],
  [data-catalog-theme="algodon-de-azucar"]
) .catalog-controls :is(.category-menu-trigger, .collection-filter, .category-strip button) {
  box-shadow: none;
  filter: none;
}

/* Preserve every effect while it is visible, but stop compositor work when the
   tab is hidden or the animated hero is well outside the viewport. */
html.catalog-motion-paused[data-theme]:not([data-theme="original"]) *,
html.catalog-motion-paused[data-theme]:not([data-theme="original"]) *::before,
html.catalog-motion-paused[data-theme]:not([data-theme="original"]) *::after,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero *,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero::before,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero::after,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero *::before,
html.catalog-hero-offscreen[data-theme]:not([data-theme="original"]) .store-hero *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  html:is(
    [data-catalog-theme="tech-blue"],
    [data-catalog-theme="onyx-oro"],
    [data-catalog-theme="flow-calle"],
    [data-catalog-theme="ember"],
    [data-catalog-theme="algodon-de-azucar"]
  ) *,
  html:is(
    [data-catalog-theme="tech-blue"],
    [data-catalog-theme="onyx-oro"],
    [data-catalog-theme="flow-calle"],
    [data-catalog-theme="ember"],
    [data-catalog-theme="algodon-de-azucar"]
  ) *::before,
  html:is(
    [data-catalog-theme="tech-blue"],
    [data-catalog-theme="onyx-oro"],
    [data-catalog-theme="flow-calle"],
    [data-catalog-theme="ember"],
    [data-catalog-theme="algodon-de-azucar"]
  ) *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
