/* Catalog layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  padding-top: 70px;
}

/* Sidebar */
.catalog-sidebar {
  background: #f9f9f7;
  border-right: 1px solid #ebebeb;
  padding: 32px 24px;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.sidebar__title { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #999; margin-bottom: 20px; }
.sidebar__menu { display: flex; flex-direction: column; gap: 4px; }
.sidebar__group { margin-top: 16px; }
.sidebar__group-title {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 6px; font-size: 13px; font-weight: 700;
  color: #0f0f0f; transition: all 0.2s; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.sidebar__group-title:hover { background: #eeeeec; }
.sidebar__group-title.active { background: #0f0f0f; color: #fff; }
.sidebar__group ul { display: flex; flex-direction: column; gap: 1px; padding-left: 12px; margin-top: 2px; }
.sidebar__link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: #555; transition: all 0.2s; cursor: pointer;
}
.sidebar__link--series { font-size: 13px; color: #777; }
.sidebar__link:hover { background: #eeeeec; color: #0f0f0f; }
.sidebar__link.active { background: #0f0f0f; color: #fff; }
.sidebar__count { font-size: 11px; font-weight: 600; opacity: 0.5; margin-left: 6px; }
.sidebar__link.active .sidebar__count { opacity: 0.7; }

/* Main */
.catalog-main { padding: 40px 48px; }
.catalog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.catalog-title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.catalog-sub { font-size: 14px; color: #999; margin-top: 4px; }
.catalog-search input {
  padding: 10px 16px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; font-family: inherit; width: 260px; transition: border-color 0.2s;
}
.catalog-search input:focus { outline: none; border-color: #0f0f0f; }

/* Grid */
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.cat-card {
  background: #f5f5f3; border-radius: 8px; overflow: hidden;
  cursor: pointer; transition: transform 0.25s, box-shadow 0.25s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(0,0,0,0.08); }
.cat-card__img {
  height: 220px; background: #fff; background-size: contain; background-position: center; background-repeat: no-repeat;
  border-bottom: 1px solid #f0f0ee;
}
.cat-card__body { padding: 16px 20px; }
.cat-card__series { font-size: 11px; font-weight: 700; color: #bbb; letter-spacing: 0.08em; text-transform: uppercase; }
.cat-card__name { font-size: 15px; font-weight: 700; margin: 4px 0 6px; line-height: 1.35; }
.cat-card__size { font-size: 12px; color: #888; }
.cat-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.cat-card__price { font-size: 14px; font-weight: 700; color: #0f0f0f; }
.cat-card__cta { font-size: 12px; font-weight: 700; color: #0f0f0f; border-bottom: 1px solid currentColor; padding-bottom: 1px; }

/* Modal */
.modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 500; align-items: center; justify-content: center; padding: 24px;
}
.modal.open { display: flex; }
.modal__box {
  background: #fff; border-radius: 12px; max-width: 860px; width: 100%;
  display: grid; grid-template-columns: 1.2fr 1fr; overflow: hidden; position: relative;
  max-height: 90vh;
}
.modal__close {
  position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.07);
  border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 14px; z-index: 1; transition: background 0.2s;
}
.modal__close:hover { background: rgba(0,0,0,0.15); }
.modal__img {
  background: #f8f8f6; background-size: contain; background-position: center;
  background-repeat: no-repeat; min-height: 420px;
}
.modal__body { padding: 36px; display: flex; flex-direction: column; overflow-y: auto; }
.modal__cat { font-size: 11px; font-weight: 700; color: #bbb; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.modal__title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 12px; }
.modal__size { font-size: 13px; color: #888; margin-bottom: 8px; }
.modal__desc { font-size: 13px; color: #666; line-height: 1.65; margin-bottom: 12px; flex: 1; overflow-y: auto; }
.modal__price { font-size: 17px; font-weight: 800; color: #0f0f0f; margin-top: auto; }

/* Responsive */
@media (max-width: 1100px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar { position: fixed; left: -300px; top: 70px; height: calc(100vh - 70px); width: 280px; z-index: 90; transition: left 0.3s; box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
  .catalog-sidebar.open { left: 0; }
  .catalog-main { padding: 24px; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .modal__box { grid-template-columns: 1fr; }
  .modal__img { min-height: 200px; }
}
@media (max-width: 500px) {
  .catalog-grid { grid-template-columns: 1fr; }
}
