/* ===========================================================
   Каталог ШИХОН: карточки в списке раздела и страница товара.
   Дополняет стили модуля catalog_items (catalog_list.css, item_page.css).
   =========================================================== */

/* --- Заголовок раздела --- */
.cl .cl-top { align-items: baseline; margin: 6px 0 18px; }
.cl .cl-h1 { font-family: var(--sh-head-font); font-size: 30px; font-weight: 500; color: var(--sh-ink); }
.cl .cl-count { font-size: 15px; color: var(--muted-2); }

/* --- Сетка и карточка --- */
.cl .cl-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.cl .cl-card { border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.cl .cl-card:hover { border-color: var(--line-strong); box-shadow: 0 14px 30px -18px rgba(23, 49, 67, .35); }
.cl .cl-card-photo { padding: 14px 14px 6px; }
.cl .cl-card-body { gap: 5px; padding: 0 14px 14px; }
.cl .cl-card-pricebar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.cl .cl-card-price { font-family: var(--sh-head-font); font-size: 21px; font-weight: 600; color: var(--sh-ink); }
.cl .cl-card-tools { display: inline-flex; align-items: center; gap: 0; margin-right: -6px; }
.cl .cl-card-tools .ci-action { min-height: 0; width: 32px; height: 32px; padding: 0; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--muted-2); }
.cl .cl-card-tools .ci-action:hover { background: var(--panel); color: var(--sh-blue); }
.cl .cl-card-tools .ci-action.is-active { background: none; color: var(--sh-blue); }
.cl .cl-card-tools .ci-icon { width: 20px; height: 20px; }
.cl .cl-card-tools .ci-action__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cl .cl-card-code { font-size: 12px; color: var(--muted-2); }
.cl .cl-card-code:empty { display: none; }
.cl .cl-card-title { min-height: 0; margin-top: 2px; font-family: var(--sh-head-font); font-size: 14.5px; font-weight: 500; line-height: 1.35; color: var(--sh-ink); }
.cl .cl-card-title:hover { color: var(--sh-blue); text-decoration: none; }
.cl .cl-card-specs { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.cl .cl-card-rating { min-height: 0; }
.cl .cl-card-rating:empty { display: none; }
.cl .cl-card-stock { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--success); }
.cl .cl-card-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cl .cl-card-stock.is-out { color: var(--muted-2); }

