.brand {
  color: var(--ink);
  text-decoration: none;
}

.brand-logo-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.brand-logo-wrap .brand-mark {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-logo-wrap .brand-mark:not([src]),
.brand-logo-wrap .brand-mark[src=""] {
  display: none;
}

.brand-copy strong {
  font-size: clamp(0.95rem, 1.35vw, 1.16rem);
  font-weight: 800;
}

.brand-copy span {
  max-width: 360px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.catalog-intro {
  padding-top: 34px;
}

.catalog-structure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.catalog-structure-grid article {
  min-height: 210px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.catalog-structure-grid span {
  display: block;
  margin-bottom: 24px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.catalog-structure-grid h3 {
  margin-bottom: 10px;
}

.catalog-structure-grid p {
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.7;
}

.catalog-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 0 0 34px;
}

.catalog-sidebar,
.catalog-main,
.catalog-toolbar,
.catalog-product-card,
.product-dialog {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.catalog-sidebar {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 128px);
  padding: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar-head {
  flex: 0 0 auto;
  margin-bottom: 16px;
}

.tree-list {
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.tree-list::-webkit-scrollbar {
  width: 8px;
}

.tree-list::-webkit-scrollbar-track {
  background: #f5efe6;
  border-radius: 999px;
}

.tree-list::-webkit-scrollbar-thumb {
  background: rgba(212, 109, 0, 0.34);
  border-radius: 999px;
}

.tree-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--navy);
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
}

.tree-button:hover,
.tree-button.is-active {
  border-color: rgba(244, 139, 32, 0.28);
  background: #fff4e7;
  color: var(--accent-dark);
}

.tree-button.child {
  padding-left: 28px;
  color: var(--muted);
}

.tree-button small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tree-button span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.catalog-main {
  padding: 22px;
  box-shadow: var(--shadow);
}

.catalog-toolbar {
  padding: 18px;
  background: #fff;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.search-box label,
.filter-row label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.search-box input,
.filter-row select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  border-radius: 10px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filter-row label {
  display: grid;
  gap: 7px;
}

.button.reset {
  min-height: 44px;
}

.catalog-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  color: var(--muted);
  font-weight: 800;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.catalog-product-card {
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.catalog-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.catalog-product-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(244, 139, 32, 0.13), rgba(34, 53, 70, 0.08)),
    repeating-linear-gradient(45deg, #fffaf2 0, #fffaf2 12px, #f2eadf 12px, #f2eadf 24px);
  color: var(--muted);
  font-weight: 800;
}

.catalog-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product-body {
  padding: 18px;
}

.product-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.catalog-product-card h3 {
  margin-bottom: 14px;
}

.product-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.product-meta div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
}

.product-meta dt {
  color: var(--muted);
  font-weight: 700;
}

.product-meta dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
}

.mini-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 38px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
  border-radius: var(--r-md);
}

.cta-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 54px;
  padding: 30px;
}

.product-dialog {
  width: min(900px, calc(100% - 32px));
  padding: 0;
  overflow: visible;
}

.product-dialog::backdrop {
  background: rgba(16, 24, 32, 0.68);
}

.dialog-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.dialog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
}

.dialog-layout .catalog-product-image {
  height: 100%;
  min-height: 400px;
  aspect-ratio: auto;
}

.dialog-copy {
  padding: 32px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.detail-item {
  padding: 13px;
  border: 1px solid var(--line);
  background: #fffaf2;
  border-radius: 10px;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 1180px) {
  .catalog-app {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: static;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .catalog-intro {
    padding-top: 24px;
  }

  .catalog-structure-grid {
    grid-template-columns: 1fr;
  }

  .catalog-structure-grid article {
    min-height: auto;
    padding: 18px;
  }

  .catalog-app {
    gap: 16px;
    padding-bottom: 24px;
  }

  .catalog-sidebar,
  .catalog-main,
  .catalog-toolbar {
    border-radius: 18px;
  }

  .catalog-sidebar,
  .catalog-main {
    padding: 16px;
  }

  .catalog-sidebar {
    max-height: none;
  }

  .tree-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tree-list::-webkit-scrollbar {
    display: none;
  }

  .tree-button {
    flex: 0 0 auto;
    width: auto;
    max-width: 240px;
    min-height: 42px;
    align-items: center;
    white-space: nowrap;
  }

  .tree-button.child {
    padding-left: 12px;
  }

  .tree-button small {
    display: none;
  }

  .catalog-status {
    display: grid;
    gap: 6px;
    padding: 14px 0;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo-wrap {
    width: 40px;
    height: 40px;
  }

  .brand-logo-wrap .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-copy span {
    max-width: 240px;
  }

  .filter-row,
  .product-grid,
  .dialog-layout,
  .detail-list,
  .cta-strip {
    grid-template-columns: 1fr;
  }

  .cta-strip {
    display: grid;
    margin-bottom: 32px;
    padding: 20px;
  }

  .catalog-product-body {
    padding: 16px;
  }

  .product-kicker,
  .product-meta div {
    grid-template-columns: 1fr;
    display: grid;
    gap: 4px;
  }

  .catalog-product-card h3 {
    font-size: 1.08rem;
    line-height: 1.22;
  }

  .card-actions,
  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mini-button {
    width: 100%;
    min-height: 42px;
  }

  .product-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
    border-radius: 18px;
  }

  .dialog-close {
    top: 10px;
    right: 10px;
    z-index: 2;
  }

  .dialog-layout .catalog-product-image {
    min-height: auto;
    aspect-ratio: 4 / 3;
  }

  .dialog-copy {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .catalog-sidebar,
  .catalog-main {
    padding: 14px;
  }

  .catalog-toolbar {
    padding: 14px;
  }

  .catalog-product-image {
    aspect-ratio: 1 / 0.82;
  }
}
