/* AYESH 1.0.49 — reference-inspired product purchase controls.
 * Fix: WooCommerce does not wrap the product detail in a descendant .woocommerce element.
 * Use the actual #hb-main-content > div.product hierarchy to match live DOM.
 * Scoped ID also wins over inherited !important full-width single Add-to-Cart rules.
 * Limited to single-product pages; uses existing native WooCommerce submits.
 * Do not globally override product-loop buttons. */
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions,
html body.single-product #hb-main-content div.product div.summary form.variations_form .ayesh-p148-purchase-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px !important;
  align-items: stretch;
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button, button.ayesh-p5-buy-now),
html body.single-product #hb-main-content div.product div.summary form.variations_form .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button, button.ayesh-p5-buy-now) {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 62px !important;
  min-height: 62px !important;
  min-width: 0 !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  box-sizing: border-box !important;
  border: 1px solid #C91524 !important;
  border-radius: 12px !important;
  background-image: none !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-transform: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
  white-space: normal;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button {
  background: #fff !important;
  background-color: #fff !important;
  color: #C91524 !important;
  -webkit-text-fill-color: #C91524 !important;
}
/* Remove the old cart glyph: reference shows text-only action. */
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button::before {
  content: none !important;
  display: none !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now {
  background: #C91524 !important;
  background-color: #C91524 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (hover: hover) and (pointer: fine) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button:hover:not(:disabled):not(.disabled) {
    border-color: #A4101E !important;
    background: #FFF3F5 !important;
    color: #A4101E !important;
    -webkit-text-fill-color: #A4101E !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now:hover:not(:disabled):not(.disabled) {
    background: #A4101E !important;
    border-color: #A4101E !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button, button.ayesh-p5-buy-now):focus-visible,
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > a.ayesh-p148-mobile-chat:focus-visible {
  outline: 3px solid #141414 !important;
  outline-offset: 3px !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button:disabled,
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.disabled {
  opacity: .52 !important;
  cursor: not-allowed !important;
}
/* Visible in the native form only on mobile; never shown on desktop. */
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > .ayesh-p148-mobile-chat {
  display: none !important;
}

/* The existing mobile sticky bar reuses its native action forwarding and one
 * WhatsApp support link. There is no additional fixed bar. */
@media (max-width: 800px) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions,
  html body.single-product #hb-main-content div.product div.summary form.variations_form .ayesh-p148-purchase-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px;
    gap: 8px !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button,button.ayesh-p5-buy-now) {
    height: 52px !important;
    min-height: 52px !important;
    font-size: clamp(12px,3.7vw,15px) !important;
    padding: 8px 6px !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > .ayesh-p148-mobile-chat {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 0;
    min-height: 52px;
    color: #2F3136;
    -webkit-text-fill-color: #2F3136;
    background: #fff;
    border: 1px solid #C91524;
    border-radius: 12px;
    text-decoration: none;
    box-sizing: border-box;
    touch-action: manipulation;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-mobile-chat img.ayesh-support-icon-img {
    width: 28px;
    height: 28px;
    max-width: 100%;
    display: block;
    object-fit: contain;
  }
  html body.single-product .ayesh-p5-sticky {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 52px;
    gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom,0px));
    bottom: var(--ayesh-p5-bottom-offset, 0px);
  }
  html body.single-product .ayesh-p5-sticky > :is(button,a) {
    height: 52px;
    min-height: 52px;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: clamp(12px,3.7vw,15px);
    font-weight: 700;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    transition: background-color 160ms ease, border-color 160ms ease;
  }
  html body.single-product .ayesh-p5-sticky__add {
    border: 1px solid #C91524;
    background: #fff;
    color: #C91524;
    -webkit-text-fill-color: #C91524;
  }
  html body.single-product .ayesh-p5-sticky__buy {
    border: 1px solid #C91524;
    background: #C91524;
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
  html body.single-product .ayesh-p5-sticky__support {
    border: 1px solid #C91524;
    background: #fff;
    color: #2F3136;
    -webkit-text-fill-color: #2F3136;
  }
  html body.single-product .ayesh-p5-sticky__support img.ayesh-support-icon-img { width: 28px; height: 28px; display: block; object-fit: contain; max-width: 100%; }
  html body.single-product .ayesh-p5-sticky :is(button,a):focus-visible { outline: 3px solid #141414; outline-offset: 2px; }
  html body.single-product .ayesh-p5-sticky button:disabled { opacity: .5; cursor: not-allowed; }
  html body.single-product { padding-bottom: calc(90px + env(safe-area-inset-bottom,0px) + var(--ayesh-p5-bottom-offset,0px)) !important; }
}
@media (max-width: 360px) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions,
  html body.single-product #hb-main-content div.product div.summary form.variations_form .ayesh-p148-purchase-actions {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 46px;
    gap: 6px !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > .ayesh-p148-mobile-chat {
    width: 46px;
    min-height: 50px;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button,button.ayesh-p5-buy-now) {
    min-height: 50px !important;
    height: 50px !important;
    font-size: 12px !important;
  }
  html body.single-product .ayesh-p5-sticky { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 46px; gap: 6px; padding-inline: 8px; }
  html body.single-product .ayesh-p5-sticky > :is(button,a) { min-height: 50px; height: 50px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > :is(button.single_add_to_cart_button,button.ayesh-p5-buy-now),
  html body.single-product .ayesh-p5-sticky > :is(button,a) { transition: none !important; }
}

/* v1.0.55 — exact reference purchase-button finish, after legacy overrides.
 * Target the live WooCommerce single product form; preserve submit behavior,
 * quantity controls, variation validation and the mobile headset/chat action. */
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  margin-inline: 0 !important;
  padding: 0 !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button,
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now {
  flex: none !important;
  grid-column: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 62px !important;
  min-height: 62px !important;
  padding: 8px 14px !important;
  margin: 0 !important;
  border: 1px solid #C91524 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background-image: none !important;
  font-size: 17px !important;
  line-height: 1.3 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button {
  font-weight: 500 !important;
  background: #FFF !important;
  color: #C91524 !important;
  -webkit-text-fill-color: #C91524 !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button::before,
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button::after {
  content: none !important;
  display: none !important;
}
html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now {
  font-weight: 700 !important;
  background: #C91524 !important;
  color: #FFF !important;
  -webkit-text-fill-color: #FFF !important;
}
@media (hover:hover) and (pointer:fine) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button:hover:not(:disabled):not(.disabled) {
    background: #FFF2F4 !important;
    color: #AB1320 !important;
    -webkit-text-fill-color: #AB1320 !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now:hover:not(:disabled):not(.disabled) {
    background: #A4101E !important;
    border-color: #A4101E !important;
  }
}
/* Mobile maintains the previously approved Chat action to the right of Buy Now. */
@media (max-width:800px) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 52px !important;
    gap: 8px !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button,
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now {
    height: 52px !important;
    min-height: 52px !important;
    font-size: clamp(12px,3.7vw,15px) !important;
    padding: 8px 6px !important;
  }
}
@media (max-width:360px) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 46px !important;
    gap: 6px !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button,
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.ayesh-p5-buy-now {
    height: 50px !important;
    min-height: 50px !important;
    font-size: 12px !important;
  }
}

/* v1.0.60: mobile uses one purchase surface only.
 * Native WooCommerce buttons and the quantity input remain inside form.cart
 * to preserve selected variation, submitter name, session and stock handling.
 * Hide redundant in-body controls only after the sticky click-forwarding JS
 * confirms that the two native buttons and two sticky buttons are present.
 * Desktop and non-JS mobile keep the ordinary native form accessible. */
@media (max-width: 800px) {
  /* No-JS/failure fallback: use native form instead of a dead fixed bar. */
  html body.single-product .ayesh-p5-sticky {
    display: none !important;
  }
  html body.single-product.ayesh-p160-sticky-ready:not(.ayesh-p5-keyboard-open) .ayesh-p5-sticky {
    display: grid !important;
  }
  html body.single-product.ayesh-p160-sticky-ready .woocommerce div.product div.summary form.cart .ayesh-p148-purchase-actions,
  html body.single-product.ayesh-p160-sticky-ready #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions {
    display: none !important;
  }
  html body.single-product.ayesh-p160-sticky-ready .woocommerce div.product div.summary form.cart .hb-qty-label,
  html body.single-product.ayesh-p160-sticky-ready .woocommerce div.product div.summary form.cart .quantity,
  html body.single-product.ayesh-p160-sticky-ready #hb-main-content div.product div.summary form.cart .hb-qty-label,
  html body.single-product.ayesh-p160-sticky-ready #hb-main-content div.product div.summary form.cart .quantity {
    display: none !important;
  }
  /* Prevent a blank simple-product form panel after its controls vanish.
   * Variable-product selectors stay visible and retain their spacing. */
  html body.single-product.ayesh-p160-sticky-ready #hb-main-content div.product div.summary form.cart:not(.variations_form) {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
  }
  /* Keep the returns policy visible; avoid a duplicate body WhatsApp action. */
  html body.single-product.ayesh-p160-sticky-ready .ayesh-p5-service-links > a[data-ayesh-sux-product-chat] {
    display: none !important;
  }
  /* Mobile keyboard focus must still hide the sticky purchase bar. */
  html body.single-product.ayesh-p160-sticky-ready.ayesh-p5-keyboard-open .ayesh-p5-sticky {
    display: none !important;
  }
}

