.ps-card-preview {
  width: 100%;
  max-width: 440px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.ps-card-preview__figure {
  margin: 0;
}

.ps-card-preview__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 56vh;
  margin-right: auto;
  margin-left: auto;
  object-fit: contain;
  border-radius: 12px;
}

.ps-card-preview__controls {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.ps-card-preview__toggle {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.1;
}

.ps-card-preview__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.ps-catalog-grid {
  display: grid;
  grid-template-columns: repeat(var(--ps-catalog-columns, 3), minmax(0, 1fr));
  gap: 4rem;
  width: 100%;
}

.ps-catalog-card {
  width: 100%;
  text-align: center;
}

.ps-catalog-card__media {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  cursor: pointer;
  border: 1px solid rgba(73, 93, 99, .28);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(3, 0, 39, .08);
}

.ps-catalog-card__media:focus-visible {
  outline: 2px solid rgba(227, 101, 91, .75);
  outline-offset: 4px;
}

.ps-catalog-card__image {
  display: block;
  width: 100%;
  height: auto;
}

.ps-catalog-card__body {
  margin-top: 1rem;
}

.ps-catalog-card__title,
.ps-catalog-card__price,
.ps-catalog-modal__price {
  display: none;
}

.ps-catalog-card__preview,
.ps-catalog-modal__view,
.ps-catalog-modal__variant {
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.ps-catalog-card__preview,
.ps-catalog-modal__view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3655b;
  background: #e3655b;
  color: #fff;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.ps-catalog-card__preview {
  min-height: 40px;
  padding: .55rem 1.05rem;
}

.ps-catalog-modal__view {
  min-height: 44px;
  padding: .74rem 1.35rem;
  font-size: 1.08rem;
}

.ps-catalog-card__preview:hover,
.ps-catalog-modal__view:hover {
  border-color: #d8584f;
  background: #d8584f;
  color: #fff;
}

.ps-catalog-card__preview:active,
.ps-catalog-modal__view:active {
  transform: translateY(1px);
}

.ps-catalog-card__preview:focus-visible,
.ps-catalog-modal__view:focus-visible {
  outline: 2px solid rgba(227, 101, 91, .55);
  outline-offset: 3px;
}

.ps-catalog-modal__variant:focus-visible,
.ps-catalog-modal__close:focus-visible {
  outline: 2px solid rgba(227, 101, 91, .75);
  outline-offset: 3px;
}

.ps-catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ps-catalog-modal.is-open {
  display: flex;
}

.ps-catalog-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 0, 39, .58);
}

.ps-catalog-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  max-height: calc(100dvh - 2rem);
  margin: 0;
  padding: .95rem 1.25rem 1.1rem;
  overflow: hidden;
  border-radius: 18px;
  background: #f9f2e2;
  box-shadow: 0 18px 60px rgba(3, 0, 39, .24);
}

.ps-catalog-modal__close {
  position: absolute;
  top: .55rem;
  right: .65rem;
  width: 2.65rem;
  height: 2.65rem;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e3655b;
  font-size: 2.08rem;
  font-weight: 500;
  line-height: 1;
}

.ps-catalog-modal__close:hover {
  color: #d8584f;
  background: rgba(227, 101, 91, .08);
}

.ps-catalog-modal__header {
  display: block;
  flex: 0 0 auto;
  padding: 0 2.6rem;
  margin: 0 0 .35rem;
  text-align: center;
}

.ps-catalog-modal__title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.ps-catalog-modal__preview-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  width: min(1120px, 100%);
  grid-template-columns: max-content max-content max-content;
  justify-content: center;
  align-items: stretch;
  column-gap: clamp(1.15rem, 1.75vw, 1.8rem);
  row-gap: .9rem;
  margin: 0 auto;
}

.ps-catalog-modal__rail {
  display: grid;
  grid-template-rows: 1fr auto 1fr auto;
  align-self: stretch;
  justify-self: center;
  justify-items: stretch;
  width: max-content;
  max-width: 100%;
  gap: .75rem;
  padding-bottom: .1rem;
}

.ps-catalog-modal__variant-toggle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .55rem;
  width: 100%;
  grid-row: 2;
  align-self: center;
}

.ps-catalog-modal__variant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .48rem .85rem;
  border: 1.5px solid #e3655b;
  background: #fff;
  color: #e3655b;
  box-shadow: none;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ps-catalog-modal__variant:hover {
  border-color: #d8584f;
  color: #d8584f;
  background: rgba(255, 255, 255, .78);
}

