/**
 * Emergency frontend hotfixes (loaded last).
 */

/* Mini-cart must be right-side drawer, not bottom sheet. */
body.sk-new-header .astra-mobile-cart-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
}

/* Never show cart backdrop unless Astra marks cart as active. */
html:not(.ast-mobile-cart-active) body.sk-new-header .astra-mobile-cart-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.ast-mobile-cart-active body.sk-new-header .astra-mobile-cart-overlay {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Global guard: if any script leaves cart state stale, don't keep blur visible. */
html:not(.ast-mobile-cart-active) .astra-mobile-cart-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

body.sk-new-header .astra-cart-drawer,
body.sk-new-header #astra-mobile-cart-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  width: min(420px, 92vw) !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  transform: translateX(100%) !important;
  transition: transform 0.28s ease !important;
  z-index: 9999 !important;
}

body.sk-new-header .astra-cart-drawer.active,
body.sk-new-header #astra-mobile-cart-drawer.active {
  transform: translateX(0) !important;
}

/* Product summary border removal. */
body.sk-product-page .woocommerce div.product .summary,
body.sk-product-page .sk-product__summary {
  border: 0 !important;
  box-shadow: none !important;
}

/* PDP add-to-cart default/hover state requested by user. */
body.sk-product-page .sk-product__summary .single_add_to_cart_button,
body.sk-product-page .sk-product__summary form.cart .button.single_add_to_cart_button {
  border: 1.5px solid #111111 !important;
  background: #ffffff !important;
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
}

body.sk-product-page .sk-product__summary .single_add_to_cart_button:hover,
body.sk-product-page .sk-product__summary .single_add_to_cart_button:focus-visible,
body.sk-product-page .sk-product__summary form.cart .button.single_add_to_cart_button:hover,
body.sk-product-page .sk-product__summary form.cart .button.single_add_to_cart_button:focus-visible {
  border-color: #111111 !important;
  background: #111111 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Also keep loop add-to-cart in same black-outline visual language. */
body .woocommerce ul.products li.product .button,
body .woocommerce ul.products li.product .add_to_cart_button,
body .woocommerce ul.products li.product .added_to_cart {
  border: 1px solid #111111 !important;
  background: #ffffff !important;
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
}

body .woocommerce ul.products li.product .button:hover,
body .woocommerce ul.products li.product .add_to_cart_button:hover,
body .woocommerce ul.products li.product .added_to_cart:hover {
  border-color: #111111 !important;
  background: #111111 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Reduce excess whitespace before footer on regular pages. */
body.page:not(.woocommerce-page):not(.single-product):not(.home) .site-content {
  padding-bottom: clamp(12px, 1.6vw, 20px) !important;
}

/* Preserve mobile sticky dock spacing only on mobile PDP. */
@media (min-width: 1024px) {
  body.sk-product-page .sk-product {
    padding-bottom: 24px !important;
  }
}

/* Consent Suite safety: hidden overlay must always be non-blocking. */
.tscs-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Keep only strict hidden-state rule so popup can render normally when needed. */
