/* ═══════════════════════════════════════════════════════════
   Витрина магазина (shop-showcase)
   ───────────────────────────────────────────────────────────
   Каждый ряд товаров = .shop-row с собственным декором.
   Три варианта декора: --wide / --med / --narrow
   переключаются через media queries.
   html/body { overflow-x: hidden } из main.css
   блокирует горизонтальный скролл.
   ═══════════════════════════════════════════════════════════ */

/* ── Секция-обёртка ────────────────────────────────────── */
.shop-section {
  background: #fff;
  padding-bottom: 40px;
}

/* Состояние загрузки */
.shop-section--loading .shop-row__grid {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#shop-rows {
  position: relative;
  min-height: 800px;
}

.shop-loader {
  position: absolute;
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.shop-loader__gif {
  width: 109px;
  height: 114px;
  pointer-events: none;
  user-select: none;
}
.shop-loader__text {
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 300;
  text-shadow: 0 0 8px #fff, 0 0 16px #fff;
}
@media (max-width: 479px) {
  .shop-loader { top: 140px; }
  .shop-loader__text { font-size: 16px; }
}

.shop-error,
.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 18px;
  padding: 2rem;
}

/* ── Фильтры (типы + кол-во на странице) ─────────────── */
.shop-filters {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "TildaSans", Arial, sans-serif;
}

.shop-filters__types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-filters__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #d4c0d9;
  border-radius: 20px;
  background: #fff;
  color: #9966aa;
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
  line-height: 1.3;
}
.shop-filters__type:hover {
  border-color: #b07eb2;
}
.shop-filters__type:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}
.shop-filters__type--active {
  background: #815583;
  border-color: #815583;
  color: #fff;
}

.shop-filters__check {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shop-filters__type--active .shop-filters__check::after {
  content: "";
  display: block;
  width: 8px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-bottom: 2px;
}

.shop-filters__count {
  font-size: 13px;
  opacity: 0.7;
}

.shop-filters__per-page {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-filters__label {
  color: #9966aa;
  font-size: 15px;
  font-weight: 300;
}

.shop-filters__select {
  padding: 6px 32px 6px 12px;
  border: 1px solid #d4c0d9;
  border-radius: 10px;
  background: #fff;
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239966aa' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
.shop-filters__select:hover {
  border-color: #b07eb2;
}
.shop-filters__select:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}

/* ── Подкатегории (раскрываются при выборе типа) ─────── */
.shop-filters__subcats {
  flex-basis: 100%;
  order: 3;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
}

.shop-filters__attr-title {
  color: #9966aa;
  font-size: 14px;
  font-weight: 400;
  margin-right: 2px;
}

.shop-filters__subcat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid #e0d3e4;
  border-radius: 16px;
  background: #faf7fb;
  color: #9966aa;
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
  line-height: 1.3;
}
.shop-filters__subcat:hover {
  border-color: #b07eb2;
}
.shop-filters__subcat:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}
.shop-filters__subcat--active {
  background: #a87dab;
  border-color: #a87dab;
  color: #fff;
}

.shop-filters__subcat .shop-filters__check {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
  border-radius: 3px;
}
.shop-filters__subcat--active .shop-filters__check::after {
  content: "";
  display: block;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-bottom: 1.5px;
}

@media (max-width: 479px) {
  .shop-filters {
    padding: 16px 12px 0;
    gap: 12px;
  }
  .shop-filters__types   { order: 1; }
  .shop-filters__subcats { order: 2; }
  .shop-filters__per-page { order: 3; }

  .shop-filters__type {
    font-size: 14px;
    padding: 5px 10px;
  }
  .shop-filters__subcat {
    font-size: 12px;
    padding: 3px 9px;
  }
  .shop-filters__attr-title {
    font-size: 13px;
  }
}


/* ── Заголовок группы типа товаров ────────────────────── */
.shop-type-heading {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 16px;
  text-align: center;
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 35px;
  font-weight: 300;
  line-height: 1.2;
  text-shadow: 1px 1px 7px rgba(254, 255, 224, 1);
}
#shop-rows > .shop-type-heading:first-child {
  margin-top: 10px;
}

@media (max-width: 479px) {
  .shop-type-heading { font-size: 28px; }
}


/* ── Ряд (декор + карточки) ──────────────────────────── */
.shop-row {
  position: relative;
  min-height: 800px;
}