/* кнопка «Купить» на всю ширину, без счётчика количества */
.cl .cl-card-buy { display: block; margin-top: auto; padding-top: 8px; }
.cl .cl-card-buy form, .cl .cl-card-buy table, .cl .cl-card-buy tbody, .cl .cl-card-buy tr, .cl .cl-card-buy td { display: block; width: 100%; margin: 0; padding: 0; border: 0; }
.cl .cl-card-buy .amount-box { display: none; }
.cl .cl-card-buy button.to_shopping { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; margin: 0; padding: 0 14px; border: 1px solid var(--sh-blue); border-radius: 8px; background: #fff; color: var(--sh-blue); font-family: var(--sh-head-font); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s ease, color .15s ease; }
.cl .cl-card-buy button.to_shopping:hover { background: var(--sh-blue); color: #fff; }
.cl .cl-card-buy button.to_shopping::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--sh-bag) center / contain no-repeat; mask: var(--sh-bag) center / contain no-repeat; }
:root { --sh-bag: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M5.500 8h13l1 12.500h-15z'/><path d='M9 8V6.500a3 3 0 0 1 6 0V8'/></svg>"); }

/* вид «списком» */
html[data-cl-view="list"] .cl .cl-card-body { grid-template-areas: "bar buy" "code buy" "title buy" "specs buy" "rating buy" "stock buy"; grid-template-rows: auto auto auto 1fr auto auto; }
html[data-cl-view="list"] .cl .cl-card-pricebar { grid-area: bar; justify-content: flex-start; gap: 14px; }
html[data-cl-view="list"] .cl .cl-card-code { grid-area: code; }
@media (max-width: 575.98px) {
	html[data-cl-view="list"] .cl .cl-card { grid-template-areas: "photo bar" "photo title" "photo rating" "photo stock" "buy buy"; }
	html[data-cl-view="list"] .cl .cl-card-code { display: none; }
	html[data-cl-view="list"] .cl .cl-card-pricebar { margin-top: 0; }
	.cl .cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.cl .cl-card-photo { padding: 8px 8px 4px; }
	.cl .cl-card-body { padding: 0 10px 10px; }
	.cl .cl-card-tools { margin-right: -4px; }
	.cl .cl-card-title { font-size: 13.5px; }
	.cl .cl-card-price { font-size: 18px; }
	.cl .cl-card-tools .ci-action { width: 26px; height: 26px; }
}

/* --- Страница товара --- */
.site-item-title { margin: 6px 0 20px; font-family: var(--sh-head-font); font-size: 28px; font-weight: 500; line-height: 1.25; color: var(--sh-ink); }
.si-main { margin-bottom: 8px; }
.si-main .site-item-gallery-main { margin-bottom: 0; background: #fff; border: 1px solid var(--line); }
.si-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 18px; font-size: 13px; color: var(--muted-2); }
.si-rating:empty { display: none; }
.si-short-title { margin-bottom: 8px; font-family: var(--sh-head-font); font-size: 15px; font-weight: 500; color: var(--sh-ink); }
.si-info .site-item-attrs { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.si-all-specs { font-size: 14px; color: var(--sh-blue); }
.si-all-specs:hover { text-decoration: underline; }
.si-buy { display: flex; flex-direction: column; gap: 14px; }
.si-service { display: flex; flex-direction: column; gap: 8px; }
.si-service .site-item-service { gap: 4px; }
.si-service .ci-action { min-height: 38px; padding: 0 12px; border: 0; background: none; font-weight: 500; color: var(--muted); }
.si-service .ci-action:hover { background: var(--panel); color: var(--sh-blue); }
.si-service .ci-action.is-active { background: none; color: var(--sh-blue); }

/* блок покупки */
.si-buy .site-item-buybox { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.si-buy .site-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 14px; font-size: 15px; color: var(--muted); }
.si-buy .site-price { font-family: var(--sh-head-font); font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--sh-ink); }
.si-buy .site-price-old { order: 2; font-size: 15px; text-decoration: line-through; color: var(--muted-2); }
.si-buy .site-price-old:empty { display: none; }
.si-buy button.to_shopping { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; border: 0; border-radius: 8px; background: var(--sh-blue); color: #fff; font-family: var(--sh-head-font); font-size: 15px; font-weight: 500; cursor: pointer; transition: background .15s ease; }
.si-buy button.to_shopping:hover { background: var(--site-accent-dark); }
.si-buy button.to_shopping::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--sh-bag) center / contain no-repeat; mask: var(--sh-bag) center / contain no-repeat; }
.si-buy .amount-cart-box, .si-buy .amount-cart-box tbody { display: block; width: 100%; }
.si-buy .amount-cart-box tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.si-buy .amount-cart-box td { display: block; min-width: 0; padding: 0; }
.si-buy button.to_shopping { padding: 0 10px; }

