/* RESET */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fff;
  color: #111;
  overflow-x: hidden;
}

.muted {
  color: #666;
  font-size: 13px;
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* FOOTER */
.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid #eee;
}

.site-footer__inner {
  display: flex;
  justify-content: center;
}

.site-footer__nav {
  display: flex;
  gap: 14px;
}

.site-footer__nav a {
  text-decoration: none;
  font-size: 14px;
  color: #777;
}

.site-footer__nav a:hover {
  color: #111;
}

/* HEADER */
.topbar {
  height: 100px;
  display: flex;
  align-items: center;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 120px;   /* ГЛАВНОЕ ЗНАЧЕНИЕ */
  width: auto;
}


.nav {
  display: flex;
  gap: 45px;
}

.nav a {
  text-decoration: none;
  font-size: 16px;
  color: #777;
}
.nav a:hover { color: #111; }

.actions {
  display: flex;
  gap: 10px;
  margin-left: 32px;
}

/* BUTTONS */
.btn {
  border: none;
  padding: 12px 40px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.95; }

.btn--teal { background: #2db7ae; color: #fff; }
.btn--dark { background: #111; color: #fff; }

/* HERO */
.hero--full {
  position: relative;
  height: calc(100vh - 80px);
  min-height: 720px;
  overflow: hidden;
  background: #fff;
}

/* PRINTER BACKGROUND */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* STAGE: якорь для blobs и текста (чтобы НЕ "летали") */
.hero__stage {
  position: relative;
  z-index: 1;           /* выше принтера */
  width: 100%;
  height: 100%;
}

/* BLOBS */
.hero-blob {
  position: absolute;
  height: auto;
  z-index: 1;           /* ниже текста */
  pointer-events: none;
  user-select: none;
  opacity: 0.95;
}

/*
  ВАЖНО:
  - используем % + clamp, чтобы на разных экранах стояло стабильно
  - top/left в процентах от hero, а размер в clamp
*/

/* верхний blob — рядом с заголовком */
.hero-blob--top {
  top: -3%;
  left: 35%;
  width: clamp(850px, 22vw, 1300px);
}

/* нижний blob — большой слева снизу, частично за краем */
.hero-blob--bottom {
  left: 20%;
  bottom: 8%;
  width: clamp(500px, 38vw, 700px);
}

/* CONTENT */
.hero__content {
  position: relative;
  z-index: 2;           /* выше blobs */
  height: 100%;
  display: flex;
  align-items: flex-start;
  padding-top: 380px;   /* <<< ТЕКСТ НИЖЕ (главное изменение) */
}

/* HERO TEXT */
.hero__left h1 {
  font-size: 84px;
  margin: 0;
  line-height: 0.95;
}

.line {
  width: 260px;
  height: 2px;
  background: #111;
  margin: 14px 0 10px;
}

.hero__left p {
  font-size: 25px;
  color: #555;
  max-width: 420px;
  margin: 0 0 18px;
}

.btn--join {
  padding: 14px 48px;
  font-size: 25px;
}

/* CATALOG */
.catalog {
  padding: 80px 0 100px;
}

.catalog__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.chip {
  border: none;
  background: #111;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #111;
  border-radius: 999px;
  padding: 6px 10px;
  flex: 1;
  max-width: 520px;
  margin-left: 8px;
}

.search input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13px;
}

.search button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.toolbar-icons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
}

/* =========================
   CATALOG (SEARCH + GRID)
   ========================= */

.catalog {
  padding: 70px 0 90px;
}

/* toolbar */
.catalog__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

/* левая часть: chips + search */
.catalog__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0; /* важно, чтобы search сжимался корректно */
  flex-wrap: wrap;
}

.chip {
  border: none;
  background: #111;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.chip--light {
  background: #e9e9e9;
  color: #111;
}

.category-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 520px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.category-chips::-webkit-scrollbar {
  height: 6px;
}

.category-chips::-webkit-scrollbar-track {
  background: transparent;
}

.category-chips::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

.category-chip {
  border: 1px solid #111;
  background: #fff;
  color: #111;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.category-chip:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.category-chip.is-active {
  background: #111;
  color: #fff;
}

.category-count {
  font-size: 12px;
  color: #111;
  background: #e9e9e9;
  padding: 6px 10px;
  border-radius: 999px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;

  border: 2px solid #111;
  border-radius: 999px;
  padding: 6px 10px;

  flex: 1;
  max-width: 520px;
  min-width: 220px;
}

.search input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  background: transparent;
}

.search button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

/* icons справа */
.toolbar-icons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
}

/* =========================
   PRODUCTS GRID
   ========================= */