/* ══════════════════════════════════════════════════════════
   ДЕКОР — общие стили
   ══════════════════════════════════════════════════════════ */
.shop-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.shop-decor img {
  display: block;
  position: absolute;
  max-width: none;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.shop-decor--wide   { display: block; }
.shop-decor--med    { display: none; }
.shop-decor--narrow { display: none; }


/* ══════════════════════════════════════════════════════════
   WIDE — 3 товара (>1319px)
   ══════════════════════════════════════════════════════════ */
.shop-decor--wide .shop-decor__stall {
  z-index: 1;
  top: 10px;
  left: calc(50% - 600px - 179px);
  width: 1571px;
}

.shop-decor--wide .shop-decor__star { z-index: 2; }
.shop-decor--wide .shop-decor__star--a {
  top: 105px;
  left: calc(50% - 600px + 326px);
  width: 62px;
}
.shop-decor--wide .shop-decor__star--b {
  top: 103px;
  left: calc(50% - 600px + 817px);
  width: 79px;
  transform: rotate(17deg);
}
.shop-decor--wide .shop-decor__star--c {
  top: 241px;
  left: calc(50% - 600px - 70px);
  width: 53px;
}
.shop-decor--wide .shop-decor__star--d {
  top: 446px;
  left: calc(50% - 600px + 1226px);
  width: 53px;
  transform: rotate(219deg);
}

.shop-decor--wide .shop-decor__right { z-index: 2; }
.shop-decor--wide .shop-decor__right--1 { top: 599px; left: calc(50% - 600px + 1208px); width: 191px; }
.shop-decor--wide .shop-decor__right--2 { top: 626px; left: calc(50% - 600px + 1244px); width: 156px; }
.shop-decor--wide .shop-decor__right--3 { top: 642px; left: calc(50% - 600px + 1207px); width: 153px; }
.shop-decor--wide .shop-decor__right--4 { top: 594px; left: calc(50% - 600px + 1210px); width: 220px; }
.shop-decor--wide .shop-decor__right--5 { top: 642px; left: calc(50% - 600px + 1206px); width: 241px; }

.shop-decor--wide .shop-decor__left { z-index: 2; }
.shop-decor--wide .shop-decor__left--1 { top: 658px; left: calc(50% - 600px - 179px); width: 163px; }
.shop-decor--wide .shop-decor__left--2 { top: 678px; left: calc(50% - 600px - 166px); width: 150px; }
.shop-decor--wide .shop-decor__left--3 { top: 642px; left: calc(50% - 600px - 162px); width: 143px; }
.shop-decor--wide .shop-decor__left--4 { top: 642px; left: calc(50% - 600px - 198px); width: 193px; }


/* ══════════════════════════════════════════════════════════
   MEDIUM — 2 товара (900–1319px)
   ══════════════════════════════════════════════════════════ */
.shop-decor--med .shop-decor__stall {
  z-index: 1;
  top: 9px;
  left: calc(50% - 480px - 80px);
  width: 1131px;
}

.shop-decor--med .shop-decor__star { z-index: 2; }
.shop-decor--med .shop-decor__star--a {
  top: 105px;
  left: calc(50% - 480px + 425px);
  width: 62px;
}
.shop-decor--med .shop-decor__star--c {
  top: 241px;
  left: calc(50% - 480px + 29px);
  width: 53px;
}
.shop-decor--med .shop-decor__star--d {
  top: 350px;
  left: calc(50% - 480px + 923px);
  width: 53px;
  transform: rotate(219deg);
}

.shop-decor--med .shop-decor__right { z-index: 2; }
.shop-decor--med .shop-decor__right--1 { top: 599px; left: calc(50% - 480px + 865px); width: 191px; }
.shop-decor--med .shop-decor__right--2 { top: 626px; left: calc(50% - 480px + 901px); width: 156px; }
.shop-decor--med .shop-decor__right--3 { top: 642px; left: calc(50% - 480px + 864px); width: 153px; }
.shop-decor--med .shop-decor__right--4 { top: 594px; left: calc(50% - 480px + 867px); width: 220px; }
.shop-decor--med .shop-decor__right--5 { top: 642px; left: calc(50% - 480px + 863px); width: 241px; }

.shop-decor--med .shop-decor__left { z-index: 2; }
.shop-decor--med .shop-decor__left--1 { top: 658px; left: calc(50% - 480px - 91px); width: 163px; }
.shop-decor--med .shop-decor__left--2 { top: 670px; left: calc(50% - 480px - 84px); width: 150px; }
.shop-decor--med .shop-decor__left--3 { top: 642px; left: calc(50% - 480px - 77px); width: 143px; }
.shop-decor--med .shop-decor__left--4 { top: 642px; left: calc(50% - 480px - 116px); width: 193px; }


/* ══════════════════════════════════════════════════════════
   NARROW — 1 товар (≤899px)
   ══════════════════════════════════════════════════════════ */
.shop-decor--narrow .shop-decor__stall {
  z-index: 1;
  top: 9px;
  left: calc(50% - 320px - 31px);
  width: 690px;
}

.shop-decor--narrow .shop-decor__star { z-index: 2; }
.shop-decor--narrow .shop-decor__star--a {
  top: 105px;
  left: calc(50% - 320px + 474px);
  width: 62px;
}
.shop-decor--narrow .shop-decor__star--b {
  top: 241px;
  left: calc(50% - 320px + 78px);
  width: 53px;
}

.shop-decor--narrow .shop-decor__right { z-index: 2; }
.shop-decor--narrow .shop-decor__right--1 { top: 599px; left: calc(50% - 320px + 478px); width: 191px; }
.shop-decor--narrow .shop-decor__right--2 { top: 626px; left: calc(50% - 320px + 514px); width: 156px; }
.shop-decor--narrow .shop-decor__right--3 { top: 642px; left: calc(50% - 320px + 477px); width: 153px; }
.shop-decor--narrow .shop-decor__right--4 { top: 594px; left: calc(50% - 320px + 480px); width: 220px; }
.shop-decor--narrow .shop-decor__right--5 { top: 642px; left: calc(50% - 320px + 476px); width: 241px; }

.shop-decor--narrow .shop-decor__left { z-index: 2; }
.shop-decor--narrow .shop-decor__left--1 { top: 658px; left: calc(50% - 320px - 41px); width: 163px; }
.shop-decor--narrow .shop-decor__left--2 { top: 678px; left: calc(50% - 320px - 8px); width: 150px; }
.shop-decor--narrow .shop-decor__left--3 { top: 642px; left: calc(50% - 320px - 27px); width: 143px; }
.shop-decor--narrow .shop-decor__left--4 { top: 642px; left: calc(50% - 320px - 77px); width: 193px; }


/* ══════════════════════════════════════════════════════════
   КОНТЕНТ ряда (поверх декора)
   ══════════════════════════════════════════════════════════ */
.shop-row__inner {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 165px;
  padding-bottom: 80px;
}

.shop-row__grid {
  display: grid;
  grid-template-columns: repeat(3, 402px);
  gap: 39px;
  justify-content: center;
  align-items: start;
}


/* ══════════════════════════════════════════════════════════
   КАРТОЧКА ТОВАРА
   ══════════════════════════════════════════════════════════ */
.shop-item {
  width: 402px;
}

.shop-item--empty .shop-card {
  cursor: default;
  pointer-events: none;
}

.shop-card {
  position: relative;
  width: 402px;
  height: 365px;
  cursor: pointer;
}

.shop-card__bg {
  position: absolute;
  inset: 0;
  width: 402px;
  height: 365px;
  pointer-events: none;
  user-select: none;
}

.shop-card__cover {
  position: absolute;
  inset: 0;
  width: 402px;
  height: 365px;
  object-fit: contain;
}

.shop-card__prop {
  position: absolute;
  inset: 0;
  width: 402px;
  height: 365px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.shop-card__shadow {
  position: absolute;
  inset: 0;
  width: 402px;
  height: 365px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.shop-card__price-tag {
  position: absolute;
  width: 145px;
  height: auto;
  left: -32px;
  bottom: -3px;
  pointer-events: none;
  user-select: none;
}

.shop-card__price {
  position: absolute;
  left: -13px;
  bottom: 11px;
  width: 114px;
  text-align: center;
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -2.5px;
  line-height: 1.2;
  text-shadow: 1px 1px 7px rgba(254, 255, 224, 1);
}

.shop-card__price.shop-card__price--loading {
  font-weight: 300;
  font-size: 26px;
  letter-spacing: 0;
  bottom: 16px;
}

.shop-card__price.shop-card__price--sold-out {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
}

.shop-title {
  margin: 34px 0 17px;
  width: 451px;
  margin-left: -39px;
  text-align: center;
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 35px;
  font-weight: 300;
  line-height: 1.2;
  text-shadow: 1px 1px 7px rgba(254, 255, 224, 1);
}

.shop-actions {
  display: flex;
  gap: 13px;
  padding-left: 35px;
}

.shop-item:nth-child(2) .shop-title { margin-left: -29px; }
.shop-item:nth-child(2) .shop-actions { padding-left: 45px; }

.shop-item:nth-child(3) .shop-title { margin-left: -14px; }
.shop-item:nth-child(3) .shop-actions { padding-left: 60px; }

.shop-btn {
  width: 140px;
  height: 40px;
  border-radius: 15px;
  cursor: pointer;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease;
}

.shop-btn--primary {
  background: #815583;
  color: #fff;
  border: 0;
}
.shop-btn--primary:hover {
  background: #b07eb2;
}

.shop-btn--secondary {
  background: #fff;
  color: #815583;
  border: 1px solid #b07eb2;
}
.shop-btn--secondary:hover {
  background: #b07eb2;
  color: #fff;
  border-color: #b07eb2;
}

.shop-btn:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}

.shop-btn:disabled,
.shop-btn.shop-btn--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}


/* ══════════════════════════════════════════════════════════
   АДАПТИВ: 2 товара (≤ 1319px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1319px) {
  .shop-decor--wide   { display: none; }
  .shop-decor--med    { display: block; }
  .shop-decor--narrow { display: none; }

  .shop-row__grid {
    grid-template-columns: repeat(2, 402px);
  }

  .shop-item:nth-child(2) .shop-title { margin-left: -19px; }
  .shop-item:nth-child(2) .shop-actions { padding-left: 55px; }
}


/* ══════════════════════════════════════════════════════════
   АДАПТИВ: 1 товар (≤ 899px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  .shop-decor--wide   { display: none; }
  .shop-decor--med    { display: none; }
  .shop-decor--narrow { display: block; }

  .shop-row__grid {
    grid-template-columns: 402px;
  }
}


/* ══════════════════════════════════════════════════════════
   EXTRA-NARROW: мобильные ≤479px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 479px) {
  .shop-row { min-height: 590px; }

  .shop-decor--narrow .shop-decor__stall  { top: 4px;   left: calc(50% - 160px - 95px);  width: 510px; }

  .shop-decor--narrow .shop-decor__star--a { top: 74px;  left: calc(50% - 160px + 279px); width: 45px; }
  .shop-decor--narrow .shop-decor__star--b { top: 175px; left: calc(50% - 160px - 14px);  width: 40px; }

  .shop-decor--narrow .shop-decor__right--1 { top: 439px; left: calc(50% - 160px + 281px); width: 141px; }
  .shop-decor--narrow .shop-decor__right--2 { top: 459px; left: calc(50% - 160px + 308px); width: 115px; }
  .shop-decor--narrow .shop-decor__right--3 { top: 471px; left: calc(50% - 160px + 280px); width: 113px; }
  .shop-decor--narrow .shop-decor__right--4 { top: 435px; left: calc(50% - 160px + 283px); width: 163px; }
  .shop-decor--narrow .shop-decor__right--5 { top: 471px; left: calc(50% - 160px + 279px); width: 179px; }

  .shop-decor--narrow .shop-decor__left--1 { top: 483px; left: calc(50% - 160px - 102px); width: 120px; }
  .shop-decor--narrow .shop-decor__left--2 { top: 497px; left: calc(50% - 160px - 78px);  width: 111px; }
  .shop-decor--narrow .shop-decor__left--3 { top: 471px; left: calc(50% - 160px - 92px);  width: 106px; }
  .shop-decor--narrow .shop-decor__left--4 { top: 471px; left: calc(50% - 160px - 129px); width: 142px; }

  .shop-row__inner {
    padding-top: 119px;
    padding-bottom: 60px;
  }

  .shop-card,
  .shop-card__bg,
  .shop-card__cover,
  .shop-card__prop,
  .shop-card__shadow { width: 297px; height: 270px; }
  .shop-item { width: 297px; }
  .shop-row__grid { grid-template-columns: 297px; }

  .shop-card__price-tag { width: 107px; left: -24px; }
  .shop-card__price { font-size: 26px; width: 84px; left: -10px; bottom: 6px; }
  .shop-title { font-size: 30px; width: 370px; margin-left: -36px; }
  .shop-btn { width: 124px; }
  .shop-actions { padding-left: 0; justify-content: center; }
}


/* ══════════════════════════════════════════════════════════
   ПАГИНАЦИЯ
   ══════════════════════════════════════════════════════════ */
.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0 20px;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 24px;
  font-weight: 300;
  user-select: none;
}

