.gallery-system-head{margin-bottom:0}
.gallery-filter-chips{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 0 0}
.gallery-filter-chips button,.gallery-category-card{border:0;cursor:pointer}
.gallery-filter-chips button{padding:10px 14px;border-radius:999px;background:#fff;color:var(--mama-gray-700);font-weight:500}
.gallery-filter-chips button.active{background:var(--mama-gray-300);color:#111827}
.gallery-category-list{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 0 22px}
.gallery-category-card{text-align:left;background:#fff;border:1px solid #e5e7eb;border-radius:20px;padding:16px;box-shadow:0 10px 30px rgba(15,23,42,.06)}
.gallery-category-card b{display:block;font-size:18px}.gallery-category-card span{display:block;margin-top:6px;color:#6b7280}

.gallery-system{position:relative}

/* GRID: одинаковая высота */
.gallery-view-grid{display:grid;grid-template-columns:repeat(var(--gallery-cols),minmax(0,1fr));gap:16px; }
.gallery-view-grid .gallery-item{height:var(--gallery-h)!important}
.gallery-view-grid .gallery-item img,.gallery-view-grid .gallery-item video{width:100%!important;height:100%!important;display:block;object-fit:cover!important}

/* CONTAIN только когда выбран contain */
.gallery-view-grid.gallery-mode-contain .gallery-item img,.gallery-view-grid.gallery-mode-contain .gallery-item video{background:#111827}

/* MASONRY: только тут разная высота */
.gallery-view-grid.gallery-mode-masonry{display:block;columns:var(--gallery-cols);column-gap:16px}
.gallery-view-grid.gallery-mode-masonry .gallery-item{break-inside:avoid;margin-bottom:16px;height:auto!important}
.gallery-view-grid.gallery-mode-masonry .gallery-item img,.gallery-view-grid.gallery-mode-masonry .gallery-item video{width:100%!important;height:auto!important;display:block}

.gallery-item{position:relative;margin:0;overflow:hidden;border-radius:16px;background:#e5e7eb;box-shadow:0 14px 40px rgba(15,23,42,.08);cursor:pointer}
.gallery-item img,.gallery-item video{transition:transform .35s ease}
.gallery-item:hover img,.gallery-item:hover video{transform:scale(1.025)}
.gallery-item figcaption{position:absolute;left:0;right:0;bottom:0;padding:18px;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.78));transform:translateY(8px);opacity:0;transition:.25s ease}
.gallery-item:hover figcaption{transform:translateY(0);opacity:1}
.gallery-item figcaption em{display:inline-flex;font-style:normal;font-size:12px;font-weight:800;background:rgba(255,255,255,.18);padding:5px 8px;border-radius:999px;margin-bottom:8px}
.gallery-item figcaption b,.gallery-item figcaption span,.gallery-item figcaption a{display:block}
.gallery-item figcaption b{font-size:18px}.gallery-item figcaption span{margin-top:4px;opacity:.9}.gallery-item figcaption a{margin-top:8px;color:#fff;font-weight:900}
.gallery-video-badge{position:absolute;top:14px;right:14px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:rgba(0,0,0,.55);color:#fff;font-weight:900}

/* SLIDER: одинаковая высота + обрезка по карточке */
.gallery-view-slider .gallery-viewport{overflow:hidden}
.gallery-view-slider .gallery-track{display:flex;gap:16px;transition:transform .35s ease;will-change:transform}
.gallery-view-slider .gallery-item{flex:0 0 calc((100% - (var(--per-gap,16px) * (var(--per-view,3) - 1))) / var(--per-view,3));height:var(--gallery-slider-h)!important}
.gallery-view-slider .gallery-item img,.gallery-view-slider .gallery-item video{width:100%!important;height:100%!important; object-fit:cover!important;display:block}
.gallery-view-slider.gallery-mode-contain .gallery-item img,.gallery-view-slider.gallery-mode-contain .gallery-item video{object-fit:cover!important;background:#111827}

.gallery-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:46px;height:46px;border:0;border-radius:50%;background:#fff;box-shadow:0 10px 30px rgba(0,0,0,.18);font-size:32px;cursor:pointer}
.gallery-prev{left:-14px}.gallery-next{right:-14px}
.gallery-dots{display:flex;justify-content:center;gap:8px;margin-top:16px}
.gallery-dot{width:9px;height:9px;border:0;border-radius:999px;background:#cbd5e1;cursor:pointer}
.gallery-dot.active{width:24px;background:var(--primary,#0054FF)}

.gallery-lightbox{position:fixed;inset:0;z-index:99999;background:rgba(8,12,24,.92);display:none;align-items:center;justify-content:center;padding:34px}
.gallery-lightbox.active{display:flex}
.gallery-lightbox-inner{max-width:min(1100px,92vw);max-height:88vh;color:#fff}
.gallery-lightbox img,.gallery-lightbox video{max-width:100%;max-height:76vh;border-radius:18px;display:block}
.gallery-lightbox-caption{margin-top:12px}
.gallery-lightbox-close,.gallery-lightbox-prev,.gallery-lightbox-next{position:fixed;border:0;border-radius:50%;background:#fff;color:var(--mama-gray-900);cursor:pointer;font-weight:400;font-size: 24px;
    line-height: 44px;}
.gallery-lightbox-close{top:20px;right:20px;width: 56px;
    height: 56px;}
.gallery-lightbox-prev,.gallery-lightbox-next{width: 56px;
    height: 56px;
    font-size: 36px;}
.gallery-lightbox-prev{left:20px}.gallery-lightbox-next{right:20px}

@media(max-width:900px){
  .gallery-category-list,.gallery-view-grid{grid-template-columns:1fr 1fr}
  .gallery-view-slider .gallery-item{flex-basis:100%;height:260px!important}
  .gallery-view-grid .gallery-item{height:240px!important}
  .gallery-view-grid.gallery-mode-masonry .gallery-item{height:auto!important}
  .gallery-item figcaption{opacity:1;transform:none}
  .gallery-prev{left:8px}.gallery-next{right:8px}
}
@media(max-width:560px){.gallery-category-list,.gallery-view-grid{grid-template-columns:1fr}
}
.gallery-view-slider,
.gallery-view-slider .gallery-viewport,
.gallery-view-slider .gallery-track{
  touch-action: pan-y;
}

.gallery-view-slider .gallery-track{
  cursor: grab;
  user-select: none;
}

.gallery-view-slider.is-dragging .gallery-track{
  cursor: grabbing;
  transition: none !important;
}

.gallery-view-slider .gallery-track img,
.gallery-view-slider .gallery-track video{
  pointer-events: none;
}

.gallery-view-slider .gallery-nav,
.gallery-view-slider .gallery-dots,
.gallery-view-slider .gallery-dot{
  pointer-events: auto;
  z-index: 10;
}
.gallery-view-slider .gallery-track{
  gap: 16px;
}

.gallery-view-slider .gallery-item{
  box-sizing: border-box;
}
.gallery-view-slider .gallery-item figcaption {
    position: absolute;
	bottom:-100px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px;
    color: #333;
   background: transparent;
    transform:none;
    opacity: 1;
    transition:0;
}

/* __gallery_mobile_slider_height_patch */
@media(max-width:768px){
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-system,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-track,
  .gallery-system-section.gallery--slider .gallery-system,
  .gallery-system-section.gallery--slider .gallery-track{
    min-height:var(--gallery-mobile-slider-h, var(--gallery-slider-h, 360px))!important;
  }

  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item img,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item video,
  .gallery-system-section.gallery--slider .gallery-item,
  .gallery-system-section.gallery--slider .gallery-item img,
  .gallery-system-section.gallery--slider .gallery-item video{
    height:var(--gallery-mobile-slider-h, var(--gallery-slider-h, 360px))!important;
  }
}
