/* Общие стили */
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #f9f9f9;
  color: #222;
}

.container {
  padding: 1em;
}

/* Шапка сайта */
.site-header {
  background: #f7f7f7;
  padding: 1em;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  align-items: center;
}

.site-header h1 {
  margin: 0;
  text-align: center;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  justify-content: center;
  align-items: center;
}

.filters select, .btn {
  padding: 0.5em 1em;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 0.9em;
}

.btn.small {
  padding: 0.3em 0.8em;
  font-size: 0.85em;
}

/* Кнопка "Замовити" */
.btn.order {
  background-color: #d93025;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.5em 1em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn.order:hover {
  background-color: #b7281d;
}

.hidden {
  display: none !important;
}

/* Галерея — исправлено на flexbox */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* центрирование по горизонтали */
  gap: 1em;                /* промежутки между фото */
  padding: 1em;
}

/* Карточка фото */
.photo-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0.5em;
  text-align: center;
  width: 220px;      /* фиксированная ширина */
  flex-shrink: 0;    /* не сжимается при фильтрации */
}

/* Изображение */
.thumb-box img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  object-fit: cover;
}

/* Подпись под фото */
.photo-caption {
  margin-top: 0.4em;
  font-size: 0.9em;
  color: #555;
}

/* Кнопка заказа внутри карточки */
.photo-card .order-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  background-color: #d93025;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.photo-card .order-btn:hover {
  background-color: #b7281d;
}
.photo-card .order-btn.ordered {
  background-color: #4caf50;
}

/* Лайтбокс */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
}
.lightbox.visible {
  display: flex;
}
.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox .btn.small {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox .btn.small:hover {
  background: rgba(255,255,255,0.3);
}

/* Тёмная тема */
body.dark-mode {
  background-color: #121212;
  color: #f0f0f0;
}
body.dark-mode .site-header {
  background-color: #1e1e1e;
  color: #ffffff;
  border-bottom: 1px solid #333;
}
body.dark-mode .site-header h1 {
  color: #ffffff;
}
body.dark-mode select,
body.dark-mode button {
  background-color: #2a2a2a;
  color: #ffffff;
  border: 1px solid #555;
}
body.dark-mode button:hover {
  background-color: #3a3a3a;
}
body.dark-mode .photo-card {
  background-color: #1e1e1e;
}
body.dark-mode .photo-caption {
  color: #ddd;
}

/* === ДОПОЛНЕНИЕ: ФИКСАЦИЯ ПАНЕЛИ ФИЛЬТРОВ === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: inherit; /* сохраняет фон темы */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

main {
  padding-top: 10px; /* чтобы контент не перекрывался */
}

/* Для мобильных отключаем фиксирование */
@media (max-width: 600px) {
  .site-header {
    position: relative;
    box-shadow: none;
  }
}
