/* Кукла·Лутка — раскладка сайта. Цвета и шрифты — токены фирменного стиля (--kl-* из brand/css/brand.css).
   Здесь только алиасы на них и раскладка; своих фирменных HEX нет. */
:root {
  --porcelain: var(--kl-porcelain);
  --paper: color-mix(in srgb, var(--kl-porcelain) 55%, white);
  --ink: var(--kl-cocoa);
  --ink-soft: var(--kl-muted);
  --line: var(--kl-line);
  --display: var(--kl-font-display);
  --text: var(--kl-font-body);
  --error: #9B2C1F;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--kl-fired); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.h2 { margin: 0 0 .5rem; }

/* ——— Кнопки: база — .kl-btn из brand.css ——— */
.kl-btn--wide { width: 100%; }
.kl-btn--sm { min-height: 36px; padding: 0 16px; font-size: 15px; }
.kl-btn[aria-busy="true"] { opacity: .7; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--kl-fired); text-underline-offset: 3px;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.link:hover { color: var(--kl-fired); }

/* ——— Шапка ——— */
.kl-header .site-head__row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem 1rem; padding-block: .7rem;
  grid-template-areas: "logo . fav" "nav nav nav" "switches switches switches";
}
@media (min-width: 980px) {
  .kl-header .site-head__row { grid-template-columns: auto 1fr auto auto; grid-template-areas: "logo nav fav switches"; gap: 2rem; padding-block: .9rem; }
}
.kl-logo { grid-area: logo; display: inline-flex; }
.kl-nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.kl-nav a { padding-block: .15rem; }
.fav-link { grid-area: fav; justify-self: end; display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.fav-link:hover, .fav-link[aria-current="page"] { color: var(--kl-fired); }
.fav-link > span:first-child { font-size: 1.3rem; line-height: 1; }
.fav-link__n { background: var(--kl-blush); color: var(--kl-cocoa); border-radius: 999px; font-size: .8rem; min-width: 1.4rem; text-align: center; padding: .05rem .45rem; }
@media (max-width: 420px) { .fav-link__label { display: none; } }
.switches { grid-area: switches; display: flex; gap: .5rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--kl-radius-pill); padding: 2px; background: var(--paper); }
.seg__opt { min-width: 2.4rem; text-align: center; padding: .25rem .55rem; border-radius: var(--kl-radius-pill);
  text-decoration: none; font-size: .9rem; color: var(--ink-soft); }
.seg__opt:hover { color: var(--ink); }
.seg__opt[aria-current="true"] { background: var(--kl-cocoa); color: var(--kl-porcelain); }

/* ——— Вступление ——— */
.intro { padding-block: 2rem 1.25rem; max-width: 50rem; margin-left: max(16px, (100% - 1240px) / 2); }
.intro__title { margin: 0 0 .9rem; }
.intro__lead { margin: 0 0 .6rem; color: var(--ink-soft); max-width: 42rem; }

/* ——— Фильтры ——— */
.filters { border-block: 1px solid var(--line); margin-bottom: 1.25rem; }
.filters > summary { cursor: pointer; padding: .8rem 0; list-style: none; font-family: var(--display); font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--kl-fired); }
.filters[open] > summary::after { content: "–"; }
.filters__count { background: var(--kl-blush); color: var(--kl-cocoa); border-radius: 999px; font-family: var(--text); font-size: .78rem; padding: 0 .5rem; }
.filters__form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem 1rem; padding-bottom: 1.1rem; }
.f { display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; color: var(--ink-soft); border: 0; padding: 0; margin: 0; min-width: 0; }
.f--wide { grid-column: 1 / -1; }
.f legend { padding: 0; margin-bottom: .3rem; }
.f--price { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.f--price legend { width: 100%; }
.f--price input { flex: 1 1 0; min-width: 0; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--kl-radius); padding: .55rem .7rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--kl-fired); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--kl-fired) 25%, transparent); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; align-self: end; padding-bottom: .55rem; }
.check input { width: auto; accent-color: var(--kl-cocoa); }
.filters__actions { display: flex; align-items: center; gap: 1rem; align-self: end; }

