/* Design-lab: каталог, товар, редактор (вход/выход), мои проекты. */

/* ═══ Каталог ═══ */
.cat-h { display: flex; gap: 8px; align-items: baseline; margin: 8px 0 14px; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.pcard { display: flex; flex-direction: column; background: #fff; border-radius: var(--ds-radius-lg); overflow: hidden; color: inherit; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.pcard:hover { text-decoration: none; border-color: var(--ds-color-border); }
.pcard:hover .pcard__img img { transform: scale(1.03); }
.pcard__img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ds-color-bg-muted); }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.pcard__t { font-size: 19px; font-weight: 800; line-height: 24px; }
.pcard__d { font-size: 14px; color: var(--ds-color-text-secondary); }
.pcard__facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ds-color-text); margin-top: 2px; }
.pcard__facts > span { display: inline-flex; align-items: center; gap: 5px; }
.pcard__facts .i { color: var(--ds-color-text-secondary); }
.pcard__price { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ds-color-border); }
.pcard__price b { font-size: 20px; font-weight: 900; display: block; }
.pcard__go { width: 40px; height: 40px; border-radius: 50%; background: var(--ds-color-bg-muted); color: var(--ds-color-accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pcard:hover .pcard__go { background: var(--ds-color-accent); color: #fff; }
.pwide { display: grid; grid-template-columns: 420px minmax(0, 1fr); background: #fff; border-radius: var(--ds-radius-lg); overflow: hidden; color: inherit; margin-bottom: 24px; border: 1px solid transparent; }
.pwide:hover { text-decoration: none; border-color: var(--ds-color-border); }
.pwide__img { display: block; height: 240px; overflow: hidden; }
.pwide__img img { width: 100%; height: 100%; object-fit: cover; }
.pwide__body { display: flex; flex-direction: column; gap: 10px; padding: 24px 28px; }
.cmp__row { display: grid; grid-template-columns: minmax(220px, 1.3fr) 1fr 0.9fr 1.2fr 0.7fr 0.9fr; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--ds-color-border); color: inherit; font-size: 14px; }
.cmp__row:hover { background: var(--ds-color-row-hover); text-decoration: none; }
.cmp__head { font-size: 12px; font-weight: 700; color: var(--ds-color-text-secondary); background: #fbfaf9; }
.cmp__head:hover { background: #fbfaf9; }
.cmp__img { width: 56px; height: 38px; object-fit: cover; border-radius: 6px; }

/* ═══ Товар ═══ */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 16px 0 8px; color: var(--ds-color-text-secondary); }
.crumbs a { color: var(--ds-color-accent); font-weight: 600; }
.prod__grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: start; }
.prod h1 { margin-top: 4px; }
.gal { position: relative; border-radius: var(--ds-radius-lg); overflow: hidden; background: #fff; aspect-ratio: 3 / 2; }
.gal__main { width: 100%; height: 100%; object-fit: cover; }
.gal__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .9); color: var(--ds-color-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.gal__nav--l { left: 14px; } .gal__nav--r { right: 14px; }
.gal__count { position: absolute; right: 14px; bottom: 14px; background: rgb(26 26 26 / .7); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.gal__thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.gal__t { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; aspect-ratio: 4 / 3; }
.gal__t img { width: 100%; height: 100%; object-fit: cover; }
.gal__t.is-on { border-color: var(--ds-color-accent); }
.psec { background: #fff; border-radius: var(--ds-radius-lg); padding: 24px 28px; margin-top: 16px; }
.psec h2 { margin-bottom: 12px; }
.psec p { margin: 0 0 12px; line-height: 1.6; max-width: 70ch; }
.pbul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pbul li { display: flex; gap: 8px; align-items: center; }
.pbul .i { color: var(--ds-color-success-600); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0; }
.specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--ds-color-border); }
.specs dt { color: var(--ds-color-text-secondary); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.psec--pro { background: #fbfaf9; border: 1px dashed #dcd8d4; }
.cfg { position: sticky; top: 16px; }
.cfg__in { background: #fff; border-radius: var(--ds-radius-lg); padding: 22px 24px 24px; }
.cfg__h { margin-bottom: 4px; }
.cfg__g { padding: 14px 0 4px; border-top: 1px solid var(--ds-color-border); margin-top: 12px; }
.cfg__h + .cfg__g { border-top: 0; margin-top: 0; }
.cfg__gt { font-size: 15px; margin-bottom: 4px; }
.cfg__f { margin: 10px 0 12px; }
.cfg__l { font-size: 14px; color: var(--ds-color-text-secondary); margin-bottom: 8px; }
.cfg__help { font-size: 13px; color: var(--ds-color-text-secondary); margin: 8px 0 0; line-height: 1.45; }
.cfg__fixed { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.cfg__fixed span { color: var(--ds-color-text-secondary); }
.cfg__fixed--top { padding: 10px 0; }
.cfg__sum { border-top: 1px solid var(--ds-color-border); margin-top: 12px; padding-top: 16px; display: grid; gap: 14px; }
.cfg__pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg__price { display: flex; align-items: center; gap: 14px; }
.cfg__price .meta { line-height: 1.4; }
.cfg__ship { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.cfg__ship .i { color: var(--ds-color-success-600); }
.cfg__next { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ds-color-text-secondary); margin: -2px 0 0; line-height: 1.45; }
.cfg__next .i { margin-top: 2px; }

/* ═══ Редактор: вход и выход ═══ */
.ed { min-height: 100vh; background: #2b2930; color: #f1eff4; display: flex; flex-direction: column; }
.ed__bar { display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 64px; background: #1f1d24; border-bottom: 1px solid #3a3740; }
.ed__exit { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 999px; background: #34313b; }
.ed__exit:hover { background: #423e4a; text-decoration: none; }
.ed__name { display: flex; flex-direction: column; font-size: 14px; }
.ed__name span { color: #a9a4b1; font-size: 12px; }
.ed__saved { display: inline-flex; gap: 6px; align-items: center; color: #8fd19e; font-size: 13px; }
.ed__right { margin-left: auto; display: flex; gap: 8px; }
.ed__ghost { background: #34313b; color: #fff; }
.ed__ghost:hover { background: #423e4a; }
.ed__done { background: var(--ds-color-highlight); color: #1a1a1a; }
.ed__done:hover { background: #ffd800; }
.ed__body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.ed__note { display: flex; gap: 10px; align-items: flex-start; background: #393540; border-radius: 12px; padding: 12px 16px; font-size: 14px; color: #ddd8e3; max-width: 980px; }
.ed__spreads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.ed__sp { position: relative; aspect-ratio: 2 / 1; background: #fff; border-radius: 4px; overflow: hidden; }
.ed__sp svg { width: 100%; height: 100%; }
.ed__sp.is-empty { background: #3d3a44; border: 2px dashed #6a6573; display: flex; align-items: center; justify-content: center; }
.ed__sp.is-empty span { display: inline-flex; gap: 6px; align-items: center; color: #b8b2c0; font-size: 13px; }
.ed__sp i { position: absolute; left: 8px; bottom: 6px; font-style: normal; font-size: 11px; color: #fff; background: rgb(0 0 0 / .45); padding: 1px 6px; border-radius: 4px; }

/* ═══ Мои проекты ═══ */
.prow { grid-template-columns: 28px 56px minmax(0, 1fr) 96px 130px minmax(190px, 240px) 240px; padding: 12px 20px; }
.thead.prow { padding: 10px 20px; }
.prow.is-picked { background: #fbf9ff; }
.prow.is-fresh { box-shadow: inset 4px 0 0 var(--ds-color-success-600); background: var(--ds-color-success-50); }
.pchk input { width: 18px; height: 18px; accent-color: var(--ds-color-accent); cursor: pointer; }
.pchk input:disabled { cursor: not-allowed; }
.prow__t { display: flex; flex-direction: column; min-width: 0; color: inherit; }
.prow__t:hover { text-decoration: none; }
.prow__t:hover .lrow__title { color: var(--ds-color-link); }
.cover--empty { display: inline-flex; align-items: center; justify-content: center; color: var(--ds-color-text-muted); background: var(--ds-color-bg-muted); box-shadow: inset 0 0 0 1px var(--ds-color-border); }
.pstate { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ds-color-text-secondary); }
.pstate--ok { color: var(--ds-color-success-700); }
.pstate--warn { color: var(--ds-color-warning-700); }

/* ─── Ширины ─── */
@media (min-width: 1600px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1199px) {
  .prod__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
  .prow { grid-template-columns: 28px 56px minmax(0, 1fr) 110px minmax(150px, 180px) 240px; }
  .prow > :nth-child(4) { display: none; }
  .gal__thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gal__thumbs .gal__t:nth-child(n+7) { display: none; }
}
@media (max-width: 1023px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .prod__grid { grid-template-columns: minmax(0, 1fr); }
  .cfg { position: static; }
  .pwide { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr; }
  .ed__spreads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .pgrid { grid-template-columns: 1fr; }
  .cmp__row { grid-template-columns: 1fr auto; }
  .cmp__row > :nth-child(2), .cmp__row > :nth-child(3), .cmp__row > :nth-child(4), .cmp__row > :nth-child(5) { display: none; }
  .prow { grid-template-columns: 24px 56px minmax(0, 1fr) auto; gap: 10px; padding: 12px 16px; }
  .prow > :nth-child(4), .prow > :nth-child(6), .thead.prow { display: none; }
  .prow .oact { grid-column: 2 / -1; justify-content: flex-start; }
  .ed__bar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 10px; }
  .ed__saved { display: none; }
}
.ed__sp.is-empty svg.i { width: 20px; height: 20px; }
/* проект уже в корзине — состояние, не кнопка */
.pincart { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ds-color-text-secondary); white-space: nowrap; padding: 0 8px; }
.pincart a { font-weight: 700; }

/* ─── Третий заход: «Новые проекты» — группы по клиентам ─── */
.pnote { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.pgroup + .pgroup { border-top: 2px solid var(--ds-color-border); }
.pgroup__h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px; background: var(--ds-color-row-hover); border-bottom: 1px solid var(--ds-color-border); }
.pgroup__h .btn { margin-left: auto; }
.pgroup__t { font-size: 14px; }
/* название проекта переносится — различающая часть («альбом 07», «(копия)») в конце */
.prow .lrow__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pgroup__more { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 20px 12px 124px; border: 0; border-top: 1px solid var(--ds-color-border); background: none; color: var(--ds-color-link); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; }
.pgroup__more:hover { background: var(--ds-color-row-hover); }
@media (max-width: 767px) { .pgroup__h { padding: 10px 16px; } .pgroup__more { padding-left: 16px; } }

/* третий заход, по заключению Fable: описание изделия переносится, а не обрезается */
@media (min-width: 768px) {
  .prow .lrow__sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* третий заход, по заключению Fable: цена и «Создать проект» видны всегда — строка снизу, когда кнопка панели ушла из вида */
.pbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgb(255 255 255 / 0.9); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 -1px 0 var(--ds-color-border), 0 -12px 30px -22px rgb(0 0 0 / 0.3); transform: translateY(110%); transition: transform .2s ease; }
html[data-look] .pbar { background: var(--ds-color-surface-glass); -webkit-backdrop-filter: var(--ds-backdrop-glass); backdrop-filter: var(--ds-backdrop-glass); box-shadow: inset 0 1px 0 var(--ds-color-glass-edge), 0 -12px 30px -22px rgb(0 0 0 / 0.3); }
.pbar.is-on { transform: none; }
.pbar__in { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.pbar__t { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.pbar__t b { font-size: 15px; }
.pbar__t .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .price-tag { height: 38px; font-size: 18px; }
@media (prefers-reduced-motion: reduce) { .pbar { transition: none; } }
@media (max-width: 1199px) {
  .gal__thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gal__thumbs .gal__t:nth-child(n+6) { display: none; }
}
@media (max-width: 899px) {
  /* телефон и планшет: «Параметры» сразу после фото, описание и характеристики — ниже */
  .prod__left { display: contents; }
  .prod__left > * { order: 1; }
  .prod__left > .psec { order: 3; }
  .cfg { order: 2; }
  .pbar__t .meta, .pbar__per { display: none; }
}
@media (max-width: 899px) { .prod__grid { row-gap: 0; } .cfg { margin: 16px 0 8px; } }
.pcard__def { display: block; }

/* повторная проверка Fable: название заказа в строке «Производства» — в две строки и на 1280 */
@media (min-width: 768px) {
  .orow-h .lrow__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* цена товара на телефоне — под заголовком, на первом экране */
.prod__mprice { display: none; }
@media (max-width: 899px) {
  .prod__mprice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 14px; }
  .prod__mprice .price-tag { height: 38px; font-size: 18px; }
}
@media (max-width: 600px) { .pbar__t { display: none; } .pbar__in { justify-content: flex-end; } }

/* ═══ Четвёртый заход (владелец, 22.10.2026) ═══ */
/* Каталог: картинка — фоном всей карточки, весь текст — на плашке поверх с отступом от краёв; картинка обрамляет плашку */
.pcard--float { position: relative; isolation: isolate; min-height: 470px; padding: 14px; background: var(--ds-color-bg-muted); }
/* окно картинки над плашкой — одной высоты у всех карточек ряда; плашка тянется до низа, цена — внизу плашки */
.pcard--float .pcard__plate { flex: 1 0 auto; margin-top: 200px; }
.pcard__bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform .4s ease; }
.pcard--float:hover .pcard__bg, .pwide--float:hover .pcard__bg { transform: scale(1.035); }
.pcard__plate { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--ds-color-bg-surface) 93%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.55), 0 16px 34px -20px rgb(0 0 0 / 0.45); }
/* фотопечать: стопка снимков справа, слева фон картинки продолжен под плашкой (цвета — с левого края снимка) */
.pwide--float { position: relative; isolation: isolate; display: flex; align-items: stretch; min-height: 280px; padding: 16px; background: linear-gradient(170deg, #a9f6fe 0%, #96d6fc 100%); }
.pwide--float .pcard__bg { left: auto; width: 64%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26%); mask-image: linear-gradient(90deg, transparent 0, #000 26%); }
.pwide--float .pcard__plate { width: min(560px, 50%); justify-content: center; }
@media (max-width: 1199px) { .pcard--float .pcard__plate { margin-top: 180px; } }
@media (max-width: 767px) {
  .pcard--float { min-height: 0; padding: 12px; }
  .pcard--float .pcard__plate { margin-top: 190px; }
  .pwide--float { flex-direction: column; justify-content: flex-end; min-height: 460px; padding: 12px; }
  .pwide--float .pcard__bg { width: 100%; height: 64%; bottom: auto; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
  .pwide--float .pcard__plate { width: auto; }
  .pwide--float .pcard__price { flex-wrap: wrap; }
  .pwide--float .pcard__price b { white-space: nowrap; }
}

/* Товар: галерея наверху — вровень с «Параметрами»; название и подзаголовок — под галереей, над описанием */
.prod__head { margin: 22px 0 2px; }
.prod__head h1 { margin: 0; }
.prod__head .lead { margin: 6px 0 0; }
@media (max-width: 899px) { .prod__head { margin: 16px 0 0; } .prod__head .prod__mprice { margin: 12px 0 0; } }
/* по заключению Fable (четвёртый заход): у плашек каталога одинаковая высота текста — под описание две строки, под цену три;
   цена и стрелка у всех на одном уровне, без пустой полосы между сроком и ценой */
.pcard--float .pcard__d { min-height: calc(2 * 20.3px); }
.pcard--float .pcard__price > span:first-child { min-height: 70px; }
/* миниатюры галереи на узком экране — в две строки по четыре: видны все, без скрытых «за краем» */
@media (max-width: 1199px) {
  .gal__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gal__thumbs .gal__t:nth-child(n+6) { display: block; }
}