/* v1.0.69 — Desktop-only outline Add to Cart.
 * Older WooCommerce/legacy theme styles can repaint .button.alt as crimson.
 * Override both the reference-action wrapper and the ordinary WooCommerce
 * button selector, without changing native form submission or mobile sticky UI.
 */
@media (min-width: 801px) {
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button.button.alt,
  html body.single-product #hb-main-content div.product div.summary form.cart button.single_add_to_cart_button.button.alt,
  html body.single-product .woocommerce div.product div.summary form.cart button.single_add_to_cart_button.button.alt {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    color: #C91524 !important;
    -webkit-text-fill-color: #C91524 !important;
    border: 1px solid #C91524 !important;
    box-shadow: none !important;
  }
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button.button.alt::before,
  html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button.button.alt::after {
    content: none !important;
    display: none !important;
  }
  @media (hover: hover) and (pointer: fine) {
    html body.single-product #hb-main-content div.product div.summary form.cart .ayesh-p148-purchase-actions > button.single_add_to_cart_button.button.alt:hover:not(:disabled):not(.disabled),
    html body.single-product #hb-main-content div.product div.summary form.cart button.single_add_to_cart_button.button.alt:hover:not(:disabled):not(.disabled),
    html body.single-product .woocommerce div.product div.summary form.cart button.single_add_to_cart_button.button.alt:hover:not(:disabled):not(.disabled) {
      background: #FFF3F5 !important;
      background-color: #FFF3F5 !important;
      color: #A4101E !important;
      -webkit-text-fill-color: #A4101E !important;
      border-color: #A4101E !important;
    }
  }
}