/* ——— Сетка карточек (.kl-card из brand.css) ——— */
.found { color: var(--ink-soft); font-size: .92rem; margin: 0 0 .75rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem .9rem; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.25rem; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.tile { position: relative; min-width: 0; }
.tile__link { display: flex; flex-direction: column; gap: 10px; flex: 1; color: inherit; text-decoration: none; }
.tile__link:hover { color: inherit; }
.kl-card__photo { position: relative; display: block; }
.kl-card__photo img { transition: transform .5s ease; }
.tile:hover .kl-card__photo img { transform: scale(1.025); }
.tile__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-soft); font-size: .9rem; }
.tile .kl-card__badge { position: absolute; left: .75rem; top: .75rem; }

/* Бирка под фото: инвентарный номер, название, атрибуты, цена */
.tag { position: relative; display: flex; flex-direction: column; gap: .1rem; padding-left: 1.15rem; }
.tag::before { content: ""; position: absolute; left: .1rem; top: .45rem; width: .5rem; height: .5rem; border-radius: 50%;
  border: 1.5px solid var(--kl-fired); }  /* дырочка под нитку — как у ценника на рынке */
.tag__no { font-size: .82rem; color: var(--ink-soft); letter-spacing: .03em; font-variant-numeric: lining-nums tabular-nums; }
.tag__title { overflow-wrap: anywhere; }
.tag__meta { font-size: .86rem; color: var(--ink-soft); line-height: 1.35; }
.tag .kl-card__price { margin-top: .2rem; color: var(--ink); }

.tile--fresh { grid-column: span 2; grid-row: span 2; display: flex; }
.tile--fresh .tile__link { height: 100%; }
.tile--fresh .kl-card__photo { aspect-ratio: auto; flex: 1; min-height: 320px; }
.tile--fresh .kl-card__title { font-size: clamp(24px, 2.6vw, 32px); font-style: italic; }

/* ——— Сердечко ——— */
.fav { margin: 0; }
.fav__btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer; min-height: 44px;
  background: transparent; border: 1px solid var(--kl-cocoa); border-radius: var(--kl-radius-pill); padding: 0 22px; color: var(--ink); }
.fav__btn:hover { background: var(--kl-bisque); }
.fav__icon::before { content: "♡"; font-size: 1.25rem; line-height: 1; }
.fav__btn[aria-pressed="true"] { background: var(--kl-blush); border-color: var(--kl-blush); }
.fav__btn[aria-pressed="true"] .fav__icon::before { content: "♥"; }
.fav--compact { position: absolute; top: .5rem; right: .5rem; }
.fav--compact .fav__btn { width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; background: var(--paper); border-color: transparent;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--kl-cocoa) 30%, transparent); }
.fav--compact .fav__btn[aria-pressed="true"] { background: var(--kl-blush); }
.fav__btn:active .fav__icon { transform: scale(1.2); }

