/* "Собрать образ" (/builder/): steps, cards with shades, the running benefit bar, the tone quiz.
   Tokens and base components (.card, .grid, .chip, .btn, .swatch-btn, .sw, .badge, .prog, .alert) come from the parent theme (css/ecomake.css).
   The page is a Shop page (page.html puts its text into .prose), so this file also undoes the text styles of .prose for our own blocks. */

.prose:has(.ebuilder) { max-width: none; }
.ebuilder { position: relative; }
.ebuilder a.btn { text-decoration: none; color: inherit; }
.ebuilder a.btn--primary { color: var(--ivory); }
.ebuilder a.btn--ghost { color: var(--cocoa); }
@media (hover: hover) { .ebuilder a.btn--ghost:hover { color: var(--ivory); } }
.ebuilder > * + * { margin-top: 0; }

.eb-lead { max-width: 62ch; color: var(--cocoa); font-size: clamp(16px, 2.3vw, 19px); line-height: 1.5; }
.ebuilder .eb-rules { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; max-width: 62ch; }
.ebuilder .eb-rules li { margin: 0; padding: 0; font-size: var(--fs-small); line-height: 1.4; color: var(--cocoa); }
.ebuilder .eb-rules li::marker { content: none; }
.eb-rules b { font-weight: 600; color: var(--ink); }

.eb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.eb-steps { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: 1 1 360px; min-width: 0; }
.eb-steps::-webkit-scrollbar { display: none; }
.eb-steps .chip { flex: none; white-space: nowrap; }
.eb-steps .chip b { margin-left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 0; display: inline-grid; place-items: center; font-size: var(--fs-caption); background: var(--clay-deep); color: var(--white); }
.eb-steps .chip[aria-pressed="true"] b { background: var(--ivory); color: var(--cocoa); }
.eb-hint { margin: 16px 0 20px; font-size: var(--fs-body); line-height: 1.5; color: var(--cocoa); }
.eb-hint b { font-weight: 600; color: var(--ink); }

/* cards */
.eb-grid { display: grid; gap: 28px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .eb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 18px; } }
@media (min-width: 1024px) { .eb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px; } }
.eb-card .card__img { outline: 3px solid transparent; outline-offset: -3px; transition: outline-color var(--t-fast); }
.eb-card.is-on .card__img { outline-color: var(--cocoa); }
.eb-card .card__img img { transform: none; }
.eb-card:hover .card__img img { transform: none; }
.eb-card .card__name { display: block; text-decoration: none; color: var(--ink); }
@media (hover: hover) { .ebuilder a.card__name:hover { color: var(--clay-deep); } }
.eb-card .card__badges .badge { box-shadow: var(--shadow-s); }
.eb-shades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.swatch-btn--mini { min-height: 44px; padding: 4px 12px 4px 6px; gap: 8px; font-size: var(--fs-small); line-height: 1.2; text-align: left; max-width: 100%; }
.swatch-btn--mini .sw { width: 24px; height: 24px; }
.swatch-btn--mini:not(:has(.sw)) { padding-left: 12px; }
.swatch-btn[disabled] { opacity: .45; cursor: not-allowed; }
.swatch-btn[disabled] span:last-child { text-decoration: line-through; }
.eb-card .card__foot { padding-top: 6px; }
.eb-card .btn { margin-top: 8px; }
.eb-card .btn[aria-pressed="false"] { background: transparent; }
.eb-note { font-size: var(--fs-small); color: var(--muted); }
.eb-empty { padding: 40px 0; color: var(--muted); }

