/* JamboMart - Mobile Product Description + Sticky Price */

@media (max-width: 767px) {

  /* Description images - full width like Shopify */
  body.single-product .woocommerce-product-details__short-description img,
  body.single-product .woocommerce-Tabs-panel--description img,
  body.single-product .entry-content img,
  body.single-product .hx-desc img,
  body.single-product .hx-description img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }

  /* Remove restrictive image wrappers */
  body.single-product .woocommerce-Tabs-panel--description figure,
  body.single-product .entry-content figure,
  body.single-product .hx-desc figure,
  body.single-product .hx-description figure {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Ensure price numbers use left-to-right direction */
  body.single-product .hx-sticky,
  body.single-product .hx-sticky-bar {
    direction: ltr !important;
  }

  body.single-product .hx-sticky__price,
  body.single-product .hx-sticky-price,
  body.single-product .hx-sticky-bar__price {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    white-space: nowrap !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
  }
}

/* JamboMart - Full Width Description Images */
body.single-product .hx-product__desc img:not(.emoji) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

body.single-product .hx-product__desc figure,
body.single-product .hx-product__desc .wp-block-image {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}


/* JamboMart - Natural Shopify-style Description Images */

body.single-product .hx-product__desc {
  text-align: center !important;
}

body.single-product .hx-product__desc img:not(.emoji) {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}

body.single-product .hx-product__desc figure,
body.single-product .hx-product__desc .wp-block-image {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

body.single-product .hx-product__desc p:has(> img) {
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product .hx-product__desc figure img {
  margin: 0 auto !important;
}


/* JamboMart - Center product description images on desktop only */
@media (min-width: 768px) {

  body.single-product .hx-product__desc {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  body.single-product .hx-product__desc img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    clear: both !important;
    max-width: 100% !important;
    height: auto !important;
  }

  body.single-product .hx-product__desc p:has(> img) {
    text-align: center !important;
  }

}

/* JamboMart - Full width centered description */
@media (min-width: 768px) {
  body.single-product .jm-description-full {
    width: 100% !important;
    max-width: 900px !important;
    margin: 45px auto 60px !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
  }

  body.single-product .jm-description-full .hx-product__desc {
    width: 100% !important;
    text-align: center !important;
  }

  body.single-product .jm-description-full img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    float: none !important;
  }
}

/* JamboMart - Sticky Buy Price Direction Fix */
@media (max-width: 749px) {
  body.single-product .hx-sbuy__price {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  body.single-product .hx-sbuy__price .hx-pp__now,
  body.single-product .hx-sbuy__price .hx-pp__num,
  body.single-product .hx-sbuy__price .hx-pp__cur {
    direction: ltr !important;
    unicode-bidi: isolate !important;
  }
}

/* JamboMart - Match Sticky Button with COD Form Button */
@media (max-width: 749px) {
  body.single-product .hx-sbuy__btn {
    background: var(--hx-primary) !important;
    color: #ffffff !important;
  }
}

/* JamboMart - Mobile Announcement Bar Readability */
@media (max-width: 749px) {
  body .jm-announcement {
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.15px !important;
    padding: 9px 8px !important;
    text-align: center !important;
  }
}

/* JamboMart - Larger Announcement Text Only */
@media (max-width: 749px) {
  body .jm-announcement {
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 6px 8px !important;
    line-height: 1.2 !important;
  }
}

/* JamboMart - Reduce description bottom spacing on all screens */
body.single-product .jm-description-full {
    margin-bottom: 8px !important;
}

/* JamboMart - Remove extra space before footer on mobile */
@media (max-width: 749px) {
  body.single-product .jm-description-full,
  body.single-product .jm-description-full .hx-product__desc,
  body.single-product .jm-description-full .hx-product__desc > :last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.single-product .hx-main {
    padding-bottom: 0 !important;
  }
}

/* JamboMart - Sticky CTA Soft Pulse Animation */
@media (max-width: 749px) {

  body.single-product .hx-sbuy__btn {
    animation: jmStickyPulse 3s ease-in-out infinite !important;
    transform-origin: center;
    will-change: transform;
  }

  body.single-product .hx-sbuy__btn:active {
    animation: none !important;
    transform: scale(0.97);
  }
}

@keyframes jmStickyPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 150, 60, 0.15);
  }

  50% {
    transform: scale(1.025);
    box-shadow: 0 6px 20px rgba(0, 150, 60, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-product .hx-sbuy__btn {
    animation: none !important;
  }
}

/* JamboMart - Faster, lighter sticky CTA animation */
@media (max-width: 749px) {
  body.single-product .hx-sbuy__btn {
    animation: jmStickyQuickPulse 1.4s ease-in-out infinite !important;
    will-change: transform;
  }
}

@keyframes jmStickyQuickPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 3px 9px rgba(0, 150, 60, 0.12);
  }

  50% {
    transform: scale(1.015);
    box-shadow: 0 4px 12px rgba(0, 150, 60, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-product .hx-sbuy__btn {
    animation: none !important;
  }
}

/* JamboMart - Sticky CTA Heartbeat Pulse Every 2 Seconds */
@media (max-width: 749px) {
  body.single-product .hx-sbuy__btn {
    animation: jmHeartbeat2s 3s ease-in-out infinite !important;
    transform-origin: center;
  }

  body.single-product .hx-sbuy__btn:active {
    animation: none !important;
    transform: scale(0.97);
  }
}

@keyframes jmHeartbeat2s {
  0%, 12%, 28%, 100% {
    transform: scale(1);
  }

  18% {
    transform: scale(1.045);
  }

  34% {
    transform: scale(1.025);
  }

  42% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-product .hx-sbuy__btn {
    animation: none !important;
  }
}
