/* Kontener główny */
#gallery-container {
  margin: 30px auto;
  max-width: 800px;
}

/* Pole VIN */
input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  margin: 5px 0;
  padding: 10px;
  font-size: 1rem;
}

/* Przyciski – elastyczne, wyśrodkowane */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: clamp(0.9rem, 2vw, 1rem);
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  white-space: nowrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-left: auto;
  margin-right: auto;
}

/* Komunikat błędu */
#error {
  color: red;
  margin-top: 10px;
}
#error.no-photos {
  color: #666;
  font-style: italic;
  margin-top: 20px;
  background-color: #f9f9f9;
  padding: 10px;
  border-left: 4px solid #ccc;
  border-radius: 4px;
}

/* Layout: infobox + timelinebox */
.info-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}
@media (max-width: 768px) {
  .info-layout {
    flex-direction: column;
  }
}
.info-column {
  flex: 1 1 300px;
  min-width: 280px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background: transparent;
  border: none;
}

/* Kompaktowa tabela informacji */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  margin-top: 10px;
}
.info-table th,
.info-table td {
  padding: 6px 10px;
  border-bottom: 0.5px solid #e0e0e079;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.info-table th {
  font-weight: 600;
  color: #333;
  width: 160px;
}
@media (max-width: 768px) {
  .info-table th,
  .info-table td {
    display: block;
    width: 100%;
    padding: 4px 0;
  }
  .info-table tr {
    margin-bottom: 10px;
    display: block;
  }
}

/* Galeria zdjęć */
#gallery {
  margin-top: 30px;
}
.category {
  margin-bottom: 40px;
}
.category h4 {
  margin-bottom: 10px;
  font-size: 1rem;
}
.category-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.image-wrapper {
  display: block;
  position: relative;
}
.image-wrapper img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.image-wrapper img:hover {
  transform: scale(1.02);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  padding: 20px;
}
.lightbox.hidden {
  display: none;
}

/* Wrapper dla obrazka w lightboxie */
.lightbox-img-wrapper {
  position: relative;
  display: inline-block;
}

/* Obrazek w lightboxie – zmniejszona skala */
.lightbox-img {
  max-width: 70vw;
  max-height: 65vh;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  touch-action: pan-y;
}

/* Nawigacja */
.lightbox-nav {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  justify-content: center;
}
.prev-btn, .next-btn {
  font-size: 2rem;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}
.prev-btn:hover, .next-btn:hover {
  transform: scale(1.2);
}

/* Przycisk zamykania X – w obrysie zdjęcia */
.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}
.close-btn:hover {
  transform: scale(1.2);
}

/* Zakładki galerii – wyśrodkowane i elastyczne */
.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
  text-align: center;
}
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: clamp(0.85rem, 2vw, 1rem);
  border-radius: 4px;
  white-space: nowrap;
  margin: 4px;
}
.tab-button.active {
  font-weight: bold;
}
.tab-content {
  margin-top: 10px;
}

/* Przycisk pobierania pod zdjęciem */
.image-wrapper .button-secondary {
  font-size: clamp(1rem, 2vw, 1.2rem);
  padding: 6px 10px;
  width: auto;
  min-width: 40px;
  margin-left: auto;
  margin-right: auto;
  display: inline-flex;
  justify-content: center;
}

/* Dodatkowe skalowanie na bardzo małych ekranach */
@media (max-width: 480px) {
  button,
  .button,
  .tab-button {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}
/* Wyśrodkowanie przycisku VIN */
#gallery-container {
  text-align: center;
}

/* Wyśrodkowanie przycisku ZIP w zakładce */
.category {
  text-align: center;
}

/* Bezpieczne resetowanie float/position */
button,
.button {
  float: none;
  position: static;
}
