/* Alpha Storefront UI: presentation only. No provider/account/card styling. */
#asui-root,
#asui-root * {
  box-sizing: border-box;
}

#asui-root .asui-dialog[hidden] {
  display: none !important;
}

#asui-root .asui-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid #555;
  border-top: 4px solid #c62828;
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 64px rgb(0 0 0 / 55%);
  font-family: inherit;
  text-align: center;
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: dark;
}

#asui-root .asui-dialog::backdrop {
  background: rgb(0 0 0 / 78%);
}

#asui-root .asui-rewards {
  margin-top: auto;
  margin-bottom: max(16px, env(safe-area-inset-bottom));
}

#asui-root .asui-card {
  position: relative;
  padding: 36px 28px 28px;
}

#asui-root .asui-logo {
  display: block;
  width: min(260px, 80%);
  height: auto;
  max-height: 100px;
  margin: 0 auto 24px;
  object-fit: contain;
}

#asui-root .asui-title {
  margin: 0 0 16px;
  padding: 0;
  color: #fff;
  font-family: inherit;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
}

#asui-root .asui-copy {
  margin: 0 0 24px;
  color: #fff;
  font-size: 16px;
  line-height: 1.6;
}

#asui-root .asui-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

#asui-root .asui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 48px;
  margin: 0;
  padding: 12px 24px;
  border: 1px solid #c62828;
  border-radius: 4px;
  background: #c62828;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

#asui-root .asui-button-secondary {
  border-color: #fff;
  background: #111;
}

#asui-root .asui-button:hover {
  border-color: #fff;
  background: #a92020;
  color: #fff;
}

#asui-root .asui-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

#asui-root .asui-button:focus-visible,
#asui-root .asui-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Class-only locking leaves every existing inline overflow value/priority intact. */
html.asui-modal-open,
html.asui-modal-open body {
  overflow: hidden !important;
}

/* Exact confirmed native launcher. Hide, never click or reconfigure it. */
html.asui-modal-open #wll-site-launcher {
  display: none !important;
}

/* Public DOM-verified native button: keep its native position and click flow. */
#wll-site-launcher .wll-launcher-button-container {
  min-width: 44px;
  min-height: 44px;
  background: #c62828 !important;
  color: #fff !important;
}

/* Exact Alpha Search overlay state. No launcher suppression on normal pages.
 * :has is CSS-only, so no native provider events/state are touched.
 */
body:has(.aps-results.aps-is-open:not(.aps-inline-results):not([hidden])) #wll-site-launcher,
body:has(.aps-filters.is-open) #wll-site-launcher {
  display: none !important;
}

/* Older browsers without HTMLDialogElement.showModal use a local fixed dialog. */
#asui-root .asui-dialog.asui-fallback {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 78%);
}

@media (max-width: 480px) {
  #asui-root .asui-card {
    padding: 40px 20px 24px;
  }

  #asui-root .asui-actions {
    gap: 12px;
  }

  #asui-root .asui-actions .asui-button {
    flex: 1;
    min-width: 0;
  }
}

/* Verified native card actions only. Preserve native fallback labels/links,
 * colors, borders, stock messages, event wiring and Alpha Search styles.
 */
body.single-product.elementor-page-320
  .ap-woo-product__related-products .related ul.products
  > li.product > a.button,
body.home.page-id-20
  .ap-featured-apparel-grid.elementor-element-f26e8a2 ul.products
  > li.product > a.button {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 48px !important;
  height: auto !important;
  max-height: none !important;
  flex-shrink: 0 !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 18px !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Existing related cards are flex columns. Grow the verified loop link so
 * full-length titles stay intact; optional below-button scarcity stays intact.
 * This is not a guarantee of identical button positions with different extras.
 */
body.single-product.elementor-page-320
  .ap-woo-product__related-products .related ul.products
  > li.product > a.woocommerce-LoopProduct-link.woocommerce-loop-product__link {
  flex: 1 1 auto !important;
}

/* 0.1.1: mobile promotion sits inside the visible screen, not behind Safari chrome. */
@media (max-width: 767px) {
  #asui-root .asui-dialog.asui-rewards {
    position: fixed;
    inset: auto;
    top: var(--asui-rewards-center, 50%);
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    width: min(560px, calc(100% - 32px));
    max-height: calc(var(--asui-rewards-visible-height, 100dvh) - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #asui-root .asui-rewards .asui-card { padding: 40px 20px 22px; }
  #asui-root .asui-rewards .asui-logo { width: min(200px, 75%); margin-bottom: 16px; }
  #asui-root .asui-rewards .asui-title { font-size: 20px; margin-bottom: 12px; }
  #asui-root .asui-rewards .asui-copy { font-size: 15px; line-height: 1.45; margin-bottom: 18px; }
}
@media (max-width: 767px) and (max-height: 480px) {
  #asui-root .asui-rewards .asui-card { padding: 34px 18px 16px; }
  #asui-root .asui-rewards .asui-logo { width: 160px; max-height: 42px; margin-bottom: 10px; }
  #asui-root .asui-rewards .asui-title { font-size: 18px; margin-bottom: 8px; }
  #asui-root .asui-rewards .asui-copy { font-size: 14px; margin-bottom: 10px; }
}
