/* RvtStore catalog — full-scale layout (no global shrink) */

html {
  font-size: 16px;
}

:root {
  --background: #f7f8f6;
  --surface: #ffffff;
  --surface-muted: #f3f5f2;
  --text-primary: #171a18;
  --text-secondary: #747d76;
  --border: #e1e6e1;
  --green: #1f553d;
  --green-dark: #153e2d;
  --green-light: #e5f4e9;

  --rvt-bg: var(--background);
  --rvt-surface: var(--surface);
  --rvt-surface-2: var(--surface-muted);
  --rvt-ink: var(--text-primary);
  --rvt-muted: var(--text-secondary);
  --rvt-border: var(--border);
  --rvt-green: var(--green);
  --rvt-green-hover: var(--green-dark);
  --rvt-green-soft: var(--green-light);
  --primary: var(--green);
  --primary-dark: var(--green-dark);
  --primary-light: var(--green-light);
  --lib-green: var(--green);
  --lib-green-soft: var(--green-light);
  --rvt-max: 1360px;
  --lib-max: 1360px;
  --page-max: 1360px;
  --header-h: 72px;
}

body.library-catalog-home {
  margin: 0;
  background: #f7f8f6;
  color: #171a18;
  font-size: 16px;
  transform: none !important;
  zoom: normal !important;
}

body.library-catalog-home .bg-mesh {
  display: none;
}

body.library-catalog-home,
body.library-catalog-home .library-main,
body.library-catalog-home .library-container,
body.library-catalog-home .library-layout,
body.library-catalog-home .library-catalog-main,
body.library-catalog-home .library-explorer {
  width: 100%;
  max-width: none;
  transform: none !important;
  zoom: normal !important;
}

/* —— Page container 1360 —— */
body.library-catalog-home .library-container {
  width: 100%;
  max-width: 1360px !important;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
  box-sizing: border-box;
}

body.library-catalog-home .library-main {
  padding: 28px 0 64px !important;
  width: 100%;
  max-width: none !important;
  box-sizing: border-box;
}

body.library-catalog-home .library-explorer,
body.library-catalog-home .library-catalog-main {
  width: 100%;
  min-width: 0;
  max-width: none !important;
}

/* —— Main grid —— */
body.library-catalog-home .library-layout {
  display: grid !important;
  grid-template-columns: 240px minmax(0, 1fr) !important;
  gap: 28px !important;
  column-gap: 28px !important;
  align-items: start;
  width: 100%;
  justify-content: stretch !important;
}

/* —— Header full width —— */
body.library-catalog-home .site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  transform: none !important;
}

body.library-catalog-home .header-inner.header-ozon {
  width: 100%;
  max-width: 1360px !important;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
  --ozon-header-control-h: 44px;
}

body.library-catalog-home .header-row-main {
  min-height: 72px;
  height: auto;
  padding: 14px 0;
  gap: 24px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

body.library-catalog-home .header-row-mid {
  max-width: none !important;
  width: 100% !important;
  justify-content: center;
  display: flex;
}

body.library-catalog-home .catalog-header-search,
body.library-catalog-home .header-search-shell {
  width: clamp(480px, 46vw, 650px) !important;
  max-width: clamp(480px, 46vw, 650px) !important;
  flex: 0 1 auto;
}

body.library-catalog-home .header-ozon .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--green);
}

body.library-catalog-home .header-ozon .logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

body.library-catalog-home .header-ozon .logo-tagline {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

body.library-catalog-home .header-inner.header-ozon .header-search {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  width: 100%;
}

body.library-catalog-home .header-ozon .header-search-submit {
  width: 42px;
  height: 42px;
  margin: 1px;
  border-radius: 10px;
  background: var(--green);
}

body.library-catalog-home .header-actions-ozon {
  gap: 24px;
  align-items: center;
}

body.library-catalog-home .header-actions-tools {
  display: grid;
  grid-template-columns: auto auto auto;
  column-gap: 24px;
  align-items: start;
  justify-items: center;
}

body.library-catalog-home .header-actions-tools .header-action {
  width: auto;
  min-width: 72px;
  max-width: none;
  padding: 2px 4px 0;
}

body.library-catalog-home .header-actions-tools .header-action svg {
  width: 20px;
  height: 20px;
}

body.library-catalog-home .header-actions-tools .header-action-label {
  font-size: 12px;
  max-width: 110px;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

body.library-catalog-home .header-action--upload {
  display: inline-flex !important;
  visibility: visible !important;
}

body.library-catalog-home .header-row-catalog,
body.library-catalog-home .header-catalog-nav {
  height: 48px;
  min-height: 48px;
  padding: 0;
  align-items: center;
}

body.library-catalog-home .header-catalog-nav {
  gap: 28px;
  flex-wrap: nowrap;
}

body.library-catalog-home .header-catalog-nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 14px 0;
  border-bottom: 2px solid transparent;
}

body.library-catalog-home .header-catalog-nav-link.is-active {
  color: #174c35;
  font-weight: 600;
  border-bottom-color: #174c35;
}

/* —— Title row —— */
body.library-catalog-home .catalog-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0 0 18px;
}

