/* ==========================================================================
   MAUNI — SHARED FOUNDATION & FONTS
   ========================================================================== */

:root {
  --font: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --red: #b0272d;
  --red-hover: #cf2e35;
  --dark: #15181f;
  --footer-bg: #111522;
  --border-red: #b0272d;
  --bg-light: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   ГЛАВНАЯ СТРАНИЦА (INDEX.HTML — ТЕМНЫЙ ГЕРОЙ НА ФОНЕ ГОР)
   ========================================================================== */

body:not(.exhibition-page) {
  background: #191c23;
  color: #f2efe8;
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
  background-color: #191c23;
  background-image: url("./assets/2740d315005f6f7cb13c9dfdaf0c88f6.svg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(25, 28, 35, 0.6) 100%);
  pointer-events: none;
}

.stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 420px;
  margin-top: 4vh;
  text-align: center;
}

.logo {
  width: min(340px, 80vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.tagline {
  margin: -8px 0 6px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8b92a3;
  font-weight: 500;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 90vw);
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 20px;
  border: 1px solid #444c5c;
  color: #f2efe8;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  background: rgba(34, 39, 49, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 4px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.links a:hover,
.links a:focus-visible {
  background: #f2efe8;
  border-color: #f2efe8;
  color: #191c23;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.links a.primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(176, 39, 45, 0.4);
}

.links a.primary:hover,
.links a.primary:focus-visible {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(176, 39, 45, 0.6);
}

.hero-footer {
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8b92a3;
}

.hero-footer a {
  color: #d4cfc5;
  border-bottom: 1px dashed #8b92a3;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.hero-footer a:hover {
  color: #f2efe8;
  border-bottom-style: solid;
}

/* ==========================================================================
   ЗАЛ ЭКСПОНАТОВ (CATALOG.HTML — МУЗЕЙНЫЙ КАТАЛОГ С КРАСНЫМИ ЛИНИЯМИ)
   ========================================================================== */

body.exhibition-page {
  background: var(--bg-light);
  color: var(--dark);
}

/* Шапка галереи */
.gallery-header {
  background: #ffffff;
  border-bottom: 1px solid #f0ede6;
  padding: 24px 48px;
}

.gallery-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-logo-link {
  display: inline-block;
  line-height: 1;
}

.gallery-logo {
  height: 26px;
  width: auto;
  display: block;
}

.gallery-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dark);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--red);
}

.nav-link.active {
  color: var(--red);
  font-weight: 700;
}

/* Строка заголовка зала */
.gallery-title-row {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 48px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.gallery-hall-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--dark);
}

.gallery-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--dark);
  letter-spacing: 0.5px;
}

/* Основной лейаут */
.gallery-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px 80px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Сайдбар */
.gallery-sidebar {
  width: 130px;
  flex-shrink: 0;
}

.sidebar-block {
  margin-bottom: 28px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hall-action,
.sort-action {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.hall-action:hover,
.sort-action:hover {
  color: var(--red);
}

.hall-action.active,
.sort-action.active {
  color: var(--red);
  font-weight: 700;
}

/* Поиск в сайдбаре */
.sidebar-search-wrap {
  position: relative;
  border-bottom: 1px solid #15181f;
  padding-bottom: 4px;
}

.sidebar-search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--dark);
  outline: none;
  padding-right: 18px;
}

.sidebar-search-input::placeholder {
  color: #999;
}

.sidebar-search-clear {
  position: absolute;
  right: 0;
  top: 0;
  border: none;
  background: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.sidebar-search-clear:hover {
  color: var(--dark);
}

/* Главный контейнер сетки */
.gallery-main {
  flex: 1;
  min-width: 0;
}

/* СЕТКА ЭКСПОНАТОВ С КРАСНЫМИ ЛИНИЯМИ */
.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border-red);
  border-left: 1px solid var(--border-red);
  background: #ffffff;
}

/* Карточка экспоната */
.exhibit-card {
  border-right: 1px solid var(--border-red);
  border-bottom: 1px solid var(--border-red);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 440px;
  cursor: pointer;
  background: #ffffff;
  position: relative;
  transition: background 0.2s ease;
}

.exhibit-card:hover {
  background: #faf9f6;
}

/* Верхняя строка карточки */
.card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.card-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.card-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--dark);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.2px;
}