.shop-pagination__arrow {
  width: 72px;
  height: 84px;
  vertical-align: middle;
  cursor: default;
  transition: opacity 0.2s;
}

.shop-pagination__arrow--prev { margin-right: 40px; }
.shop-pagination__arrow--next { margin-left: 40px; }

.shop-pagination__arrow--active {
  cursor: pointer;
}
.shop-pagination__arrow--active:hover {
  opacity: 0.7;
}
.shop-pagination__arrow--active:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
  border-radius: 4px;
}

.shop-pagination__label {
  color: #808080;
  cursor: default;
}
.shop-pagination__label--active {
  color: #9966aa;
  cursor: pointer;
}
.shop-pagination__label--active:hover {
  text-decoration: underline;
}
.shop-pagination__label--active:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 767px) {
  .shop-pagination__label { display: none; }
  .shop-pagination__arrow--prev { margin-right: 20px; }
  .shop-pagination__arrow--next { margin-left: 20px; }
}


/* ══════════════════════════════════════════════════════════
   QUICK VIEW POPUP
   ══════════════════════════════════════════════════════════ */

.shop-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: background-color 0.25s ease;
}
.shop-popup-overlay--visible {
  background: rgba(0, 0, 0, 0.45);
}

.shop-popup {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  font-family: "TildaSans", Arial, sans-serif;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  will-change: opacity, transform;
}

