* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 1️⃣ Telefony */
body {
  background: url("tlo2/1080dlg.webp") no-repeat top center;
  background-size: cover; 
  min-height: 100vh;
  font-family: 'Lexend_Exa', sans-serif !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  font-size: 14px;
}

/* Przycisk powrotu */
.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.arrow {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 40px;
  line-height: 1;
}

/* 2️⃣ Full HD */
@media (min-width: 769px) and (max-width: 1920px) {
  body {
    background: url("tlo2/1920dlg.webp") no-repeat top center;
    background-size: cover;
  }
}

/* 3️⃣ 2K */
@media (min-width: 1921px) and (max-width: 2560px) {
  body {
    background: url("tlo2/2560dlg.webp") no-repeat top center;
    background-size: cover;
  }
}

/* 4️⃣ 4K i większe */
@media (min-width: 2561px) {
  body {
    background: url("tlo2/3840dlg.webp") no-repeat top center;
    background-size: cover;
  }
}

/* Galeria */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  width: 100%;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  user-select: none;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Przyciski nawigacji */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 1001;
  user-select: none;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-btn.prev {
  left: 30px;
}

.nav-btn.next {
  right: 30px;
}

@media (max-width: 768px) {
  .modal {
    flex-direction: column;
    justify-content: center;
  }
  
  .modal-content {
    max-height: 70%;
  }
  
  .nav-btn {
    width: 60px;
    height: 60px;
    font-size: 35px;
    position: static;
    transform: none;
  }
  
  .nav-btn.prev,
  .nav-btn.next {
    left: auto;
    right: auto;
  }
  
  .modal-nav {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
  }
}