/* Дополнения к утверждённому дизайну: страницы, которых не было в прототипе (корзина, оформление). */
.product-brand a { color: var(--muted); text-decoration: none; }
.photo-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 1; }
.photo-main img { width: 100%; height: 100%; object-fit: contain; }
.photo-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.palette { margin: 0; }
.palette legend { padding: 0; width: 100%; }
.swatch { position: relative; display: inline-block; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span { display: flex !important; align-items: center; justify-content: center; }
.swatch span em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--pine-dark); }
.swatch:has(input:checked) { border-color: var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--clay); outline-offset: 2px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 8px; }
.qty { width: 92px; height: 52px; border: 1px solid var(--line-strong); border-radius: 26px; text-align: center; font: 600 17px var(--sans); background: var(--card); color: var(--ink); }
.buy-btn { flex: 1 1 220px; min-height: 52px; border: 0; border-radius: 26px; background: var(--pine); color: #fff; font: 600 17px var(--sans); cursor: pointer; padding: 0 24px; }
.buy-btn:hover { background: var(--pine-dark); }
.buy-btn:disabled { background: #B9B3AA; cursor: not-allowed; }
.buy-out { color: var(--muted); margin: 0; }
.product-info .specs div { display: block; }

.cart-list { display: flex; flex-direction: column; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto auto; gap: 12px 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-ph img { width: 72px; height: 72px; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
.cart-name a { color: var(--ink); font-weight: 600; text-decoration: none; }
.cart-sum { font-weight: 600; white-space: nowrap; }
.cart-del { width: 44px; height: 44px; border: 0; background: none; font-size: 24px; color: var(--clay); cursor: pointer; border-radius: 50%; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 14px 16px; }
@media (max-width: 640px) { .cart-line { grid-template-columns: 64px minmax(0, 1fr) auto; } .cart-sum { grid-column: 2; } .qty { width: 72px; height: 44px; } }
.cart-total { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 10px; margin-top: 20px; max-width: 460px; }
.cart-total.wide { max-width: 640px; }
.cart-total > div, .co-line { display: flex; justify-content: space-between; gap: 12px; }
.cart-total .disc { color: var(--clay); }
.cart-total .big { font-size: 20px; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-total .btn { margin-top: 6px; }
@media (min-width: 900px) { .page:has(.cart-list) { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0 28px; align-items: start; } .page:has(.cart-list) .page-title, .page:has(.cart-list) .woocommerce-error { grid-column: 1 / -1; } .page:has(.cart-list) .cart-total { margin-top: 0; position: sticky; top: 16px; } }
.checkout { display: grid; gap: 24px; }
@media (min-width: 900px) { .checkout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } .checkout .cart-total { margin-top: 0; position: sticky; top: 16px; } }
.co-form { display: flex; flex-direction: column; gap: 18px; }
.co-form fieldset { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 16px 18px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.co-form legend { font-weight: 600; padding: 0 6px; }
.co-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.co-form label[hidden], .co-form [hidden] { display: none !important; }
.co-form input:not([type=radio]), .co-form textarea, .co-form select { height: 48px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 0 14px; font: 16px var(--sans); color: var(--ink); background: var(--paper); }
.co-form textarea { height: auto; padding: 12px 14px; }
.co-form .radio { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; min-height: 40px; }
.co-form .radio input { width: 20px; height: 20px; accent-color: var(--pine); }
.co-form .btn { align-self: flex-start; }

/* меню категорий: на компьютере — в две строки, без полосы прокрутки; на телефоне — листается пальцем */
@media (min-width: 900px) {
  .catnav { overflow: visible; }
  .catnav-list { flex-wrap: wrap; gap: 2px 22px; white-space: normal; font-size: 14.5px; }
  .catnav-list li { white-space: nowrap; }
}
@media (max-width: 899px) {
  .catnav { scrollbar-width: none; }
  .catnav::-webkit-scrollbar { display: none; }
}
.staff-link { color: inherit; opacity: .6; text-decoration: none; } .staff-link:hover { opacity: 1; text-decoration: underline; }
.co-form small { font-size: 12px; color: var(--muted, #7a6470); }

/* Меню: 4 пункта, «Пряжа» — выпадающая папка со всеми брендами пряжи */
.catnav { overflow: visible !important; position: relative; z-index: 20; }
.catnav-list { align-items: center; }
.dd { position: relative; }
.dd-box > summary { list-style: none; cursor: pointer; padding: 6px 0; color: var(--ink); font-weight: 600; }
.dd-box > summary::-webkit-details-marker { display: none; }
.dd-menu { list-style: none; margin: 0; padding: 10px 6px; position: absolute; left: 0; top: 100%; background: #fff; min-width: 460px;
  border: 1px solid #ecdde3; border-radius: 12px; box-shadow: 0 10px 28px rgba(60, 20, 40, .14); display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; z-index: 50; }
.dd-menu a { display: block; padding: 7px 10px; border-radius: 8px; white-space: nowrap; font-size: 14.5px; }
.dd-menu a:hover { background: #fbeff3; }
@media (max-width: 640px) { .dd-menu { grid-template-columns: 1fr; min-width: 220px; } }

/* Меню — посередине под строкой поиска */
.catnav-list { justify-content: center; box-sizing: border-box; max-width: 100%; }
/* 4 пункта меню растянуты на всю ширину строки поиска, шрифт крупнее */
.catnav-list { justify-content: space-evenly !important; gap: 4px 12px !important; font-size: 17px !important; font-weight: 600; }
.catnav-list > li > a, .dd-box > summary { font-size: 17px; font-weight: 600; padding: 8px 0; }
@media (max-width: 640px) { .catnav-list { font-size: 15px !important; justify-content: space-between !important; } .catnav-list > li > a, .dd-box > summary { font-size: 15px; } }
.catnav-list { justify-content: space-between !important; padding: 0 18px !important; }
@media (max-width: 640px) { .catnav-list { flex-wrap: wrap !important; justify-content: center !important; gap: 0 18px !important; padding: 0 !important; font-size: 14.5px !important; }
  .catnav-list > li > a, .dd-box > summary { font-size: 14.5px; padding: 5px 0; } .catnav { overflow: visible !important; } }

/* Шапка: верхняя полоса и «Корзина» — светлый бежевый, коричневый текст (вариант А) */
.topbar { background: #F3E6DA !important; color: #6E4630 !important; }
.topbar a { color: #6E4630 !important; }
.cart-btn { background: #F3E6DA !important; color: #6E4630 !important; border: 1.5px solid #D9BFA8; }
.cart-btn:hover { background: #EAD8C7 !important; }
/* Подкатегории (Крючки, Пуговицы, Спицы) — посередине */
.subcats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* «Цвет: 141 василек» на странице товара — крупнее (Мастер, 29.10) */
.palette-head span { font-size: 20px; }
.palette-head strong { font-size: 22px; }
@media (max-width: 640px) { .palette-head span { font-size: 18px; } .palette-head strong { font-size: 20px; } }

/* стрелки на фото товара — листать цвета (Мастер, 29.10) */
.photo-main { position: relative; }
.ph-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); color: #5e1a3a; font-size: 34px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 0 0 4px; }
.ph-nav:hover { background: #fff; }
.ph-nav.prev { left: 12px; } .ph-nav.next { right: 12px; }
.ph-cap { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(255,255,255,.92); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-size: 17px; color: #3a2430; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
@media (max-width: 640px) { .ph-nav { width: 40px; height: 40px; font-size: 28px; } .ph-cap { font-size: 15px; } }
/* выбранный цвет — кружок в 3 раза крупнее, видно моток (Мастер, 29.10) */
.palette-list { align-items: center; }
.swatch { transition: width .18s ease, height .18s ease; }
.swatch:has(input:checked) { width: 132px; height: 132px; padding: 6px; border-width: 3px; }
.swatch:has(input:checked) span em { font-size: 22px; }
@media (max-width: 640px) { .swatch:has(input:checked) { width: 110px; height: 110px; } }
/* главная: баннер компактнее — товары видны на первом экране (Мастер, 29.10) */
@media (min-width: 900px) { .hero { padding-top: 28px; } .hero-grid { grid-template-columns: 1.2fr .8fr; } }
.hero h1 { font-size: clamp(30px, 3.6vw, 46px); }
.hero p { font-size: 17px; margin-top: 12px; }
.hero-actions { margin-top: 18px; }
.hero-art { aspect-ratio: 16 / 10; max-height: 320px; }

/* подсказки поиска */
.search { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12); z-index: 60; overflow: hidden; }
.sugg a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; color: inherit; text-decoration: none; }
.sugg a:hover, .sugg a.on { background: #FBF1F4; }
.sugg img, .sugg .ni { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #fff; flex: 0 0 auto; }
.sugg .t { flex: 1 1 auto; min-width: 0; }
.sugg .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg .t small { color: var(--muted); font-size: 12px; }
.sugg .pr { font-weight: 700; white-space: nowrap; }
.sugg .all { justify-content: center; font-weight: 600; color: #5e1a3a; border-top: 1px solid var(--line); }
.sugg .none { padding: 12px; color: var(--muted); }

/* состав — в блоке характеристик, во всю ширину (Мастер, 29.10) */
.specs .spec-wide { grid-column: 1 / -1; }

/* номер цвета под каждым мотком + поиск по номеру (Мастер, 03.11.2026) */
.palette-list { row-gap: 26px; padding-bottom: 20px; }
.swatch .sw-no { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; padding: 0 4px; border-radius: 5px; line-height: 18px; pointer-events: none; }
.swatch.is-out .sw-no { color: var(--muted); text-decoration: line-through; }
.swatch:has(input:checked) .sw-no { font-size: 15px; }
.swatch.is-hit .sw-no { background: #ffe9a6; color: #3a2430; }
.swatch.is-dim { opacity: .22; }
.color-find { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--bg, #fff); margin-bottom: 6px; }
.color-find:focus-within { border-color: var(--ink); }
.color-find input { border: 0; background: transparent; font-size: 17px; font-weight: 500; font-family: inherit; padding: 11px 0; width: 100%; min-width: 0; color: inherit; }
.color-find input:focus { outline: none; }
.color-find-hint { margin: 0 0 12px; min-height: 18px; font-size: 13px; color: var(--muted); }