.shop-popup-overlay--visible .shop-popup {
  opacity: 1;
  transform: translateY(0);
}

.shop-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #9966aa;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.shop-popup__close:hover { background: #f5f0f6; }
.shop-popup__close:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}

.shop-popup__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #d4c0d9 transparent;
  scrollbar-width: thin;
}
.shop-popup__body::-webkit-scrollbar { width: 8px; }
.shop-popup__body::-webkit-scrollbar-track { background: transparent; }
.shop-popup__body::-webkit-scrollbar-thumb {
  background: #d4c0d9;
  border-radius: 4px;
}
.shop-popup__body::-webkit-scrollbar-thumb:hover { background: #b07eb2; }

/* Загрузка в попапе коллекции */
.shop-popup__loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  padding: 40px;
}
.shop-popup__loading-gif {
  width: 109px;
  height: 114px;
  user-select: none;
}
.shop-popup__loading-text {
  color: #9966aa;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 18px;
  font-weight: 300;
}
.shop-popup__loading--error .shop-popup__loading-text {
  color: #815583;
  text-align: center;
}

/* ── Gallery (left column) ─────────────────────────────── */

.shop-popup__gallery {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-popup__gallery-main {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  background: #f9f7fa;
}

.shop-popup__gallery-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.shop-popup__gallery-img--zoomable {
  cursor: zoom-in;
  border-radius: 12px;
}
.shop-popup__gallery-img--zoomable:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}

