/* Фотогалерея: стили в духе основного сайта (#2F0948, #FFE8D0, #E38CE1) */
.gallery { padding-bottom: 40px; }
.gallery__title {
  font-family: 'Poiret One', sans-serif;
  font-weight: 400;
  color: #2F0948;
  margin: 10px 0 24px;
}
.gallery__lead { max-width: 760px; margin: 0 0 30px; color: #555; }
.gallery__text { max-width: 900px; margin: 0 0 30px; }
.gallery__empty { margin: 40px 0; text-align: center; color: #777; }
.gallery__total { margin: 24px 0 0; text-align: center; color: #777; font-size: 14px; }

.g-notice {
  background: #F8F7FF;
  border: 1px solid #E5DDF5;
  border-radius: 20px;
  padding: 20px 24px;
  margin: 0 0 30px;
}
.g-notice p { margin: 0 0 14px; }
.g-notice .button { margin-right: 16px; }
.g-notice__all { text-decoration: underline; color: #2F0948; }

/* Сетка категорий */
.g-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.g-cat { display: block; }
.g-cat__photo {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: #F3EEFA;
}
.g-cat__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.g-cat:hover .g-cat__photo img { transform: scale(1.04); }
.g-cat__title { display: block; margin-top: 10px; font-weight: 700; color: #2F0948; line-height: 1.25; }
.g-cat__count { display: block; color: #888; font-size: 14px; }

/* Сетка фото: на смартфоне два в ряд, на компьютере — по ширине экрана */
.g-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.g-item { margin: 0; min-width: 0; }
.g-item__link {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px;
  background: #F3EEFA;
}
.g-item__link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
}
.g-item__id { font-weight: 700; color: #2F0948; }
.g-copy {
  border: 0;
  padding: 2px 0;
  background: none;
  color: #8B4A99;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.g-copy:hover { color: #E38CE1; }
.g-item__caption { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: #555; }

.g-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 28px; }
.g-more-wrap:empty { display: none; }
.g-load.is-loading { opacity: .6; pointer-events: none; }
.g-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; }
.g-pager a, .g-pager span {
  min-width: 38px;
  padding: 8px 12px;
  box-sizing: border-box;
  border-radius: 12px;
  text-align: center;
  background: #F8F7FF;
  color: #2F0948;
}
.g-pager a:hover { background: #FFE8D0; }
.g-pager .is-current { background: #2F0948; color: #fff; }
.g-pager .g-pager__gap { background: none; }

@media (min-width: 768px) {
  .g-cats { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
  .g-item__meta { font-size: 14px; }
}

/* Просмотрщик: панели не накладываются на фото (бар сверху, подпись снизу, стрелки в боковых полях) */
.gv {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #14081e;
  color: #fff;
  touch-action: pan-y;
}
.gv[hidden] { display: none; }
.gv__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.gv__id { font-weight: 700; font-size: 18px; white-space: nowrap; }
.gv__copy {
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 12px;
  padding: 7px 14px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.gv__copy:hover { background: #E38CE1; border-color: #E38CE1; }
.gv__counter { margin-left: auto; font-size: 14px; opacity: .7; }
.gv__close {
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff; font-size: 20px; cursor: pointer;
}
.gv__close:hover { background: rgba(255, 255, 255, .28); }
.gv__stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}
.gv__img {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* полный кадр без обрезки */
  user-select: none;
  -webkit-user-drag: none;
}
.gv__nav {
  flex: 0 0 56px;
  align-self: stretch;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  opacity: .75;
  cursor: pointer;
  display: none;
}
.gv__nav:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.gv__nav[disabled] { opacity: .15; cursor: default; }
.gv__caption {
  flex: 0 0 auto;
  padding: 8px 16px 16px;
  text-align: center;
  font-size: 15px;
  min-height: 8px;
}
.gv__caption:empty { padding: 4px; }
.gv__toast {
  position: absolute;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 12px;
  background: #2F0948;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.gv__toast.is-on { opacity: 1; }

@media (min-width: 768px) {
  .gv__nav { display: block; }
  .gv__bar { padding: 14px 24px; }
}
html.gv-open { overflow: hidden; }
/* чат-виджет сайта не должен перекрывать фото */
html.gv-open jdiv,
html.gv-open #jivo-iframe-container { display: none !important; }

/* Блок-ссылка на галерею в карточке товара */
.gallery-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  margin: 40px 0;
  padding: 28px 36px;
  border-radius: 24px;
  background: linear-gradient(120deg, #FFE8D0, #F8E4F8);
}
.gallery-cta__text {
  margin: 0;
  font-family: 'Poiret One', sans-serif;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: #2F0948;
}
.gallery-cta .button { flex: 0 0 auto; background: #2F0948; color: #fff; }
.gallery-cta .button:hover { background: #E38CE1; }
@media (max-width: 767px) {
  .gallery-cta { flex-direction: column; align-items: stretch; text-align: center; padding: 22px 18px; margin: 28px 0; }
  .gallery-cta__text { font-size: 22px; }
}

/* Блок галерей на главной */
.gallery-home { padding-top: 40px; padding-bottom: 40px; }
.gallery-home h2 { text-align: center; }
.gallery-home__bottom { margin-top: 28px; text-align: center; }
@media (min-width: 768px) {
  .g-cats--home { grid-template-columns: repeat(4, 1fr); }
}

/* атрибут hidden должен скрывать элементы, у которых задан display */
.g-more-wrap[hidden], .g-load[hidden], .g-pager[hidden] { display: none !important; }