body.library-catalog-home .catalog-results-title {
  font-size: 27px;
  line-height: 1.15;
  font-weight: 750;
  color: var(--text-primary);
}

body.library-catalog-home .catalog-results-count {
  margin-left: 10px;
  font-size: 13px;
  color: #727b74;
  font-family: inherit;
}

body.library-catalog-home .catalog-toolbar-controls {
  margin-left: auto;
}

body.library-catalog-home .catalog-tool-btn,
body.library-catalog-home .catalog-view-btn {
  height: 40px;
  font-size: 12px;
  border-radius: 10px;
}

body.library-catalog-home .catalog-view-btn {
  width: 40px;
}

body.library-catalog-home .catalog-view-btn.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* —— Sidebar 240 —— */
body.library-catalog-home .library-nav {
  width: 240px !important;
  max-width: 240px !important;
  background: #fff;
  border: 1px solid #e2e6e2;
  border-radius: 14px;
  padding: 20px 16px;
  position: sticky;
  top: 136px;
  max-height: calc(100vh - 152px);
  overflow: auto;
  box-sizing: border-box;
}

body.library-catalog-home .lib-nav-head .lib-nav-title,
body.library-catalog-home .lib-nav-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #171a18 !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
}

body.library-catalog-home .lib-nav-subtitle {
  font-size: 12px;
  color: #747d76;
  font-family: inherit;
}

body.library-catalog-home .lib-nav-row,
body.library-catalog-home .lib-nav-row--parent {
  min-height: 40px;
  height: auto;
  padding: 0 8px !important;
  border-radius: 8px;
  font-size: 13px !important;
  color: #2d332f;
  align-items: center;
}

body.library-catalog-home .lib-nav-row:hover,
body.library-catalog-home .lib-nav-row--parent:hover {
  background: #f0f5f1 !important;
  color: #174c35;
}

body.library-catalog-home .lib-nav-row.is-active,
body.library-catalog-home .lib-nav-row--parent.is-active {
  background: #f0f5f1 !important;
  color: #174c35;
  font-weight: 600;
}

body.library-catalog-home .lib-nav-icon,
body.library-catalog-home .lib-nav-icon svg {
  width: 16px;
  height: 16px;
}

body.library-catalog-home .lib-nav-count {
  margin-left: auto;
  font-size: 11px;
  font-family: inherit;
  color: #747d76;
}

body.library-catalog-home .lib-nav-filters {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e6e9e6;
}

body.library-catalog-home .lib-nav-select,
body.library-catalog-home .lib-nav-filter-field {
  font-size: 12px;
}

body.library-catalog-home .lib-nav-select {
  height: 40px;
  width: 100%;
}

body.library-catalog-home .lib-nav-check {
  font-size: 13px;
}

/* —— Authors —— */
body.library-catalog-home .catalog-highlights {
  width: 100%;
  margin: 0 0 20px;
}

body.library-catalog-home .catalog-authors-bar {
  width: 100%;
  min-height: 88px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e6e2;
  margin-bottom: 0;
  box-sizing: border-box;
}

body.library-catalog-home .catalog-authors-bar-head h3 {
  font-size: 12px;
  font-weight: 600;
  color: #68716a;
}

body.library-catalog-home .catalog-authors-bar-scroll {
  gap: 32px;
}

body.library-catalog-home .catalog-author-chip img,
body.library-catalog-home .catalog-author-chip-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

body.library-catalog-home .catalog-author-chip-meta strong {
  font-size: 14px;
  font-weight: 650;
}

body.library-catalog-home .catalog-author-chip-meta small {
  font-size: 12px;
  color: #768078;
}

/* —— Product grid —— */
body.library-catalog-home #product-grid.browse-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: none !important;
}