.more { display: flex; justify-content: center; padding: 2.5rem 0 1rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-soft); }
.empty p { margin: 0 0 1rem; font-size: 1.1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chip { text-decoration: none; border: 1px solid var(--line); border-radius: var(--kl-radius-pill); padding: .35rem .85rem; font-size: .95rem; background: var(--paper); }
.chip span { color: var(--ink-soft); }
.chip[aria-current="page"] { background: var(--kl-cocoa); color: var(--kl-porcelain); border-color: var(--kl-cocoa); }
.chip[aria-current="page"] span { color: inherit; opacity: .75; }

/* ——— Тёмные секции (.kl-dark из brand.css) ——— */
.kl-dark { --ink-soft: color-mix(in srgb, var(--kl-cream) 82%, var(--kl-cocoa)); --line: color-mix(in srgb, var(--kl-cream) 25%, var(--kl-cocoa)); }
.kl-dark .link { color: var(--kl-cream); text-decoration-color: var(--kl-cream); }
.kl-dark .kl-btn--on-dark { color: var(--kl-cocoa); }
.kl-dark .kl-btn--on-dark:hover { background: var(--kl-porcelain); border-color: var(--kl-porcelain); color: var(--kl-cocoa); }

/* «Продайте нам куклу» на главной */
.sellband { margin-top: 3.5rem; padding-block: 3rem; }
.sellband__row { display: grid; gap: 2rem; }
@media (min-width: 860px) { .sellband__row { grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: start; } }
.sellband__title { margin: 0 0 .8rem; }
.sellband__lead { color: var(--ink-soft); margin: 0 0 1.4rem; max-width: 36rem; }
.sellband__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }

/* Список нужных снимков: маленькие рамки-кадры */
.shots { --frame: var(--kl-fired); --frame-bg: var(--kl-bisque); --fill: var(--kl-cocoa); }
.kl-dark .shots { --frame: var(--kl-cream); --frame-bg: color-mix(in srgb, var(--kl-cream) 12%, var(--kl-cocoa)); --fill: var(--kl-cream); }
.shots__title { font-family: var(--display); font-size: 1.15rem; margin: 0 0 .8rem; }
.shots__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.shots__list li { display: flex; align-items: center; gap: .9rem; }
.shots__frame { position: relative; flex: 0 0 auto; width: 30px; height: 38px; border: 1.5px solid var(--frame); border-radius: 2px; background: var(--frame-bg); }
.shots__frame::before, .shots__frame::after { content: ""; position: absolute; }
.shots__frame--dressed::before, .shots__frame--body::before { left: 50%; top: 5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--fill); }
.shots__frame--dressed::after { left: 50%; bottom: 4px; margin-left: -7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 17px solid var(--kl-blush); }
.shots__frame--body::after { left: 50%; bottom: 4px; width: 8px; height: 17px; margin-left: -4px; border: 1.5px solid var(--fill); border-radius: 3px; }
.shots__frame--face::before { inset: 6px 4px; border-radius: 50%; background: var(--kl-blush); }
.shots__frame--back::before { inset: 7px 5px 9px; border-radius: 50% 50% 45% 45%; background: var(--fill); }
.shots__frame--mark::before { left: 6px; right: 6px; top: 13px; height: 10px; border: 1.5px solid var(--fill); border-radius: 2px; }

/* ——— Страница «Продайте нам» ——— */
.sell { display: grid; gap: 2rem; padding-bottom: 2rem; }
@media (min-width: 900px) { .sell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 3.5rem; align-items: start; } }
.sell__side { display: grid; gap: 1.5rem; }
.sell__hint { margin: 0; font-size: .95rem; }
.drop { position: relative; display: grid; gap: .3rem; place-items: center; text-align: center; padding: 1.4rem 1rem;
  border: 1.5px dashed var(--kl-fired); border-radius: var(--kl-radius); background: var(--kl-bisque); color: var(--ink); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.is-over { border-style: solid; }
.drop__files { font-size: .88rem; }

/* ——— Формы ——— */
.formcard { display: grid; gap: .85rem; padding: 1.2rem; margin-top: .75rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--kl-radius); }
.formcard .f { color: var(--ink); }
.formcard__note { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.offer { display: grid; grid-template-columns: 1fr 7.5rem; gap: .5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--error); font-size: .88rem; }
.interest__done { margin: .75rem 0 0; padding: 1rem; background: var(--kl-bisque); border-left: 3px solid var(--kl-fired); }

