/* =========================
   FALLBACK GLOBALNY
   ========================= */
:root {
  --cvpg-scrollbar-color: #888;
  --cvpg-scrollbar-track: transparent;
}

/* =========================
   WRAPPER / BEZPIECZEŃSTWO
   ========================= */
.cvpg-gallery-wrap,
.cvpg-main-wrap,
.cvpg-main,
.cvpg-thumbs-wrap,
.cvpg-thumbs,
.cvpg-thumb-item,
.cvpg-thumb-item img {
  box-sizing: border-box;
}

.cvpg-gallery-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.cvpg-main-wrap,
.cvpg-thumbs-wrap,
.cvpg-main,
.cvpg-thumbs {
  min-width: 0;
}

/* =========================
   LAYOUTS
   ========================= */
.cvpg-gallery-wrap.cvpg-pos-left {
  flex-direction: row;
}

.cvpg-gallery-wrap.cvpg-pos-left .cvpg-thumbs-wrap {
  order: 1;
}

.cvpg-gallery-wrap.cvpg-pos-left .cvpg-main-wrap {
  order: 2;
}

.cvpg-gallery-wrap.cvpg-pos-right {
  flex-direction: row;
}

.cvpg-gallery-wrap.cvpg-pos-right .cvpg-main-wrap {
  order: 1;
}

.cvpg-gallery-wrap.cvpg-pos-right .cvpg-thumbs-wrap {
  order: 2;
}

.cvpg-gallery-wrap.cvpg-pos-bottom {
  flex-direction: column;
  align-items: stretch;
}

.cvpg-gallery-wrap.cvpg-pos-bottom .cvpg-main-wrap {
  order: 1;
}

.cvpg-gallery-wrap.cvpg-pos-bottom .cvpg-thumbs-wrap {
  order: 2;
}

/* =========================
   THUMBS (miniatury)
   ========================= */
.cvpg-thumbs-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  gap: 8px;
  overflow: hidden;
}

.cvpg-thumbs {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 5px;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.cvpg-thumb-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--cvpg-thumb-w, 80px);
  height: var(--cvpg-thumb-h, 80px);
  padding: 0;
  background: transparent;
  border: 0 solid transparent;
  cursor: pointer;
  transform: translateZ(0);
}

.cvpg-thumb-item img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center;
  border: 0 solid transparent;
  border-radius: 10px;
  pointer-events: none;
}

.cvpg-thumb-item.active img {
  border-color: var(--cvpg-thumb-active-border, #0073aa);
}

.cvpg-thumb-item:hover img,
.cvpg-thumb-item:active img {
  opacity: 0.9;
}

/* =========================
   MAIN (zdjęcie główne)
   ========================= */
.cvpg-main-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.cvpg-main {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
}

.cvpg-main a {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

.cvpg-main img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  vertical-align: middle;
  transition: opacity 0.15s ease;
}

.cvpg-main img.cvpg-is-loading {
  opacity: 0.35;
}

/* =========================
   BUTTONS (strzałki)
   ========================= */
.cvpg-main-arrow,
.cvpg-thumbs-arrow {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}

.cvpg-main-arrow:hover,
.cvpg-thumbs-arrow:hover {
  opacity: 0.95;
}

.cvpg-main-arrow:active,
.cvpg-thumbs-arrow:active {
  transform: scale(0.98);
}

.cvpg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cvpg-icon i {
  line-height: 1;
}

.cvpg-thumbs-prev,
.cvpg-thumbs-next {
  display: none;
}

/* =========================
   BOTTOM: miniatury poziomo
   ========================= */
.cvpg-gallery-wrap.cvpg-pos-bottom .cvpg-thumbs-wrap {
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
}

.cvpg-gallery-wrap.cvpg-pos-bottom .cvpg-thumbs {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 6px;
}

.cvpg-gallery-wrap.cvpg-pos-bottom .cvpg-thumbs-arrow {
  width: auto;
}

/* =========================
   SCROLLBAR (miniatury)
   ========================= */
.cvpg-thumbs::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.cvpg-thumbs::-webkit-scrollbar-track {
  background: var(--cvpg-scrollbar-track, transparent);
}

.cvpg-thumbs::-webkit-scrollbar-thumb {
  background: var(--cvpg-scrollbar-color, #888);
  border-radius: 6px;
}

.cvpg-thumbs {
  scrollbar-width: thin;
  scrollbar-color: var(--cvpg-scrollbar-color, #888) var(--cvpg-scrollbar-track, transparent);
}

/* =========================
   ACCESSIBILITY
   ========================= */
.cvpg-gallery-wrap:focus {
  outline: none;
}

.cvpg-gallery-wrap:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.35);
  outline-offset: 6px;
}

/* =========================
   MOBILE / RESPONSYWNOŚĆ
   ========================= */
@media (max-width: 600px) {
  .cvpg-gallery-wrap {
    gap: 14px;
  }

  .cvpg-thumbs-wrap,
  .cvpg-thumbs {
    max-width: 100%;
  }
}

/* =========================
   LIGHTBOX
   ========================= */
.cvpg-lightbox-items {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.cvpg-main img {
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.cvpg-main-effect-none .cvpg-main img {
  transition: none;
}

.cvpg-main-effect-fade .cvpg-main img {
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.cvpg-hover-zoom-yes .cvpg-main {
  overflow: hidden;
}

.cvpg-hover-zoom-yes .cvpg-main img {
  transform-origin: center center;
}

.cvpg-thumb-item:focus,
.cvpg-thumb-item:focus-visible,
.cvpg-main-arrow:focus,
.cvpg-main-arrow:focus-visible,
.cvpg-thumbs-arrow:focus,
.cvpg-thumbs-arrow:focus-visible,
.cvpg-main-link:focus,
.cvpg-main-link:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

.cvpg-main-effect-slide .cvpg-main img {
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.cvpg-click-zoom-yes .cvpg-main img.cvpg-main-zoomed {
	transform: scale(1.35);
	cursor: zoom-out;
}

.cvpg-click-zoom-yes .cvpg-main img {
	cursor: zoom-in;
}

@media (max-width: 767px) {
	.cvpg-gallery-wrap {
		flex-direction: column;
	}
}