.card-price {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark);
  white-space: nowrap;
  text-align: right;
  letter-spacing: 0.5px;
}

/* Центральная зона с фото на прозрачном фоне */
.card-photo-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 8px;
  overflow: hidden;
}

.card-photo-area img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.exhibit-card:hover .card-photo-area img {
  transform: scale(1.06);
}

/* Быстрые кнопки при наведении на карточку */
.card-quick-actions {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.exhibit-card:hover .card-quick-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 2px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.quick-btn:hover {
  transform: scale(1.04);
}

.quick-btn.kaspi {
  background: var(--red);
  color: #ffffff;
}

.quick-btn.wa {
  background: var(--dark);
  color: #ffffff;
}

/* Нижняя строка карточки */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 6px;
}

.card-brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dark);
}

.card-mark {
  display: inline-flex;
  align-items: center;
}

/* Пустое состояние */
.exhibit-empty {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed var(--red);
}

.exhibit-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.exhibit-empty p {
  color: #777;
  font-size: 13px;
  margin: 0 0 20px;
}

.btn-exhibit-reset {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

/* Кнопка "Загрузить ещё" */
.exhibit-load-more {
  text-align: center;
  margin-top: 32px;
}

.btn-more-exhibits {
  background: #ffffff;
  border: 1px solid var(--border-red);
  color: var(--red);
  padding: 12px 28px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-more-exhibits:hover {
  background: var(--red);
  color: #ffffff;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО "ПАСПОРТ ЭКСПОНАТА"
   ========================================================================== */

.exhibit-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.exhibit-modal[hidden] {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 21, 34, 0.75);
  backdrop-filter: blur(4px);
}

.modal-window {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border: 1px solid var(--border-red);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
  z-index: 3;
}

.modal-close:hover {
  color: var(--red);
}

.modal-content {
  display: flex;
  flex-direction: row;
}

.modal-img-col {
  width: 50%;
  background: #ffffff;
  border-right: 1px solid var(--border-red);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal-img-col img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.modal-info-col {
  width: 50%;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
}

.modal-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dark);
}

.modal-name {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--dark);
}

.modal-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.modal-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid #15181f;
  color: #15181f;
}

.modal-badge.hit {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.modal-actions-row {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn-kaspi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  background: var(--red);
  color: #ffffff;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  transition: background 0.2s;
}

.modal-btn-kaspi:hover {
  background: var(--red-hover);
}

.modal-btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  background: #ffffff;
  border: 1px solid #15181f;
  color: #15181f;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  transition: all 0.2s;
}

.modal-btn-wa:hover {
  background: #15181f;
  color: #ffffff;
}

/* ==========================================================================
   ТЕМНЫЙ ФУТЕР
   ========================================================================== */

.gallery-footer {
  background: var(--footer-bg);
  color: #ffffff;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-top-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.footer-top-btn:hover {
  opacity: 0.75;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 0.75;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ПОД ЭКРАНЫ
   ========================================================================== */

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

@media (max-width: 900px) {
  .gallery-header,
  .gallery-title-row,
  .gallery-layout,
  .gallery-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  .gallery-layout {
    flex-direction: column;
    gap: 24px;
  }
  .gallery-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
  }
  .sidebar-block {
    margin-bottom: 0;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .exhibit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-content {
    flex-direction: column;
  }
  .modal-img-col,
  .modal-info-col {
    width: 100%;
    border-right: none;
  }
  .modal-img-col {
    border-bottom: 1px solid var(--border-red);
    padding: 24px;
  }
  .modal-info-col {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .gallery-header,
  .gallery-title-row,
  .gallery-layout,
  .gallery-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .gallery-nav {
    gap: 16px;
  }
  .nav-link {
    letter-spacing: 1.5px;
    font-size: 10px;
  }
  .exhibit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .exhibit-card {
    min-height: 340px;
    padding: 10px 8px 8px;
  }
  .card-top {
    gap: 4px;
  }
  .card-title {
    font-size: 9.5px;
    -webkit-line-clamp: 2;
  }
  .card-num, .card-price {
    font-size: 9.5px;
  }
  .card-brand {
    font-size: 8.5px;
    letter-spacing: 1px;
  }
  .footer-links {
    gap: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}