/* ——— Страница предмета ——— */
.item { display: grid; gap: 1.5rem; padding-block: 1.5rem 3rem; }
@media (min-width: 900px) { .item { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; padding-top: 2.25rem; } }
.item__media { min-width: 0; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--kl-radius); background: var(--kl-bisque); }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; aspect-ratio: 4 / 5; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: contain; }
.slide a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.slide--empty { color: var(--ink-soft); }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem 0; }
.thumb { position: relative; flex: 0 0 64px; height: 80px; border-radius: 2px; overflow: hidden; opacity: .6; background: var(--kl-bisque); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-on { opacity: 1; outline: 2px solid var(--kl-cocoa); outline-offset: 1px; }
.thumb__play { position: absolute; inset: 0; display: grid; place-items: center; color: var(--kl-porcelain); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.before { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.before summary { cursor: pointer; color: var(--ink-soft); }
.before__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; margin-top: .75rem; }
.before__grid img { aspect-ratio: 4/5; object-fit: cover; border-radius: 2px; filter: saturate(.85); }

.item__no { color: var(--ink-soft); margin: 0; letter-spacing: .03em; font-variant-numeric: lining-nums; }
.item__title { margin: .2rem 0 1.25rem; overflow-wrap: anywhere; }
.pricebox { margin-bottom: 1.25rem; }
.pricebox__main { margin: 0; font-family: var(--display); font-size: 2rem; font-weight: 700; font-variant-numeric: lining-nums; }
.pricebox__main--ask { font-weight: 400; font-style: italic; font-size: 1.7rem; }
.pricebox__alt { margin: .2rem 0 0; color: var(--ink-soft); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.item__actions { display: grid; gap: .75rem; margin-bottom: 1.75rem; }
.item__actions .fav__btn { width: 100%; }
.interest > summary { list-style: none; }
.interest > summary::-webkit-details-marker { display: none; }
.interest[open] > summary { background: transparent; color: var(--kl-cocoa); }

.specs { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0 0 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.specs dt { color: var(--ink-soft); }
.specs dd { margin: 0; }
.item__desc { max-width: 40rem; }
.item__desc p { margin: 0 0 .9rem; }
.back { margin-top: 2rem; }

/* ——— Избранное ——— */
.favs { padding-bottom: 2rem; max-width: 54rem; margin-left: max(16px, (100% - 1240px) / 2); }
.favs__list { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.favrow { display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img info price" "img rm rm"; gap: .2rem 1rem; align-items: center;
  padding: .75rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .favrow { grid-template-columns: 72px 1fr auto auto; grid-template-areas: "img info price rm"; } }
.favrow__img { grid-area: img; display: block; aspect-ratio: 4/5; background: var(--kl-bisque); border-radius: 2px; overflow: hidden; }
.favrow__img img { width: 100%; height: 100%; object-fit: cover; }
.favrow__info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }
.favrow__title { font-family: var(--display); font-size: 1.15rem; text-decoration: none; overflow-wrap: anywhere; }
.favrow__price { grid-area: price; font-variant-numeric: lining-nums; white-space: nowrap; }
.favrow__rm { grid-area: rm; margin: 0; font-size: .92rem; }
.favs__total { margin: 0 0 2rem; }
.favs__send { max-width: 36rem; }

.flash { padding: .75rem 1rem; background: var(--kl-bisque); border-left: 3px solid var(--kl-fired); margin: 1rem 0; }

/* ——— Контакты ——— */
.contacts__title { font-family: var(--display); font-size: 1.15rem; margin: 0 0 .6rem; }
.contacts__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }

/* ——— Подвал ——— */
.site-foot { padding-block: 2.5rem 3rem; }
.site-foot__row { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .site-foot__row { grid-template-columns: auto 1.4fr 1fr; gap: 3rem; } }
.site-foot__mark { display: block; height: 84px; width: auto; }
.site-foot p { margin: 0 0 .6rem; max-width: 44rem; }
.site-foot__small { font-size: .9rem; color: var(--ink-soft); }
.site-foot.kl-dark { border-top: 1px solid var(--line); }  /* граница с тёмной полосой «Продайте нам» */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
