.gt-popup-gallery {
  width: min(960px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 80px 0 120px;
  font-size: 18px;
  color: #000;
}

.gt-popup-gallery p {
  margin: 0 0 1.25rem;
}

.gt-popup-card {
  border: 2px solid #000;
  border-radius: 40px;
  padding: clamp(32px, 5vw, 64px);
  margin-bottom: 48px;
  display: flex;
  justify-content: center;
  text-align: center;
}

.gt-popup-card[data-align="left"] {
  text-align: left;
}

.gt-popup-card[data-align="right"] {
  text-align: right;
}

.gt-popup-card__inner {
  max-width: 760px;
  width: 100%;
}

.gt-popup-card__inner p {
  font-family: "Wadik", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 6vw, 64px);
  line-height: 1.1;
  margin-bottom: 0;
}

.gt-popup-items {
  --popup-gap: clamp(32px, 4vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--popup-gap);
  margin: 56px auto 0;
  width: min(100%, calc(3 * 260px + 2 * var(--popup-gap)));
  justify-items: center;
}

.gt-popup-items > p {
  display: contents;
  margin: 0;
}

.gt-popup-item-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.gt-popup-item {
  max-width: 260px;
  width: 100%;
}

.gt-popup-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.gt-popup-item__image {
  width: 100%;
  display: flex;
  justify-content: center;
}

.gt-popup-item__image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.gt-popup-item__button {
  border: none;
  border-radius: 999px;
  padding: 12px 48px;
  background: #000;
  color: #f46995;
  font-family: "Wadik", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.gt-popup-item__button:hover,
.gt-popup-item__button:focus-visible {
  background: #f46995;
  color: #000;
  transform: translateY(-2px);
  outline: none;
}

.gt-popup-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px 12px;
  overflow-y: auto;
  scrollbar-width: none;
}

.gt-popup-modal.is-open {
  display: flex;
}

.gt-popup-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.gt-popup-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.gt-popup-modal__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 15px 19px;
  border-radius: 16px;
  border: 5px solid #010000;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: none;
}

.gt-popup-modal__content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.gt-popup-modal__close {
  position: absolute;
  top: 20px;
  right: 24px;
  border: none;
  background: none;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  color: #000;
}

.gt-popup-modal__header,
.gt-popup-modal__media,
.gt-popup-modal__body {
  width: 100%;
  align-self: stretch;
}

.gt-popup-modal__title {
  font-family: "Wadik", sans-serif;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}

.gt-popup-modal__subtitle {
  margin: 0;
  font-size: 18px;
}

.gt-popup-modal__media {
  display: flex;
  justify-content: center;
}

.gt-popup-modal__media img,
.gt-popup-modal__media video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 16px;
  border: 2px solid #000;
  display: block;
  object-fit: cover;
}

.gt-popup-modal__body p {
  margin-bottom: 1rem;
}

body.gt-popup-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .gt-popup-items {
    margin-top: 48px;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    max-width: calc(2 * 260px + var(--popup-gap));
  }

  .gt-popup-item-wrapper {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .gt-popup-gallery {
    padding-top: 48px;
  }

  .gt-popup-card {
    margin-bottom: 32px;
    padding: 32px 24px;
  }

  .gt-popup-items {
    gap: 32px;
    grid-template-columns: 1fr;
    max-width: none;
  }

  .gt-popup-item-wrapper {
    max-width: 100%;
  }

  .gt-popup-modal__content {
    max-height: calc(100vh - 48px);
    max-width: calc(100vw - 32px);
  }
}

@media (max-width: 480px) {
  .gt-popup-item__button {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
  }
}

/* Grid alignment helpers */
.gt-popup-items > .gt-popup-item-wrapper {
  grid-column: auto;
}

.gt-popup-items > .gt-popup-item-wrapper:last-child:is(:nth-child(3n + 1 of .gt-popup-item-wrapper)) {
  grid-column: 2;
}

.gt-popup-items > .gt-popup-item-wrapper:nth-last-child(2 of .gt-popup-item-wrapper):is(:nth-child(3n + 1 of .gt-popup-item-wrapper)) {
  grid-column: auto !important;
}
