/* Desktop: sit below header so nav is not covered */
.product-sticky-atc {
  --sticky-atc-offset-top: 0px;
  position: fixed;
  inset-inline: 0;
  top: var(--sticky-atc-offset-top);
  bottom: auto;
  z-index: calc(var(--z-index-sticky) - 2);
  background: rgb(var(--color-background));
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-top: none;
  transform: translateY(calc(-100% - 8px));
  transition: transform 0.28s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.product-sticky-atc.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.product-sticky-atc__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding-block: 10px;
  padding-inline: var(--page-padding, 48px);
  max-width: calc(var(--page-width, 1500px) + var(--page-padding, 48px) * 2);
  margin-inline: auto;
  box-sizing: border-box;
}

.product-sticky-atc__product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.product-sticky-atc__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.product-sticky-atc__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-sticky-atc__title {
  font-family: var(--sort-title-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1c1c1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-sticky-atc__price {
  font-family: var(--sort-title-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: rgba(28, 28, 28, 0.65);
}

.product-sticky-atc__button {
  flex-shrink: 0;
  min-width: 160px;
  height: var(--button-height, 48px);
  min-height: var(--button-height, 48px);
  padding: 0 28px;
  font-family: var(--sort-title-font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff !important;
  background: #1c1c1c !important;
  border: none;
  border-radius: 0;
}

.product-sticky-atc__button:hover:not(:disabled) {
  background: #000 !important;
}

.product-sticky-atc__button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile: bottom bar — avoids header clash, easier thumb reach */
@media (max-width: 959px) {
  .product-sticky-atc {
    top: auto;
    bottom: 0;
    z-index: calc(var(--z-index-sticky) - 1);
    border-bottom: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(calc(100% + 8px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

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

  .product-sticky-atc__inner {
    min-height: 56px;
    padding-inline: var(--page-padding, 20px);
    gap: 12px;
  }

  .product-sticky-atc__thumb {
    width: 40px;
    height: 40px;
  }

  .product-sticky-atc__title {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .product-sticky-atc__price {
    font-size: 11px;
  }

  .product-sticky-atc__button {
    min-width: 0;
    padding-inline: 16px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .product-sticky-atc__title {
    max-width: 42vw;
  }

  .product-sticky-atc__button {
    padding-inline: 12px;
    letter-spacing: 0.08em;
  }
}
