/* ==========================================================================
   DESIGN EXTRAS - parts of the HTML design rebuilt on WordPress output:
   stock bar, dispatch line, review summary, login/register layout, cart
   shipping bar, blog toolbar, callout, active filter chips.
   ========================================================================== */

/* Stock (WooCommerce availability in the design's .stock component) */
.stock {
  &--in .stock__dot,
  &.in-stock .stock__dot {
    background-color: var(--color-success);
  }

  &--low .stock__dot {
    background-color: var(--color-secondary);
  }

  &--out {
    color: var(--color-sale);

    .stock__dot {
      background-color: var(--color-sale);

      &::after {
        animation: none;
      }
    }
  }

  &__text p {
    margin: 0;
  }

  .stock__fill {
    transform: scaleX(var(--value, 0.3));
  }
}

.single_variation_wrap .stock,
form.cart .stock {
  margin-bottom: var(--space-2);
}

/* Dispatch countdown */
.pdp-info .delivery {
  margin-top: calc(var(--space-1) * -1);

  .js-countdown:empty {
    display: none;
  }
}

/* Login / register (WooCommerce My account, logged out) */
.auth--wc {
  padding-block: 0 var(--space-4);

  .auth__title {
    margin-top: 0;
  }

  .auth__view[hidden] {
    display: none;
  }

  .auth__form {
    .form-row {
      margin-bottom: var(--space-2);
    }

    .auth__label-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: var(--space-1);
    }

    .woocommerce-form-login__rememberme {
      margin-bottom: var(--space-3);
    }
  }

  .auth__note {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
  }

  .woocommerce-privacy-policy-text {
    margin-bottom: var(--space-2);
  }
}

.woocommerce-account:not(.logged-in) .shop-page__content > .woocommerce {
  display: block;
}

/* Same top spacing as the design's login page */
.woocommerce-account:not(.logged-in) .shop-page.pt-3 {
  padding-top: 1rem !important;
}

/* Free-shipping bar above the cart */
.ship-progress--page {
  max-width: 40rem;
  margin-bottom: var(--space-4);
}

/* Blog toolbar: categories, count, formats */
.blog-toolbar {
  .format-filter--formats {
    flex-basis: 100%;
  }

  .chip--format .icon {
    width: var(--icon-xs);
    height: var(--icon-xs);
  }
}

.post-featured + .blog-toolbar {
  margin-top: var(--space-6);
}

/* Callout paragraph style (block style "Callout") */
p.is-style-aurelle-callout,
.callout {
  position: relative;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-8);
  border-radius: var(--radius-xl);
  background-color: var(--color-section-sage);
  color: var(--color-text);
}

p.is-style-aurelle-callout::before {
  content: '';
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  width: 1.5rem;
  height: 1.5rem;
  background-color: var(--color-secondary);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

/* Active filters (WooCommerce "Active product filters" widget / block) */
.widget_layered_nav_filters ul,
.wc-block-active-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;

  li {
    padding: 0;
  }

  a,
  .wc-block-active-filters__list-item-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-0-5);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    text-decoration: none;

    &::after {
      content: '×';
      font-size: var(--font-size-sm);
      line-height: 1;
    }
  }
}

/* Shop promo tile from the plugin sits in the product list */
ul.products > .product-grid__promo {
  display: flex;
  list-style: none;

  > .promo-tile {
    flex: 1;
  }
}

/* WooCommerce gives each review <li> the class "review", which the design
   styles as a card: keep only the inner card. */
.pdp-reviews .commentlist > li.review {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.auth--wc form.auth__form {
  margin: 0;
  padding: 0;
  border: 0;
}
