.models-gallery-page {
  background: #f7f8fa;
}

.models-gallery-page #header .topo {
  position: relative !important;
  background: #050505 !important;
  height: 125px !important;
  min-height: 125px !important;
  box-shadow: none !important;
}

.models-page {
  min-height: 620px;
  padding: 42px 0 64px;
  background:
    linear-gradient(180deg, #fff 0, #fff 56%, #f7f8fa 100%);
}

.models-heading {
  margin-bottom: 34px;
  text-align: center;
}

.models-heading h1 {
  display: inline-block;
  margin: 0;
  padding: 0 0 11px;
  color: #171717;
  border-bottom: 4px solid #a12129;
  font-family: "Oswald", sans-serif;
  font-size: 26px;
  font-weight: 600;
  text-transform: uppercase;
}

.models-filters {
  margin: 0 0 34px;
  padding: 20px 22px;
  border: 1px solid #e4e7eb;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 28, 38, 0.05);
}

.models-filter-label {
  display: block;
  margin-bottom: 13px;
  color: #6b7280;
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.models-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.models-filter-list button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 11px 8px 14px;
  color: #454b54;
  border: 1px solid #d9dde2;
  border-radius: 3px;
  background: #fff;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.models-filter-list button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: #747b85;
  border-radius: 10px;
  background: #eef0f3;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.models-filter-list button:hover:not(:disabled) {
  color: #a12129;
  border-color: rgba(161, 33, 41, 0.45);
  box-shadow: 0 4px 12px rgba(161, 33, 41, 0.08);
}

.models-filter-list button.is-active {
  color: #fff;
  border-color: #a12129;
  background: #a12129;
}

.models-filter-list button.is-active > span {
  color: #a12129;
  background: #fff;
}

.models-filter-list button:disabled {
  color: #a4a9b0;
  border-color: #eceef1;
  background: #f8f9fa;
  cursor: not-allowed;
  opacity: 0.72;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  min-height: 310px;
}

.model-card {
  align-self: start;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e1e4e8;
  box-shadow: 0 12px 30px rgba(20, 28, 38, 0.08);
}

.model-preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e8eaed;
  cursor: pointer;
  text-align: left;
}

.model-browser-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  background: #20242b;
}

.model-browser-bar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6c737d;
}

.model-browser-bar i:first-child {
  background: #a12129;
}

.model-viewport {
  position: relative;
  display: block;
  height: 230px;
  overflow: hidden;
  background: #ddd;
}

.model-viewport img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.model-preview::after {
  content: "";
  position: absolute;
  inset: 24px 0 0;
  z-index: 2;
  background: rgba(10, 14, 20, 0);
  transition: background 180ms ease;
}

.model-preview-action {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  padding: 11px 18px;
  color: #fff;
  background: #a12129;
  font-family: "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, -40%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.model-preview:hover::after,
.model-preview:focus-visible::after {
  background: rgba(10, 14, 20, 0.52);
}

.model-preview:hover .model-preview-action,
.model-preview:focus-visible .model-preview-action {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.model-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 18px;
}

.model-info h2 {
  margin: 0 0 5px;
  color: #222;
  font-family: "Oswald", sans-serif;
  font-size: 20px;
  text-transform: uppercase;
}

.model-info p {
  margin: 0;
  color: #777;
  font-size: 12px;
  text-transform: uppercase;
}

.model-info button {
  flex: 0 0 auto;
  padding: 9px 13px;
  color: #fff;
  border: 0;
  background: #a12129;
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.models-custom {
  margin-top: 46px;
  padding: 40px 20px;
  border: 1px solid #e5e7eb;
  background: #fff;
  text-align: center;
}

.models-custom h2 {
  margin: 0 0 8px;
  color: #222;
  font-family: "Oswald", sans-serif;
  font-size: 24px;
  text-transform: uppercase;
}

.models-custom p {
  margin: 0 0 26px;
  color: #666;
}

.models-custom a {
  display: inline-block;
  min-width: 350px;
  padding: 17px 30px;
  color: #fff;
  background: #a12129;
  font-family: "Oswald", sans-serif;
  font-size: 24px;
  font-weight: 600;
  text-transform: uppercase;
}

.model-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 7, 12, 0.88);
  backdrop-filter: blur(5px);
}

.model-modal-window {
  display: flex;
  flex-direction: column;
  width: min(1500px, 96vw);
  height: 94vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.model-modal-window > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 12px 8px 20px;
  color: #fff;
  background: #171b22;
}

.model-modal-window > header strong {
  display: block;
  font-family: "Oswald", sans-serif;
  font-size: 18px;
  text-transform: uppercase;
}

.model-modal-window > header span {
  display: block;
  margin-top: 2px;
  color: #aeb4bd;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.model-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-modal-actions a {
  padding: 10px 15px;
  color: #fff;
  background: #a12129;
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.model-modal-actions button {
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  font-size: 28px;
  line-height: 32px;
  cursor: pointer;
}

.model-modal-body {
  flex: 1;
  min-height: 0;
  background: #fff;
}

.model-modal-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 991px) {
  .models-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .models-gallery-page #header .topo {
    height: 95px !important;
    min-height: 95px !important;
  }

  .models-grid {
    grid-template-columns: 1fr;
  }

  .models-custom a {
    min-width: 0;
    width: 100%;
    font-size: 20px;
  }

  .model-modal {
    padding: 0;
  }

  .model-modal-window {
    width: 100vw;
    height: 100vh;
  }

  .model-modal-actions a {
    display: none;
  }
}
