body {
  background: #fff;
  min-height: 100vh;
  overflow: auto !important;
}
.galeria-header {
  text-align: center;
  color: var(--julia);
  font-size: 5vw;
  margin-top: 40px;
  text-shadow: 0 2px 16px #735b4630;
  letter-spacing: 2px;
}
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3vw 3vw;
  width: 90vw;
  max-width: 1400px;
  overflow: auto;
  touch-action: auto;
  margin: 5vh auto 5vh auto;
}
.galeria-img-wrap {
  background: var(--bg-top);
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(140, 121, 104, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s;
  cursor: pointer;
}
.galeria-img-wrap:hover {
  box-shadow: 0 8px 32px rgba(140, 121, 104, 0.18);
}
.galeria-img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s, filter 0.3s;
  filter: grayscale(0.1);
  cursor: pointer;
}
.galeria-img-wrap:hover .galeria-img {
  transform: scale(1.04);
  filter: grayscale(0) brightness(1.08);
}
@media (max-width: 900px) {
  .galeria-header {
    font-size: 8vw;
  }
  .galeria-img {
    height: 40vw;
  }
}
  .spinner-text {
    font-size: 1.2rem;
    color: #735b46;
    margin-top: 10px;
  }
@media (max-width: 600px) {
  .galeria-header {
    font-size: 15vw;
    margin-top: 20vw;
    font-weight: 800;
    letter-spacing: 1px;
    padding-bottom: 3vw;
  }
  .galeria-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 5vw 5vw;
    width: 99vw;
    margin: 3vw auto 3vw auto;
  }
  .galeria-img {
    height: 44vw;
    border-radius: 12px;
  }
}
.back-link {
  position: fixed;
  left: 30px;
  top: 30px;
  z-index: 500;
  font-size: 2vw;
  color: var(--arrow);
  text-decoration: none;
  font-weight: bold;
  background: #fff4;
  padding: 8px 20px;
  max-width: 150px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(140, 121, 104, 0.08);
}
.modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-bg.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(140, 121, 104, 0.18);
  background: #fff;
}
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
}
#modal-prev, #modal-prev-grafika {
  left: 3vw;
}
#modal-next, #modal-next-grafika {
  right: 3vw;
}
.modal-close-btn {
  position: absolute;
  top: 32px;
  right: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close-btn:hover svg circle {
  fill: #f5e8dc;
}
.modal-bg:after {
  display: none !important;
}
@media (max-width: 900px) {
  .modal-img {
    max-width: 98vw;
    max-height: 80vh;
  }
  .modal-bg:after {
    top: 20px;
    right: 20px;
    font-size: 7vw;
  }
}
.strzalka {
  transform: rotate(90deg);
  width: 15%;
}
@media (max-width: 600px) {
  .back-link {
    font-size: 6vw;
    left: 8px;
    top: 8px;
    padding: 18px 36px;
    max-width: 92vw;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(140, 121, 104, 0.22);
    background: #fff4;
    color: #735b46;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    transition: background 0.2s, box-shadow 0.2s, border 0.2s;
  }
  .back-link:hover, .back-link:active {
    background: #f5e9da;
    box-shadow: 0 12px 40px rgba(140, 121, 104, 0.28);
    border-color: #a88b6a;
    color: #735b46;
  }
  t {
    font-size: 5vw;
    letter-spacing: 1px;
  }
  .strzalka {
    min-width: 15px;
    max-width: 20px;
    width: 10vw;
    margin-right: 10px;
  }
}
