/* Theme PDP sticky buy bar — Figma 快速购买 */

body.has-pdp-sticky {
  padding-block-end: 96px;
}

.pdp-sticky {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 1020;
  background: #fff;
  box-shadow: 0 -4px 24px rgb(0 0 0 / 0.08);
  transform: translateY(110%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s ease, visibility 0.28s ease;
}

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

.pdp-sticky[hidden] {
  display: block !important;
}

.pdp-sticky__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
  min-height: 96px;
  padding-block: 16px;
}

.pdp-sticky__product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  margin-inline-end: auto;
}

.pdp-sticky__media {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 4px;
  background: #f2f2f2;
}

.pdp-sticky__media .media,
.pdp-sticky__image,
.pdp-sticky__placeholder {
  width: 100%;
  height: 100%;
}

.pdp-sticky__media :is(img, .media-gallery__image) {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.pdp-sticky__title {
  margin: 0;
  min-width: 0;
  max-width: 420px;
  color: #000;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdp-sticky__prices {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  flex: 0 0 auto;
}

.pdp-sticky__price {
  color: #35513d;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.pdp-sticky__compare {
  color: #9ca0ad;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: line-through;
}

.pdp-sticky__save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #983940;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.pdp-sticky__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.pdp-sticky__quantity theme-input-number,
.pdp-sticky__qty {
  display: inline-flex;
  align-items: center;
  width: 160px;
  min-height: 56px;
  padding: 4px 8px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  background: #fff;
}

.pdp-sticky__quantity theme-input-number button[name="minus"],
.pdp-sticky__quantity theme-input-number button[name="plus"] {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: transparent;
  color: #35513d;
}

.pdp-sticky__quantity theme-input-number input[type="number"] {
  color: #141414;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.pdp-sticky__atc {
  min-width: 197px;
  height: 56px;
  min-height: 56px;
  padding-inline: 24px;
  border: 0;
  border-radius: 6px;
  background: #35513d !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pdp-sticky__atc:hover {
  background: #2c4333 !important;
}

.pdp-sticky__atc:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 959px) {
  body.has-pdp-sticky {
    padding-block-end: 128px;
  }

  .pdp-sticky__inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "product"
      "prices"
      "actions";
    gap: 4px 0;
    min-height: 128px;
    padding-block: 12px;
  }

  .pdp-sticky__product {
    grid-area: product;
    margin-inline-end: 0;
  }

  .pdp-sticky__media {
    display: none;
  }

  .pdp-sticky__title {
    max-width: none;
    font-size: 16px;
  }

  .pdp-sticky__prices {
    grid-area: prices;
    margin-block-end: 8px;
  }

  .pdp-sticky__price {
    font-size: 16px;
    line-height: 1.5;
  }

  .pdp-sticky__compare {
    font-size: 12px;
  }

  .pdp-sticky__save {
    font-size: 10px;
  }

  .pdp-sticky__actions {
    grid-area: actions;
    width: 100%;
    gap: 12px;
  }

  .pdp-sticky__quantity {
    flex: 1 1 0;
    min-width: 0;
  }

  .pdp-sticky__quantity theme-input-number,
  .pdp-sticky__qty {
    width: 100%;
    min-height: 40px;
    height: 40px;
  }

  .pdp-sticky__quantity theme-input-number input[type="number"] {
    font-size: 14px;
  }

  .pdp-sticky__atc {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    font-size: 14px;
  }
}
