/* ─── Product Popup (unified for variety, product, addon) ─── */

/* ─── Gallery ─── */
.pp-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-gray-light);
}

.pp-gallery__track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.pp-gallery__slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pp-gallery__dots {
  position: absolute;
  bottom: var(--sp-12);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.pp-gallery__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.pp-gallery__dot--active {
  background: var(--color-white);
}

/* ─── Desktop arrows ─── */
.pp-gallery__arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pp-gallery__arrow img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.pp-gallery__arrow--prev { left: var(--sp-12); }
.pp-gallery__arrow--next { right: var(--sp-12); }

.pp-gallery__arrow--visible {
  opacity: 1;
  pointer-events: auto;
}

.pp-gallery__arrow:hover {
  background: rgba(255, 255, 255, 0.96);
}

@media (min-width: 769px) {
  .pp-gallery__arrow {
    display: flex;
  }
}

/* ─── Close button (sticky at top) ─── */
.pp-close-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 0;
  pointer-events: none;
}

.pp-close {
  position: absolute;
  top: var(--sp-12);
  right: var(--sp-12);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.15s;
}

.pp-close:active {
  opacity: 0.7;
}

.pp-close img {
  pointer-events: none;
}

/* ─── Discount badge ─── */
.pp-discount {
  position: absolute;
  bottom: var(--sp-12);
  left: var(--sp-12);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--color-white);
  z-index: 3;
}

/* ─── Body ─── */
.pp-body {
  padding: var(--sp-16);
}

.pp-body__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  color: var(--color-black);
  margin-bottom: var(--sp-12);
}

/* Tags */
.pp-body__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
}

.pp-body__tag {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-gray-border);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-black);
  white-space: nowrap;
}

/* ─── Detail section (card) ─── */
.pp-section {
  background: var(--color-gray-light);
  border-radius: var(--radius-md);
  padding: var(--sp-16);
  margin-bottom: var(--sp-16);
}

.pp-section__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-black);
  margin-bottom: var(--sp-12);
}

.pp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  border-bottom: 1px dotted var(--color-gray-border);
  font-size: var(--fs-base);
  color: var(--color-black);
}

.pp-row:last-child {
  border-bottom: none;
}

.pp-row__value {
  font-weight: var(--fw-bold);
  text-align: right;
  flex-shrink: 0;
  margin-left: var(--sp-12);
}

/* Description */
.pp-desc {
  font-size: var(--fs-base);
  color: var(--color-black);
  line-height: 1.5;
  margin-top: var(--sp-12);
}

/* ─── Footer bar ─── */
.pp-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
}

.pp-bar__prices {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pp-bar__price {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-black);
  line-height: 1.2;
}

.pp-bar__old-price {
  font-size: var(--fs-sm);
  color: #999;
  text-decoration: line-through;
}

.pp-bar__old-price:empty {
  display: none;
}

/* ─── Qty + Submit controls area ─── */
.pp-bar__controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Qty bar — expands next to submit button */
.pp-bar__qty {
  display: flex;
  align-items: center;
  height: 56px;
  background: var(--color-gray-light);
  border-radius: var(--radius-pill);
  overflow: hidden;

  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.3s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity 0.25s ease;
}

.pp-bar__qty--visible {
  max-width: 200px;
  opacity: 1;
  pointer-events: auto;
}

.pp-bar__qty-btn {
  width: 48px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.pp-bar__qty-btn:active {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}

.pp-bar__qty-btn img {
  pointer-events: none;
}

.pp-bar__qty-value {
  min-width: 28px;
  text-align: center;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--color-black);
  flex-shrink: 0;
}

/* Submit (add) button */
.pp-bar__submit {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.pp-bar__submit:active {
  opacity: 0.85;
}

.pp-bar__submit img {
  pointer-events: none;
  transition: opacity 0.15s;
}
