/* Sticky Add-to-Cart bar (mobile/tablet only) for single product pages. */
.m3d-sticky-atc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .10);
  transform: translateY(100%);
  transition: transform .22s ease;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.m3d-sticky-atc.is-visible {
  transform: translateY(0);
}

.m3d-sticky-atc__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

.m3d-sticky-atc__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.m3d-sticky-atc__thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  background: rgba(0, 0, 0, .05);
}

.m3d-sticky-atc__meta {
  min-width: 0;
}

.m3d-sticky-atc__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.m3d-sticky-atc__price {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
}

.m3d-sticky-atc__price .amount,
.m3d-sticky-atc__price bdi {
  white-space: nowrap;
}

.m3d-sticky-atc__btn {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  background: var(--theme-palette-color-1, #2d6cdf);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 10px;
  white-space: nowrap;
}

.m3d-sticky-atc__btn:active {
  transform: translateY(1px);
}

/* Loading state: hide the label and spin a ring in its place. */
.m3d-sticky-atc__btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.m3d-sticky-atc__btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: m3d-sticky-spin .6s linear infinite;
}

@keyframes m3d-sticky-spin {
  to { transform: rotate(360deg); }
}

/* "Added" state: button turns green and links to the cart. */
.m3d-sticky-atc.is-added .m3d-sticky-atc__btn {
  background: #1f9d73;
}

/* Sticky bar: mobile/tablet only; desktop keeps the in-page button. */
@media (min-width: 1025px) {
  .m3d-sticky-atc {
    display: none !important;
  }
}