.shop-popup__gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(142, 98, 144, 0.45);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}
.shop-popup__gallery-nav:hover { background: rgba(142, 98, 144, 0.75); }
.shop-popup__gallery-prev { left: 8px; }
.shop-popup__gallery-next { right: 8px; }
.shop-popup__gallery-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.shop-popup__gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.shop-popup__thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #f9f7fa;
  transition: border-color 0.2s;
}
.shop-popup__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-popup__thumb--active,
.shop-popup__thumb:hover {
  border-color: #9966aa;
}

/* ── Info (right column) ───────────────────────────────── */

.shop-popup__info {
  padding: 28px 28px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.shop-popup__title {
  color: #7e5380;
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  padding-right: 36px;
  line-height: 1.25;
}

.shop-popup__sku {
  color: #9966aa;
  font-size: 16px;
  font-weight: 300;
}

.shop-popup__price {
  color: #744b76;
  font-size: 24px;
  font-weight: 400;
}

.shop-popup__price.shop-popup__price--sold-out {
  font-size: 20px;
}

.shop-popup__cart-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
}

.shop-popup__download-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  border-top: 1px solid #f0e1f1;
  margin-top: 6px;
}

.shop-popup__download-row .shop-popup__download-btn {
  flex-shrink: 0;
}

.shop-popup__craft-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
  margin-top: 0;
}

