/* Витрина «Дом Рукоделия»: жёлто-фиолетовая палитра из макета. */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #221d2e;
  --muted: #7a7486;
  --line: #e9e4dc;
  --violet: #4b2c7d;
  --violet-dark: #3a2163;
  --violet-soft: #efe9f8;
  --yellow: #f3d65f;
  --yellow-soft: #fbf1c6;
  --ok: #2f7d4f;
  --bad: #b3372f;
  --radius: 16px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--violet); }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Шапка */
.topbar { background: var(--violet); color: #fff; font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; text-align: center; }
.subbar { display: flex; justify-content: flex-end; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.subbar__link { display: inline-flex; gap: 6px; align-items: center; color: var(--violet); }
.header { display: flex; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--violet); }
.logo__mark { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; color: var(--ink); }
.logo__text { font-family: var(--display); font-size: 15px; line-height: 1.15; letter-spacing: .01em; }
.logo__dot { color: var(--yellow); }
.logo--light { color: #fff; }
.nav { display: flex; gap: 32px; margin: 0 auto; font-weight: 500; }
.header__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink); }
.icon-btn:hover { background: var(--violet-soft); }
.search { display: flex; align-items: center; }
.search input { width: 0; opacity: 0; border: 0; transition: width .2s, opacity .2s; background: transparent; }
.search:focus-within input { width: 180px; opacity: 1; border-bottom: 1px solid var(--line); padding: 4px; }
.cart-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.badge { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--yellow); display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; }
.burger { display: none; }