/* можно оставлять .products, но главный якорь — id */
#productsGrid,
.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* card */
.product-card {
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,0.08);
  overflow: hidden;

  display: flex;
  flex-direction: column; /* чтобы низ прижимался вниз */
  min-height: 100%;
  position: relative;
}

.product-card__iconbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.product-card__icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.product-card__icon:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.product-card__icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}

/* image */
.product-card__img {
  height: 220px; /* чуть больше, выглядит богаче */
  background: #f3f3f3;
}

.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* body */
.product-card__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1; /* растягиваем тело карточки */
}

/* title */
.product-card__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

/* description (обрезаем, чтобы карточки были одинаковые) */
.product-card__desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: #666;
  line-height: 1.35;

  display: -webkit-box;
  -webkit-line-clamp: 2;      /* 2 строки как на маркетплейсе */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* bottom: always at the bottom */
.product-card__bottom {
  margin-top: auto; /* КЛЮЧ: прижимаем цену/кнопку вниз */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-card__price {
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
}

.product-card__btn {
  padding: 8px 18px;
}

.product-card__actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

.product-card__order-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #2db7ae;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.product-card__order-icon:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.product-card__order-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}


/* bottom button */
.catalog__bottom {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 980px) {
  .container {
    padding: 0 18px;
  }

  .topbar {
    height: auto;
    padding: 10px 0;
  }

  .topbar__inner {
    flex-wrap: wrap;
  }

  .logo img {
    height: 88px;
  }

  .nav {
    width: 100%;
    order: 3;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
  }

  .actions {
    margin-left: 0;
    order: 2;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero--full {
    height: auto;
    min-height: 560px;
  }

  .hero-blob--top {
    left: 22%;
    width: clamp(520px, 44vw, 820px);
  }

  .hero-blob--bottom {
    left: 2%;
    width: clamp(420px, 52vw, 620px);
  }

  .hero__content {
    padding-top: 240px;
  }

  .hero__left h1 {
    font-size: clamp(48px, 7.2vw, 72px);
  }

  .hero__left p {
    font-size: 20px;
    max-width: 520px;
  }

  .btn--join {
    font-size: 20px;
  }
}

@media (max-width: 980px) {
  #productsGrid,
  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog__toolbar {
    flex-wrap: wrap;
    gap: 14px;
  }

  .catalog__left {
    width: 100%;
  }

  .search {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .container {
    padding: 0 14px;
  }

  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
  }

  .logo img {
    height: 68px;
  }

  .actions {
    order: 2;
  }

  .nav {
    order: 3;
  }

  .nav {
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .nav::-webkit-scrollbar {
    height: 6px;
  }

  .nav::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
  }

  .nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .hero--full {
    min-height: 520px;
  }

  .hero-bg {
    object-fit: cover;
    object-position: center;
    opacity: 0.6;
  }

  .hero-blob {
    display: none;
  }

  .hero__content {
    padding-top: 170px;
  }

  .hero__left {
    text-align: center;
  }

  .line {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__left h1 {
    font-size: clamp(44px, 12vw, 58px);
  }

  .hero__left p {
    font-size: 17px;
  }

  .btn--join {
    padding: 12px 22px;
    font-size: 18px;
  }

  .catalog__toolbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
  }

  .catalog__left {
    width: 100%;
  }

  .toolbar-icons {
    width: 100%;
    justify-content: flex-start;
  }

  .product-card__img {
    height: 200px;
  }

  #productsGrid,
  .products {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .modal__content,
  .modal__panel {
    margin: 24px auto 0;
  }
}

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal__content {
  position: relative;
  width: min(640px, calc(100% - 32px));
  margin: 80px auto 0;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.2);
}

.modal__form {
  display: grid;
  gap: 12px;
}

.modal__form input,
.modal__form select,
.modal__form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.modal__form input:focus,
.modal__form select:focus,
.modal__form textarea:focus {
  border-color: #111;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f7f7f7;
  border-radius: 12px;
  padding: 10px 12px;
}

.file-row input {
  flex: 1;
}

.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-preview__item {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f1f1;
  position: relative;
}

.file-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-preview__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.modal__panel {
  position: relative;
  width: min(520px, calc(100% - 32px));
  margin: 90px auto 0;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.18);
}

.modal__title {
  margin: 0 0 14px;
  font-size: 18px;
}

.form {
  display: grid;
  gap: 12px;
}

.field span {
  display: block;
  font-size: 12px;
  color: #444;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: #111;
}

.form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* HEADER AVATAR */
.header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  text-decoration: none;
}

.avatar-link img{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,0.12);
}