.ps-catalog-modal__variant.is-active,
.ps-catalog-modal__variant[aria-pressed="true"] {
  border-color: #e3655b;
  color: #e3655b;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(227, 101, 91, .24);
}

.ps-catalog-modal__variant:active {
  transform: translateY(1px);
}

.ps-catalog-modal__figure {
  width: max-content !important;
  max-width: none !important;
  min-width: 0;
  margin: 0;
  text-align: center;
  justify-self: center;
  align-self: stretch;
}

.ps-catalog-modal__figure figcaption {
  margin-bottom: .4rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(73, 93, 99, .9);
}

.ps-catalog-modal__image-frame {
  height: min(68dvh, 660px, calc(100dvh - 8.5rem));
  aspect-ratio: 5 / 7;
  width: auto;
  max-width: 100%;
  overflow: hidden;
  margin: 0 auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(3, 0, 39, .08);
}

.ps-catalog-modal__front,
.ps-catalog-modal__inside {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center center;
  border-radius: 0;
  box-shadow: none;
}

.ps-catalog-modal__actions {
  display: flex;
  justify-content: center;
  width: 100%;
  grid-row: 4;
  align-self: end;
}

.ps-catalog-modal__variant,
.ps-catalog-modal__view {
  width: 100%;
  white-space: nowrap;
}

body.ps-catalog-modal-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .ps-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }

  .ps-catalog-modal {
    padding: .9rem;
  }

  .ps-catalog-modal__dialog {
    width: min(1040px, 100%);
    max-height: calc(100dvh - 1.8rem);
    margin: 0;
    padding: .95rem 1.1rem 1.15rem;
  }

  .ps-catalog-modal__preview-grid {
    width: min(920px, 100%);
    grid-template-columns: max-content max-content max-content;
    justify-content: center;
    column-gap: clamp(.85rem, 1.5vw, 1.25rem);
    row-gap: .8rem;
  }

  .ps-catalog-modal__rail {
    gap: .65rem;
  }

  .ps-catalog-modal__image-frame {
    width: clamp(280px, 32vw, 360px);
  }


}

@media (max-width: 767px) {
  .ps-catalog-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .ps-card-preview {
    max-width: 100%;
  }

  .ps-card-preview__image {
    max-height: 68vh;
  }

  .ps-catalog-card__media {
    width: min(72vw, 260px);
    max-width: 260px;
  }

  .ps-catalog-modal {
    align-items: flex-start;
    padding: .75rem;
  }

  .ps-catalog-modal__dialog {
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
    margin: 0;
    padding: 1.15rem 1rem 1.25rem;
    overflow: auto;
  }

  .ps-catalog-modal__close {
    position: sticky;
    top: 0;
    right: auto;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: -.2rem -.15rem .35rem auto;
    z-index: 5;
    border: 1.5px solid rgba(227, 101, 91, .42);
    background: rgba(249, 242, 226, .96);
    box-shadow: 0 4px 14px rgba(3, 0, 39, .12);
    font-size: 2.3rem;
    font-weight: 600;
    line-height: 1;
  }

  .ps-catalog-modal__close:hover {
    background: rgba(227, 101, 91, .12);
  }

  .ps-catalog-modal__header {
    padding: 0 2.2rem;
    margin-bottom: .55rem;
  }

  .ps-catalog-modal__title {
    font-size: 2.1rem;
    line-height: 1.12;
  }

  .ps-catalog-modal__preview-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
    justify-items: center;
  }

  .ps-catalog-modal__figure--front {
    order: 1;
  }

  .ps-catalog-modal__figure--inside {
    order: 2;
  }

  .ps-catalog-modal__rail {
    order: 3;
    width: min(320px, 100%);
    margin: .1rem auto 0;
    align-self: center;
    justify-content: flex-start;
    justify-items: stretch;
    display: flex;
    flex-direction: column;
    gap: .8rem;
  }

  .ps-catalog-modal__variant-toggle {
    order: 1;
    width: 100%;
  }

  .ps-catalog-modal__actions {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .ps-catalog-modal__view {
    width: 100%;
  }

  .ps-catalog-modal__variant,
  .ps-catalog-modal__view {
    font-size: 1.15rem;
    font-weight: 600;
  }

  .ps-catalog-modal__figure {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ps-catalog-modal__image-frame {
    width: min(84vw, 360px);
    height: auto;
    aspect-ratio: 5 / 7;
  }

  .ps-catalog-modal__front,
  .ps-catalog-modal__inside {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
  }
}