/* the set so far */
.eb-set { margin-top: 48px; padding: 20px 18px; border-radius: var(--r-l); background: var(--paper); }
.eb-set__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.eb-set__title { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 4vw, 32px); line-height: 1.1; }
.eb-lines { margin: 14px 0 0; display: grid; gap: 10px; }
.eb-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; background: var(--ivory); border-radius: var(--r-m); }
.eb-line__img { width: 48px; aspect-ratio: 3 / 4; border-radius: 0; overflow: hidden; background: var(--sand); }
.eb-line__img img { width: 100%; height: 100%; object-fit: cover; }
.eb-line__n { font-size: var(--fs-text); font-weight: 600; line-height: 1.25; }
.eb-line__s { font-size: var(--fs-small); color: var(--muted); }
.eb-line__p { text-align: right; font-size: var(--fs-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eb-line__p s { display: block; color: var(--muted); font-size: var(--fs-caption); }
.eb-line__rm { grid-column: 2 / 4; justify-self: start; display: inline-flex; align-items: center; padding: 0 4px; font-size: var(--fs-small); color: var(--muted); text-decoration: underline; min-height: 44px; min-width: 44px; }
@media (min-width: 560px) {
  .eb-line { grid-template-columns: 48px minmax(0, 1fr) auto auto; }
  .eb-line__rm { grid-column: auto; }
}
.eb-goals { display: grid; gap: 8px; margin: 16px 0 0; }
.eb-goal { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); line-height: 1.35; color: var(--cocoa); }
.eb-goal .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--clay-deep); }
.eb-goal.is-done .ic { color: var(--ok); }
.eb-goal small { display: block; color: var(--muted); font-size: var(--fs-caption); }

/* sticky bar with the running benefit */
.eb-bar { position: sticky; bottom: 0; z-index: 40; margin: 32px calc(var(--gutter) * -1) 0; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom)); background: var(--ivory); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 8%, transparent); }
.eb-bar__main { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.eb-bar__sum { min-width: 0; }
.eb-bar__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-text); }
.eb-bar__price { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.eb-bar__price s { font-size: var(--fs-small); font-weight: 400; color: var(--muted); }
.eb-bar .btn { flex: none; }
.eb-bar__goals { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 4px; }
.eb-bar__goals .eb-goal { font-size: var(--fs-small); }
.eb-bar__goals .eb-goal .ic { width: 18px; height: 18px; }
.eb-meter { position: relative; height: 5px; border-radius: 3px; background: var(--sand); margin-top: 6px; }
.eb-meter__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: var(--clay-deep); transition: width var(--t-med) var(--ease); }
.eb-meter__mark { position: absolute; top: -3px; width: 2px; height: 11px; background: var(--cocoa); border-radius: 1px; opacity: .55; }
.eb-bar.is-busy .eb-bar__price { opacity: .55; }
.eb-save-short { display: none; }
.eb-bar .badge { display: inline-block; white-space: nowrap; }
@media (max-width: 719px) {
  .eb-bar__goals { display: none; }
  .eb-bar__price { font-size: var(--fs-lg); }
  .eb-bar .btn { padding: 0 20px; }
}
@media (max-width: 479px) {
  .eb-bar { padding-top: 10px; }
  .eb-save-long { display: none; }
  .eb-save-short { display: inline; }
  .eb-btn-price { display: none; }
  .eb-bar .btn { padding: 0 16px; font-size: var(--fs-text); }
  .eb-bar__top { font-size: var(--fs-small); gap: 6px; }
  .eb-bar__goals { display: none; }
  .eb-meter { margin-top: 8px; }
}
@media (min-width: 720px) {
  .eb-bar__goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.eb-alert { margin-top: 12px; }

/* quiz (in the shared #modal) */
.ebq__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ebq__lead { margin: 6px 0 16px; font-size: var(--fs-small); color: var(--muted); }
.ebq__q { margin: 0 0 10px; font-family: var(--f-display); font-weight: 600; font-size: var(--fs-xl); line-height: 1.15; }
.ebq__opts { display: grid; gap: 8px; }
.ebq__opts .swatch-btn { width: 100%; border-radius: var(--r-m); justify-content: flex-start; text-align: left; }
.ebq__res { margin-top: 18px; display: grid; gap: 10px; }
.ebq__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--white); }
.ebq__row img { width: 44px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 0; background: var(--paper); }
.ebq__row b { display: block; font-size: var(--fs-small); line-height: 1.25; }
.ebq__row span { font-size: var(--fs-small); color: var(--muted); }
.ebq__row .btn { min-height: 44px; padding: 0 14px; font-size: var(--fs-small); }
@media (max-width: 420px) { .ebq__row { grid-template-columns: 44px minmax(0, 1fr); } .ebq__row .btn { grid-column: 1 / 3; } }