.shop-popup__craft-row .shop-popup__craft-btn {
  white-space: nowrap;
}

.shop-popup__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d4c0d9;
  border-radius: 10px;
  overflow: hidden;
}

.shop-popup__qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #fff;
  color: #9966aa;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}
.shop-popup__qty-btn:hover { background: #f5f0f6; }
.shop-popup__qty-btn:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: -2px;
}

.shop-popup__qty-input {
  width: 48px;
  height: 40px;
  border: none;
  border-left: 1px solid #d4c0d9;
  border-right: 1px solid #d4c0d9;
  text-align: center;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 16px;
  color: #744b76;
  -moz-appearance: textfield;
}
.shop-popup__qty-input::-webkit-outer-spin-button,
.shop-popup__qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.shop-popup__qty-input:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: -2px;
}

.shop-popup__buy {
  height: 40px;
  padding: 0 28px;
  border: none;
  border-radius: 15px;
  background: #815583;
  color: #fff;
  font-family: "TildaSans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}
.shop-popup__buy:hover { background: #b07eb2; }
.shop-popup__buy:focus-visible {
  outline: 2px solid #9966aa;
  outline-offset: 2px;
}

.shop-popup__buy:disabled,
.shop-popup__buy.shop-popup__buy--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.shop-popup__descr-short {
  color: #a687a8;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
}

.shop-popup__descr {
  color: #7c477e;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.45;
  padding-top: 12px;
  border-top: 1px solid #f0e1f1;
}
.shop-popup__descr ul,
.shop-popup__descr ol { padding-left: 20px; margin: 8px 0; }
.shop-popup__descr li { margin-bottom: 4px; }
.shop-popup__descr p { margin: 8px 0; }
.shop-popup__descr strong { font-weight: 500; }

/* ── Popup responsive: tablet ──────────────────────────── */

@media (max-width: 768px) {
  .shop-popup-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .shop-popup {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .shop-popup-overlay--visible .shop-popup {
    transform: translateY(0);
  }

  .shop-popup__body {
    grid-template-columns: 1fr;
  }

  .shop-popup__gallery { padding: 20px 20px 0; }
  .shop-popup__info { padding: 20px; }
  .shop-popup__title { font-size: 20px; }
}

/* ── Popup responsive: phone ───────────────────────────── */

@media (max-width: 479px) {
  .shop-popup {
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .shop-popup__gallery { padding: 16px 16px 0; }
  .shop-popup__info { padding: 16px; }

  .shop-popup__cart-row { flex-wrap: wrap; }
  .shop-popup__buy { flex: 1; min-width: 0; }

  .shop-popup__gallery-main { border-radius: 12px; }
  .shop-popup__thumb { width: 52px; height: 52px; }
}


/* ══════════════════════════════════════════════════════════
   LIGHTBOX (полноэкранный просмотр фото)
   ══════════════════════════════════════════════════════════ */

.shop-lightbox {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(83, 74, 83, 0);
  cursor: zoom-out;
  transition: background-color 0.2s ease;
}
.shop-lightbox--visible {
  background: rgba(83, 74, 83, 0.92);
}

.shop-lightbox__img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.shop-lightbox--visible .shop-lightbox__img {
  opacity: 1;
  transform: scale(1);
}

.shop-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}
.shop-lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }
.shop-lightbox__prev { left: 20px; }
.shop-lightbox__next { right: 20px; }
.shop-lightbox__nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.shop-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.shop-lightbox__close:hover { background: rgba(255, 255, 255, 0.15); }
.shop-lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 479px) {
  .shop-lightbox__nav { width: 40px; height: 40px; font-size: 24px; }
  .shop-lightbox__prev { left: 10px; }
  .shop-lightbox__next { right: 10px; }
}

/* ═══════════════════════════════════════════
   "Add to cart" bounce
   ═══════════════════════════════════════════ */

@keyframes shop-btn-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-6px); }
  50%  { transform: translateY(0); }
  70%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.shop-btn--primary.shop-btn--bounce,
.shop-popup__buy.shop-btn--bounce {
  animation: shop-btn-bounce 0.45s ease;
}