/* Кнопки и элементы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--violet); color: var(--violet); }
.btn--primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn--primary:hover { background: var(--violet-dark); color: #fff; }
.btn--lg { padding: 16px 30px; font-size: 17px; }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.chip { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.92); padding: 5px 12px; border-radius: 999px; font-size: 13px; }
.chip--accent { background: var(--yellow); }
.chip--light { background: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 600; color: var(--violet); display: flex; align-items: center; gap: 10px; }
.eyebrow--small { font-size: 11px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.flash { padding: 14px 18px; border-radius: 12px; margin: 16px 0; background: var(--violet-soft); }
.flash--error { background: #fbe9e7; color: var(--bad); }
.flash--success { background: #e7f4ec; color: var(--ok); }

/* Типографика */
.h1 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 8px 0 16px; }
.h2 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 32px); margin: 0 0 20px; }
.h3 { font-size: 20px; font-weight: 700; margin: 24px 0 12px; }
.lead { font-size: 18px; }
.section { padding: 40px 24px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.link-arrow { color: var(--violet); font-weight: 600; }
.crumbs { color: var(--muted); font-size: 14px; }

/* Главный экран */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 48px; padding-bottom: 32px; align-items: center; }
.hero__title { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 5.4vw, 74px); line-height: 1.08; margin: 24px 0; letter-spacing: -.01em; }
.accent-word { color: var(--violet); background: linear-gradient(transparent 88%, var(--yellow) 88%); }
.hero__lead { color: var(--muted); font-size: 16px; margin: 0 0 32px; }
.hero__people { display: flex; align-items: center; margin-top: 40px; gap: 4px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--bg); background: #e8d9cf; display: grid; place-items: center; font-size: 11px; margin-right: -10px; }
.avatar--2 { background: #cdbfe2; } .avatar--3 { background: #cfd7c2; margin-right: 10px; }
.hero__media { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 1 / 1.07; background: var(--violet-soft); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__placeholder { width: 100%; height: 100%; background: repeating-linear-gradient(170deg, #f3d65f 0 40px, #e9b8c2 40px 80px, #b9c4c0 80px 120px, #2f3e6b 120px 160px, #8aa07b 160px 200px); }
.hero__chip { top: 24px; left: 24px; padding: 8px 16px; }
.stamp { position: absolute; top: 30px; right: 22px; width: 96px; height: 96px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; transform: rotate(14deg); padding: 10px; }
.hero__card { position: absolute; left: 24px; right: 24px; bottom: 24px; background: rgba(255,255,255,.95); border-radius: 14px; padding: 20px 24px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; }
.hero__card-title { font-size: 19px; font-weight: 500; grid-column: 1; }
.round-arrow { grid-column: 2; grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card { position: relative; display: flex; flex-direction: column; }
.card__img { position: relative; display: block; aspect-ratio: 310 / 348; border-radius: 14px; overflow: hidden; background: #efebe4; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__img img { transform: scale(1.03); }
.card__noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 14px; }
.card__fav { position: absolute; top: 12px; right: 12px; }
.heart { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: var(--violet); display: grid; place-items: center; cursor: pointer; }
.heart--on svg { fill: var(--violet); }
.card__meta { margin-top: 16px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card__title { font-size: 19px; font-weight: 500; margin: 6px 0 14px; }
.card__bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.price { font-size: 18px; font-weight: 600; }
.price__unit { font-size: 13px; font-weight: 400; color: var(--muted); }
.plus { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--violet); }
.plus:hover { border-color: var(--violet); background: var(--violet-soft); }

.cats { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.cat-pill { padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 500; }
.cat-pill--on, .cat-pill:hover { background: var(--violet); border-color: var(--violet); color: #fff; }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.benefits > div { background: #fff; border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.benefits h3 { margin: 0 0 8px; }

/* Каталог */
.catalog { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.filters { position: sticky; top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.filters legend { font-weight: 700; margin-bottom: 6px; }
.filters__row { display: grid; gap: 6px; font-weight: 600; }
.filters select { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }
.check small { margin-left: auto; }
.range__inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range__inputs input { width: 100%; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; }
.facet .facet__more { display: none; }
.facet--open .facet__more { display: flex; }
.facet__hide, .facet--open .facet__show { display: none; }
.facet--open .facet__hide { display: inline; }
.facet__toggle { justify-self: start; padding: 4px 0; font: inherit; }
.catalog__top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.fchip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-dark); font-size: 14px; text-decoration: none; }
.fchip b { font-weight: 700; }
.fchip:hover { background: var(--yellow-soft); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 32px; }

/* Страница товара */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; margin-top: 16px; }
.gallery__main { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 1; background: #efebe4; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; }
.gallery__thumbs button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 80px; height: 80px; flex: none; cursor: pointer; background: none; }
.gallery__thumbs button:hover { border-color: var(--violet); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp__price { font-size: 28px; font-weight: 700; margin: 8px 0 20px; display: flex; gap: 12px; align-items: baseline; }
.label { font-weight: 600; margin-bottom: 8px; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; font-size: 12px; }
.swatch--on { box-shadow: 0 0 0 2px var(--violet); }
.swatch--out { opacity: .4; }
.buy { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.stepper { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 52px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.stepper button:hover { background: var(--violet-soft); }
.stepper input { width: 90px; text-align: center; border: 0; font-size: 20px; font-weight: 600; padding: 10px 0; }
.hint { font-size: 14px; margin: 8px 0; }
.stock { font-weight: 600; margin: 12px 0 16px; }
.stock--ok { color: var(--ok); }
.stock--out { color: var(--bad); font-weight: 500; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 24px 0; padding: 20px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; }
.prose p, .prose li { max-width: 68ch; }

/* Корзина и оформление */
.lines { display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 96px 1fr auto auto auto; gap: 18px; align-items: center; background: #fff; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); }
.line__img { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: #efebe4; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__title { font-weight: 600; font-size: 17px; }
.line__qty input { width: 72px; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); text-align: center; font-size: 17px; }
.line__sum { font-weight: 700; min-width: 100px; text-align: right; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; }
.cart-total__sum { font-size: 20px; }
.note { background: var(--yellow-soft); padding: 18px 20px; border-radius: 14px; margin: 20px 0; }
.note--accent { background: var(--violet-soft); }
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.form { display: grid; gap: 4px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; }
.field input, .field textarea, .field select { padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 17px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--violet); border-color: transparent; }
.field--error input, .field--error textarea { border-color: var(--bad); }
.error { color: var(--bad); font-size: 14px; }
.radios { display: grid; gap: 10px; margin-bottom: 16px; }
.radio { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--violet); background: var(--violet-soft); }
.radio input { width: 20px; height: 20px; accent-color: var(--violet); }
.summary, .card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.summary { position: sticky; top: 16px; }
.summary .h3, .card-box .h3 { margin-top: 0; }
.summary__row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.summary__total { font-size: 19px; border-bottom: 0; }

/* Статус заказа */
.success { background: var(--violet-soft); border-radius: 20px; padding: 28px; margin-bottom: 24px; }
.steps { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; counter-reset: s; }
.steps li { position: relative; padding-top: 34px; font-size: 14px; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 11px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps__dot { position: absolute; top: 2px; left: 0; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; }
.steps li.is-done { color: var(--ink); }
.steps li.is-done::before { background: var(--violet); }
.steps li.is-done .steps__dot { border-color: var(--violet); background: var(--violet); }
.steps li.is-current { font-weight: 700; }
.steps li.is-current .steps__dot { background: var(--yellow); }
.timeline { list-style: none; padding: 0; display: grid; gap: 8px; }
.order-row { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; align-items: center; }
.status { padding: 4px 12px; border-radius: 999px; background: var(--violet-soft); font-size: 14px; }
.status--cancelled { background: #fbe9e7; color: var(--bad); }
.status--delivered { background: #e7f4ec; color: var(--ok); }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; }

/* Подвал */
.footer { background: var(--ink); color: #e9e5f0; margin-top: 64px; padding: 48px 0; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer h4 { margin: 0 0 12px; }
.footer a, .footer span { display: block; margin-bottom: 6px; }
.footer .muted { color: #a8a2b5; }

@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
}
@media (max-width: 860px) {
  .container { padding: 0 16px; }
  .section { padding: 28px 16px; }
  .hero, .pdp, .checkout { grid-template-columns: 1fr; gap: 28px; }
  .grid, .grid--3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .benefits, .footer__grid { grid-template-columns: 1fr; }
  .burger { display: inline-grid; }
  .nav { display: none; position: absolute; top: 150px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 20px; gap: 16px; z-index: 10; border-bottom: 1px solid var(--line); }
  .nav--open { display: flex; }
  .cart-link span:not(.badge) { display: none; }
  .header { gap: 12px; }
  .line { grid-template-columns: 72px 1fr; }
  .line__img { width: 72px; height: 72px; }
  .line__qty, .line__sum, .line .link-btn { grid-column: 2; text-align: left; }
  .steps { grid-template-columns: 1fr; }
  .steps li { padding: 0 0 0 34px; }
  .steps li::before { display: none; }
  .summary { position: static; }
}
@media (max-width: 420px) {
  .card__title { font-size: 16px; }
  .price { font-size: 16px; }
}

/* Вход покупателя */
.auth { max-width: 560px; }
.auth__card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin-top: 8px; }
.auth__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.auth__links form { margin: 0; }
.code-input { font-size: 28px !important; letter-spacing: 12px; text-align: center; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.profile-head form { margin: 0; }
.filters, .filters * { box-sizing: border-box; min-width: 0; }
.filters select, .filters .btn { width: 100%; }
@media (min-width: 1081px) { .filters { max-height: calc(100vh - 32px); overflow-y: auto; } }
