.ic-imgv[hidden] {
  display: none !important;
}

.ic-imgv {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: #000;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  direction: ltr;
}

html.ic-imgv-open,
body.ic-imgv-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.ic-imgv-open .ic-ws-nav,
body.ic-imgv-open .ic-ws-head-wrap {
  display: none !important;
}

.ic-imgv-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 5;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ic-imgv-close img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.ic-imgv-circuit-banner[hidden] {
  display: none !important;
}

.ic-imgv-circuit-banner {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 0;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
  direction: rtl;
}

.ic-imgv-circuit-banner-text {
  display: block;
  color: #fff;
  font-family: "IRANYekan", Tahoma, sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  white-space: nowrap;
}

.ic-imgv-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  direction: ltr;
}

.ic-imgv-track {
  display: flex;
  height: 100%;
  will-change: transform;
  direction: ltr;
}

.ic-imgv-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ic-imgv-zoom-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.ic-imgv-zoom-stage.is-panning {
  cursor: grabbing;
}

.ic-imgv-zoom-stage.is-zoomed {
  cursor: move;
}

.ic-imgv-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ic-imgv-footer[hidden] {
  display: none !important;
}

.ic-imgv-footer {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}

.ic-imgv-caption {
  margin: 0 0 8px;
  max-width: 90%;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  pointer-events: auto;
}

.ic-imgv-caption[hidden],
.ic-imgv-thumbs[hidden] {
  display: none !important;
}

.ic-imgv-thumbs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 16px;
  scroll-padding-inline: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  pointer-events: auto;
  direction: ltr;
}

.ic-imgv-thumbs.is-centered {
  justify-content: center;
}

.ic-imgv-thumbs::-webkit-scrollbar {
  display: none;
}

.ic-imgv-thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.ic-imgv-thumb.is-active {
  border-color: #fff;
}

.ic-imgv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: none !important;
  pointer-events: none;
}

.ic-imgv-thumb.is-video {
  position: relative;
}

.ic-imgv-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.ic-imgv-thumb-play::before {
  content: '';
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
}

.ic-imgv-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #000;
  pointer-events: auto;
}

.ic-imgv-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(92vw, 320px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(20, 24, 32, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
