/* =========================================================
   HERZITE v2 – WordPress / WooCommerce additions
   (loaded after the page stylesheet on redesigned pages only)
   ========================================================= */

/* sticky header below the admin toolbar */
.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* counts come from the server now, not CSS counters */
.header-tools .tool-likes .count::after {
  content: none;
}

.header-tools .count:empty,
.header-tools .tool-likes .count[data-zero] {
  display: none;
}

button.tool {
  color: inherit;
}

/* language + currency list */
.header-tools .lang ul {
  max-height: min(70vh, 460px);
  overflow-y: auto;

  .sep {
    height: 1px;
    margin: 6px 0;
    padding: 0;
    background: var(--color-border);
  }

  a[aria-current="true"] {
    font-weight: 600;
  }
}

/* search bar under the header */
.hz2-search {
  position: absolute;
  inset: 100% 0 auto;
  z-index: 2;
  padding-block: var(--space-4);
  background: var(--color-surface, #fff);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 24px 40px rgb(8 17 27 / 0.06);

  &[hidden] {
    display: none;
  }

  .container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }

  input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    font: inherit;
    font-size: var(--fs-md);
    background: none;
    border: 0;
    outline: 0;
  }

  .close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;

    &:hover {
      background: var(--color-surface-muted);
    }
  }
}

/* liked / saved states driven by JS */
.like {
  padding: 0;
  font: inherit;
  background: none;
  border: 0;

  &.is-liked {
    --liked: 1;
  }
}

.pcard .wish,
.product .wish {
  &.is-on .icon {
    fill: currentColor;
  }

  &.is-on {
    opacity: 1;
    transform: none;
  }
}

.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

/* WooCommerce notices on redesigned pages */
.hz2 .woocommerce-notices-wrapper:not(:empty) {
  margin-block: var(--space-5);
}

.hz2 :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  list-style: none;
  background: var(--color-surface-soft, #f6f7f8);
  border-left: 3px solid var(--color-text);

  .button {
    order: 2;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

.hz2 .woocommerce-error {
  border-left-color: #b42318;
}

/* pagination (shop + blog) */
.hz2-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);

  .page-numbers {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding-inline: var(--space-3);
    font-size: var(--fs-sm);
    border: 1px solid var(--color-border);
    transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);

    &:hover {
      border-color: var(--color-text);
    }

    &.current {
      color: var(--c-white, #fff);
      background: var(--color-text);
      border-color: var(--color-text);
    }

    &.dots {
      border-color: transparent;
    }
  }
}

/* newsletter feedback */
[data-subscribe-note].is-ok {
  color: var(--color-text);
}

[data-subscribe-note] code,
.hz2-code {
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--color-surface-muted, #eef0f2);
}

/* WordPress / WooCommerce screen-reader text */
.hz2 .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* honeypot */
.hz2-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* the rotating dashed ring around the bead preview must not widen the page on phones */
.studio {
  overflow-x: clip;
}
