/* Purchase actions shared by catalog cards and the single-product page.
   Keep every purchase-state colour here so generic .button styles cannot make
   the desktop/mobile CTA drift back to the legacy black palette. */

/* Catalog cards ---------------------------------------------------------- */
.product-card__actions .button,
.product-card__actions .added_to_cart {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: var(--batya-control-compact) !important;
  min-height: var(--batya-control-compact) !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: var(--batya-radius-sm) !important;
  box-sizing: border-box;
  font-size: var(--batya-font-sm);
  font-weight: var(--batya-weight-semibold);
  line-height: 1 !important;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* Primary purchase action: normal brand orange, one darker brand step on
   hover/focus. This remains the strongest action in every product card. */
.product-card__actions .button {
  border: 1px solid var(--batya-brand) !important;
  background: var(--batya-brand) !important;
  color: #fff !important;
}

.product-card__actions .button:hover,
.product-card__actions .button:focus-visible {
  border-color: var(--batya-brand-dark) !important;
  background: var(--batya-brand-dark) !important;
  color: #fff !important;
}

.product-card__actions .add_to_cart_button.added,
.product-card__actions .ajax_add_to_cart.added {
  display: none !important;
}

/* Unavailable products are navigation, not a purchase action. Do not give
   "Подробнее" the same orange visual priority as an enabled Add to Cart CTA. */
.product-card.outofstock .product-card__actions .button {
  border: 1px solid var(--batya-border) !important;
  background: var(--batya-surface) !important;
  color: var(--batya-text) !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

.product-card.outofstock .product-card__actions .button:hover,
.product-card.outofstock .product-card__actions .button:focus-visible {
  border-color: var(--batya-border-strong) !important;
  background: var(--batya-surface-2) !important;
  color: var(--batya-text) !important;
}

/* After AJAX add the action changes meaning: it is confirmation/navigation,
   not another purchase CTA. Keep this secondary state visually stable on
   pointer hover; the pointer cursor communicates clickability and the global
   :focus-visible system still provides the keyboard focus ring. */
.product-card__actions .added_to_cart {
  border: 1px solid var(--batya-brand-border) !important;
  background: var(--batya-brand-soft) !important;
  color: var(--batya-brand-dark) !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

/* Explicitly neutralize later Woo/generic hover rules without suppressing the
   global outline used for keyboard focus. */
.product-card__actions .added_to_cart:hover,
.product-card__actions .added_to_cart:focus-visible {
  border-color: var(--batya-brand-border) !important;
  background: var(--batya-brand-soft) !important;
  color: var(--batya-brand-dark) !important;
}

/* Single product purchase surface ---------------------------------------
   The summary card already provides the white surface. Keep price, stock,
   quantity and pickup visually grouped through spacing/dividers instead of a
   second beige card nested inside it. */
.single-product-card .single-product-buybox {
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Single product: primary purchase action -------------------------------
   The floating mobile CTA mirrors the real product CTA, including its colour.
   The explicit sticky selector intentionally overrides the generic black
   .button/.button.alt rule from utilities.css. */
.single-product-card__cta .single_add_to_cart_button,
.single-sticky-bar__button {
  border: 1px solid var(--batya-brand) !important;
  background: var(--batya-brand) !important;
  color: #fff !important;
  font-size: var(--batya-font-base);
  font-weight: var(--batya-weight-semibold);
  box-shadow: none !important;
}

.single-product-card__cta .single_add_to_cart_button {
  width: 100%;
  min-height: 48px;
}

.single-product-card__cta .single_add_to_cart_button:hover,
.single-product-card__cta .single_add_to_cart_button:focus-visible,
.single-sticky-bar__button:hover,
.single-sticky-bar__button:focus-visible {
  border-color: var(--batya-brand-dark) !important;
  background: var(--batya-brand-dark) !important;
  color: #fff !important;
}

.single-product-card__cta .single_add_to_cart_button.loading,
.single-sticky-bar__button.loading {
  pointer-events: none;
  opacity: .72 !important;
}

.single-product-card__cta .single_add_to_cart_button.is-error,
.single-sticky-bar__button.is-error {
  border-color: var(--batya-danger-text) !important;
  background: var(--batya-danger-text) !important;
  color: #fff !important;
}

/* Single product: post-add navigation action ---------------------------- */
.single-product-card__cta .single_add_to_cart_button.is-added,
.single-product-card__cta .single_add_to_cart_button[data-batya-cart-ready="1"],
.single-sticky-bar__button.is-added,
.single-sticky-bar__button[data-batya-cart-ready="1"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  border: 2px solid var(--batya-brand) !important;
  background: transparent !important;
  color: var(--batya-brand-dark) !important;
  cursor: pointer !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

.single-product-card__cta .single_add_to_cart_button.is-added::before,
.single-product-card__cta .single_add_to_cart_button[data-batya-cart-ready="1"]::before,
.single-sticky-bar__button.is-added::before,
.single-sticky-bar__button[data-batya-cart-ready="1"]::before {
  content: none !important;
  display: none !important;
}

/* Deliberately no visual hover for the secondary cart-navigation state. */
.single-product-card__cta .single_add_to_cart_button.is-added:hover,
.single-product-card__cta .single_add_to_cart_button.is-added:focus-visible,
.single-product-card__cta .single_add_to_cart_button[data-batya-cart-ready="1"]:hover,
.single-product-card__cta .single_add_to_cart_button[data-batya-cart-ready="1"]:focus-visible,
.single-sticky-bar__button.is-added:hover,
.single-sticky-bar__button.is-added:focus-visible,
.single-sticky-bar__button[data-batya-cart-ready="1"]:hover,
.single-sticky-bar__button[data-batya-cart-ready="1"]:focus-visible {
  border-color: var(--batya-brand) !important;
  background: transparent !important;
  color: var(--batya-brand-dark) !important;
}

/* The full-width CTA is already the cart action; avoid a duplicate link. */
.single-product-card__feedback.is-success .single-product-card__feedback-link {
  display: none !important;
}

/* Product focus normalization -------------------------------------------
   The global accessibility ring in base.css is correct for keyboard focus.
   Chromium can, however, reclassify the element that already owns focus as
   :focus-visible after Alt+Tab/window activation. On selected product controls
   that creates a redundant second orange ring: the selected tab already has
   its active border and the active gallery thumbnail already has its orange
   selection frame. Suppress only that duplicate ring; inactive controls keep
   the global keyboard focus indicator. */
.single-product-tabs .woocommerce-tabs ul.tabs li.active > a:focus-visible,
.single-product-hero__gallery .flex-control-thumbs li.is-active img:focus-visible,
.single-product-hero__gallery .flex-control-thumbs img.flex-active:focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}
