/* ===== GALLERY ===== */

.gallery {
  background: var(--color-bg);
  overflow: hidden;
}

/* HEADER */
.gallery__header {
  margin-bottom: var(--space-xl);
}

/* SCROLL WRAP */
.gallery__scroll-wrap {
  position: relative;
  margin: 0 -5vw;
  padding: 0 5vw;
  overflow: hidden;
}

.gallery__scroll-wrap::before,
.gallery__scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

/* TRACK */
.gallery__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 20px;
  scrollbar-width: none;
  cursor: grab;
}

.gallery__track:active {
  cursor: grabbing;
}
.gallery__track::-webkit-scrollbar {
  display: none;
}

/* CARD */
.gallery__card {
  flex-shrink: 0;
  width: 460px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition:
    box-shadow 0.3s,
    transform 0.3s;
}

.gallery__card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}

/* SPLIT CONTAINER */
.gallery__split {
  position: relative;
  height: 280px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
}

/* LAYERI — oba pune dimenzije */
.gallery__layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gallery__layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* PRE: uvek ispod, puna širina */
.gallery__layer--before {
  z-index: 1;
  background: linear-gradient(135deg, #c8b89a, #a89070);
}

/* POSLE: overlay na vrhu, width se menja JS-om */
.gallery__layer--after {
  z-index: 2;
  width: 50%; /* JS menja ovo */
  background: linear-gradient(
    135deg,
    var(--color-primary-light),
    var(--color-primary)
  );
  /* img unutar mora da ostane pune dimenzije */
}

.gallery__layer--after img {
  width: 460px; /* = širina kartice, ostaje fiksno da ne bi se skupljala slika */
  max-width: none;
}

/* LABELE */
.gallery__label {
  position: absolute;
  top: 12px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}

.gallery__label--before {
  left: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.85);
}

.gallery__label--after {
  /* Uvek zalepljena za desnu ivicu overlay-a */
  right: 12px;
  background: var(--color-primary);
  color: var(--color-white);
}

/* DIVIDER — vertikalna linija + ikonica */
.gallery__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%; /* JS menja ovo */
  width: 3px;
  background: var(--color-white);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.gallery__split-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

/* INFO */
.gallery__info {
  background: var(--color-white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery__info-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.gallery__info-sub {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: 2px;
}

/* CONTROLS */
.gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: var(--space-lg);
}

.gallery__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  color: var(--color-primary);
  transition: all 0.2s;
}

.gallery__btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .gallery__card {
    width: 320px;
  }

  /* Na mobilnom, img širina prati karticu */
  .gallery__layer--after img {
    width: 320px;
  }

  /* Disable swipe scroll on mobile — buttons only */
  .gallery__track {
    touch-action: none;
  }
}
