* {
  box-sizing: border-box;
}

:root {
  --page-bg: #f3f3f1;
  --card-bg: #ffffff;
  --image-bg: #eef0ef;
  --text: #111111;
  --muted: #777777;
  --line: #e5e5e2;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  gap: 24px;
  padding: 16px 5vw 14px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  text-align: center;
  grid-column: 2;
}

.brand-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-style: italic;
  letter-spacing: 0.6px;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 7px;
  color: #222222;
  font-size: 13px;
  letter-spacing: 2.4px;
}

.search-wrap {
  position: relative;
  grid-column: 3;
  justify-self: end;
  width: min(340px, 100%);
}

#searchInput {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: #f8f8f7;
  font-size: 14px;
}

#searchInput:focus {
  border-color: #111111;
  background: #ffffff;
}

#clearSearch {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #777777;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

#clearSearch.show {
  display: block;
}

.page {
  width: min(1500px, 94vw);
  margin: 28px auto 64px;
}

.gallery-info {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

.gallery-info h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.3px;
}

.gallery-info p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.count {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  min-width: 0;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.11);
}

.product-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--image-bg);
  cursor: zoom-in;
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.product-model {
  padding: 17px 10px 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.2px;
  background: #ffffff;
}

.empty {
  grid-column: 1 / -1;
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 90px 82px;
  background: rgba(0, 0, 0, 0.84);
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: min(1100px, 88vw);
  max-height: 78vh;
  object-fit: contain;
  background: #eef0ef;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 30px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  font-size: 31px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 68px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #111111;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: #ffffff;
}

.lightbox-nav.prev {
  left: 28px;
}

.lightbox-nav.next {
  right: 28px;
}

.lightbox-caption {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 32px;
  text-align: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.footer {
  padding: 28px 5vw;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .brand,
  .search-wrap {
    grid-column: auto;
  }

  .search-wrap {
    justify-self: center;
    width: min(520px, 92vw);
  }
}

@media (max-width: 760px) {
  .page {
    width: 94vw;
    margin-top: 18px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .product-model {
    padding: 12px 6px 13px;
    font-size: 14px;
  }

  .gallery-info {
    align-items: start;
    flex-direction: column;
  }

  .lightbox {
    padding: 72px 16px 82px;
  }

  .lightbox img {
    max-width: 94vw;
    max-height: 72vh;
  }

  .lightbox-nav {
    width: 40px;
    height: 56px;
    font-size: 36px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }
}
.site-logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto;
}