/* --- Плитки разделов --- */
.sc-grid, .cl .cl-subs.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 0 0 22px; }
.sc-grid > .sc-col, .cl-subs > .sc-col { width: auto; max-width: none; padding: 0; flex: none; margin: 0; }
.sc-tile { position: relative; display: flex; align-items: stretch; justify-content: space-between; gap: 8px; height: 100%; min-height: 150px; overflow: hidden; border-radius: 14px; background: var(--tint-blue); color: var(--sh-ink); transition: transform .18s ease, box-shadow .18s ease; }
.sc-col:nth-child(4n+2) .sc-tile { background: var(--tint-mint); }
.sc-col:nth-child(4n+3) .sc-tile { background: var(--tint-mist); }
.sc-col:nth-child(4n) .sc-tile { background: var(--tint-sand); }
.sc-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(23, 49, 67, .45); text-decoration: none; }
.sc-text { z-index: 1; display: flex; flex: 1 1 55%; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 18px 0 18px 20px; }
.sc-name { font-family: var(--sh-head-font); font-size: 17px; font-weight: 500; line-height: 1.25; }
.sc-meta { font-size: 13px; color: var(--muted); }
.sc-pic { display: flex; flex: 0 0 46%; align-items: center; justify-content: center; padding: 12px 12px 12px 0; }
.sc-pic img { display: block; max-width: 100%; max-height: 128px; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.sc-tile:hover .sc-name { color: var(--sh-blue); }

/* --- Компактные плитки подразделов на страницах разделов каталога и на странице «Каталог» --- */
.cl .cl-subs.row, .sc-grid--compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin: 0 0 18px; }
.cl .cl-subs .sc-tile, .sc-grid--compact .sc-tile { align-items: center; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.cl .cl-subs .sc-col:nth-child(4n+2) .sc-tile,
.cl .cl-subs .sc-col:nth-child(4n+3) .sc-tile,
.cl .cl-subs .sc-col:nth-child(4n) .sc-tile,
.sc-grid--compact .sc-col:nth-child(4n+2) .sc-tile,
.sc-grid--compact .sc-col:nth-child(4n+3) .sc-tile,
.sc-grid--compact .sc-col:nth-child(4n) .sc-tile { background: #fff; }
.cl .cl-subs .sc-tile:hover, .sc-grid--compact .sc-tile:hover { transform: none; border-color: var(--sh-blue); box-shadow: 0 6px 16px -12px rgba(23, 49, 67, .4); }
.cl .cl-subs .sc-text, .sc-grid--compact .sc-text { flex: 1 1 auto; justify-content: center; gap: 2px; padding: 0; }
.cl .cl-subs .sc-name, .sc-grid--compact .sc-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.cl .cl-subs .sc-meta, .sc-grid--compact .sc-meta { font-size: 12px; line-height: 1.2; }
.cl .cl-subs .sc-pic, .sc-grid--compact .sc-pic { flex: 0 0 auto; padding: 0; margin-left: 10px; }
.cl .cl-subs .sc-pic img, .sc-grid--compact .sc-pic img { width: 40px; height: 40px; max-width: 40px; max-height: 40px; object-fit: contain; }
.cl .cl-subs .sc-pic:empty, .sc-grid--compact .sc-pic:empty { display: none; }
@media (max-width: 575.98px) {
	.cl .cl-subs.row, .sc-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.cl .cl-subs .sc-tile, .sc-grid--compact .sc-tile { padding: 9px 10px; }
}

/* --- Главная: плитки услуг и карточки новинок --- */
.sc-grid--3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.sc-pic--icon { color: var(--sh-blue); opacity: .55; }
.sc-grid--3 .sc-text { flex-basis: 66%; }
.sc-grid--3 .sc-pic { flex-basis: 34%; }
/* Тексты плиток «Услуги» на одной линии: имя и подпись занимают постоянную
   высоту (имя — две строки, подпись — три), поэтому названия и описания во всех
   плитках начинаются на одной высоте. */
.sc-grid--3 .sc-name { display: flex; align-items: flex-end; min-height: 2.5em; }
.sc-grid--3 .sc-meta { min-height: 4.5em; line-height: 1.5; }
.sh-home-grid .cl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .sh-home-grid .cl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .sh-home-grid .cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Главная: восемь корневых разделов компактными плитками --- */
.sc-grid--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .sc-grid--home { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .sc-grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Главная: карточки новинок --- */
.sh-new { margin: 0 0 var(--s6); }
.sh-new-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sh-new-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-2); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.sh-new-card:hover { border-color: var(--sh-blue); box-shadow: 0 6px 16px -12px rgba(23, 49, 67, .4); }
.sh-new-pic { display: flex; flex: 0 0 64px; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 8px; background: #f5f6f8; overflow: hidden; }
.sh-new-pic img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sh-new-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sh-new-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-new-meta { display: flex; align-items: baseline; gap: 8px; }
.sh-new-price { font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.sh-new-na { font-size: 12.5px; color: var(--muted); }
@media (max-width: 991.98px) { .sh-new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .sh-new-grid { grid-template-columns: 1fr; } .sh-new-name { font-size: 13px; } }
.cl .cl-card-price--na { font-size: 15px; font-weight: 500; color: var(--muted-2); }
.cl .cl-card-buy:empty { display: none; }
@media (max-width: 767.98px) {
	.site-item-title { margin-bottom: 14px; font-size: 22px; }
	.cl .cl-h1 { font-size: 24px; }
	.si-buy .site-price { font-size: 26px; }
}

/* --- Купить в 1 клик: тихая кнопка и окно быстрого заказа --- */
body .fo-overlay, body .fo-modal { --fo-accent: var(--sh-blue); --fo-accent-hover: var(--site-accent-soft); --fo-text: var(--sh-ink); --fo-radius: 14px; font-family: var(--site-font); }
.fo-modal h2, .fo-modal h3 { font-family: var(--sh-head-font); }
.si-buy .fast-order-open-btn { display: block; width: 100%; height: 38px; margin: 10px 0 0; padding: 0 12px; border: 0; border-radius: 8px; background: var(--panel); color: var(--sh-ink); font-family: var(--sh-head-font); font-size: 14px; font-weight: 400; cursor: pointer; transition: background .15s ease, color .15s ease; }
.si-buy .fast-order-open-btn:hover { background: var(--site-accent-soft); color: var(--sh-blue); }
.sh-content .user-item-name { text-decoration: none; }
.sh-content .user-item-name:hover { text-decoration: underline; }