/* List view — must beat 4-col grid !important above */
body.library-catalog-home #product-grid.browse-grid.browse-grid--list {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card.browse-card--bim {
  display: grid !important;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) !important;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  transform: none;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card.browse-card--bim:hover {
  transform: none;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card--bim .browse-card-media {
  aspect-ratio: 1 / 1 !important;
  height: 100% !important;
  min-height: 140px;
  border-bottom: none;
  border-right: 1px solid #e8ebe8;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card--bim .browse-card-body {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px 18px !important;
  min-width: 0;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card--bim .browse-card-title {
  -webkit-line-clamp: 2;
  font-size: 15px;
}

body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card-add {
  display: none;
}

body.library-catalog-home .browse-card.browse-card--bim {
  width: 100%;
  min-width: 0;
  max-width: none;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #dfe5df;
  overflow: hidden;
  height: auto;
  box-shadow: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body.library-catalog-home .browse-card.browse-card--bim:hover {
  transform: translateY(-2px);
  border-color: #b9cabd;
  box-shadow: 0 10px 28px rgba(23, 52, 36, 0.08);
}

/* Preview — 1:1 frame (matches square uploads); overlays on top */
body.library-catalog-home .browse-card--bim .browse-card-media {
  position: relative;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  background: #f3f5f2 !important;
  background-image: none !important;
  border-bottom: 1px solid #e8ebe8;
  overflow: hidden;
  box-sizing: border-box;
}

body.library-catalog-home .browse-card--bim .browse-card-media-link {
  position: absolute;
  inset: 0 !important;
  z-index: 1;
}

body.library-catalog-home .browse-card--bim .browse-card-stage {
  position: absolute !important;
  inset: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
}

body.library-catalog-home .browse-card--bim .browse-card-stage img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  filter: none !important;
}

body.library-catalog-home .browse-card--bim:hover .browse-card-stage img {
  transform: none !important;
}

body.library-catalog-home .browse-card-add,
body.library-catalog-home .browse-card--bim .browse-card-fav {
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #2a2e2b;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.library-catalog-home .browse-card-add svg,
body.library-catalog-home .browse-card--bim .browse-card-fav svg {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

body.library-catalog-home .browse-card-add {
  left: 8px;
}

body.library-catalog-home .browse-card--bim .browse-card-fav {
  right: 8px;
  left: auto;
}

body.library-catalog-home .browse-card-badges {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: none;
  z-index: 3;
  pointer-events: none;
}

body.library-catalog-home .browse-card-pill--verified {
  display: none !important;
}

body.library-catalog-home .browse-card-pill--revit {
  height: auto;
  padding: 0;
  border-radius: 0;
  margin-left: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #4a524c;
  font-family: var(--rvt-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.95), 0 1px 2px rgba(255, 255, 255, 0.8);
}

body.library-catalog-home .browse-card--bim .browse-card-tech {
  display: none !important;
}

body.library-catalog-home .browse-card--bim .browse-card-body {
  padding: 16px 14px 14px;
}

body.library-catalog-home .browse-card--bim .browse-card-title {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  min-height: 39px;
  color: #171a18;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.library-catalog-home .browse-card-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: #7b847d;
}

body.library-catalog-home .browse-card--bim .browse-card-price {
  margin-top: 13px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 750;
  color: #1a1d1b;
}

body.library-catalog-home .browse-card--bim .browse-card-price.is-free {
  color: #154e34;
}

body.library-catalog-home .browse-card--bim .browse-card-tech {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid #edf0ed;
  font-family: var(--rvt-mono, ui-monospace, monospace);
  font-size: 10px;
  color: #778079;
}

/* —— Responsive —— */
@media (max-width: 1200px) {
  body.library-catalog-home .library-container,
  body.library-catalog-home .header-inner.header-ozon {
    padding-left: 24px;
    padding-right: 24px;
  }

  body.library-catalog-home #product-grid.browse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.library-catalog-home #product-grid.browse-grid.browse-grid--list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  body.library-catalog-home .library-layout {
    grid-template-columns: 1fr !important;
  }

  body.library-catalog-home .library-nav {
    display: none;
  }

  body.library-nav-open .library-nav {
    display: block;
    width: min(300px, 88vw) !important;
    max-width: none !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 400;
    border-radius: 0;
    max-height: none;
  }

  body.library-catalog-home #product-grid.browse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.library-catalog-home #product-grid.browse-grid.browse-grid--list {
    grid-template-columns: 1fr !important;
  }

  body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card.browse-card--bim {
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) !important;
  }

  body.library-catalog-home .catalog-header-search,
  body.library-catalog-home .header-search-shell {
    width: min(100%, 480px) !important;
    max-width: 100% !important;
  }

  body.library-catalog-home .header-actions-tools {
    column-gap: 12px;
  }
}

@media (max-width: 600px) {
  body.library-catalog-home #product-grid.browse-grid {
    grid-template-columns: 1fr !important;
  }

  body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card.browse-card--bim {
    grid-template-columns: 1fr !important;
  }

  body.library-catalog-home #product-grid.browse-grid.browse-grid--list .browse-card--bim .browse-card-media {
    border-right: none;
    border-bottom: 1px solid #e8ebe8;
    aspect-ratio: 16 / 10 !important;
    height: auto !important;
    min-height: 0;
  }

  body.library-catalog-home .catalog-results-title {
    font-size: 22px;
  }
}
