*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --accent: #f0de13;
    --black: #111111;
    --gray-text: #555555;
    --gray-light: #f7f7f5;
    --border: #e8e8e4;
    --white: #ffffff;
    --green: #2aa84a;
    --red: #c44;
}
body { font-family: 'PT Sans', Arial, Helvetica, sans-serif; background: var(--white); color: var(--black); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }

/* HEADER / NAV / CRUMB */
.topbar { border-bottom: 1px solid var(--border); padding: 9px 0; font-size: 12px; color: #999; }
.topbar .w { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: flex; gap: 20px; align-items: center; }
.topbar a { color: #999; text-decoration: none; }
.topbar a:hover { color: var(--black); }
.header { border-bottom: 1px solid var(--border); padding: 16px 0; }
.header .w { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; }
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-mark { width: 46px; height: 46px; background: var(--black); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--accent); letter-spacing: -0.5px; flex-shrink: 0; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.logo-text { font-size: 10px; color: #888; line-height: 1.4; max-width: 80px; }
.nav { background: var(--accent); }
.nav .w { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: flex; }
.nav a { display: inline-block; padding: 11px 14px; font-size: 12.5px; font-weight: 500; color: var(--black); text-decoration: none; transition: background 0.15s; }
.nav a:hover { background: rgba(0,0,0,0.07); }
.nav a.active { background: rgba(0,0,0,0.1); font-weight: 600; }
.crumb { padding: 10px 0; font-size: 12px; color: #aaa; border-bottom: 1px solid var(--border); }
.crumb .w { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.crumb a { color: #aaa; text-decoration: none; }
.crumb a:hover { color: var(--black); }
.crumb .current { color: var(--black); }

/* LAYOUT: 2 колонки — позиции + сводка заказа справа */
/*.layout { max-width: 1160px; margin: 0 auto; padding: 32px 24px 80px; }*/
.page-label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #aaa; margin-bottom: 8px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.page-title { font-size: 28px; font-weight: 700; color: var(--black); line-height: 1.2; margin-bottom: 6px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.page-sub { font-size: 13px; color: #999; margin-bottom: 24px; }
.page-sub b { color: var(--black); font-weight: 600; }

.cart-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }

/* === ЛЕВАЯ КОЛОНКА: позиции корзины === */
.cart-main { min-width: 0; }

/* Тулбар: поиск в корзине, очистка */
.cart-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 0 2px; }
.cart-search { flex: 1; max-width: 320px; position: relative; }
.cart-search input { width: 100%; padding: 8px 10px 8px 32px; font-size: 13px; font-family: 'PT Sans', Arial, sans-serif; border: 1px solid var(--border); background: var(--white); color: var(--black); outline: none; transition: border-color 0.15s; }
.cart-search input:focus { border-color: var(--black); }
.cart-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #999; }
.cart-count { font-size: 13px; color: #888; }
.cart-count b { color: var(--black); font-weight: 700; }
.cart-clear { margin-left: auto; background: none; border: 1px dashed #bbb; color: #888; font-size: 11.5px; padding: 6px 12px; cursor: pointer; font-family: 'PT Sans', Arial, sans-serif; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.cart-clear:hover { color: var(--red); border-color: var(--red); border-style: solid; }
.cart-clear svg { width: 12px; height: 12px; }

/* Таблица позиций */
.cart-items { border: 1px solid var(--border); }
.cart-items-head { display: grid; grid-template-columns: 56px minmax(220px, 1fr) 230px 130px 36px; gap: 0; background: var(--gray-light); border-bottom: 2px solid var(--border); }
.cart-items-head > div { padding: 9px 12px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #888; font-family: 'PT Sans Narrow', Arial, sans-serif; border-right: 1px solid var(--border); }
.cart-items-head > div:last-child { border-right: none; }
.cart-items-head .ci-h-right { text-align: right; }
.cart-items-head .ci-h-center { text-align: center; }

.cart-item { display: grid; grid-template-columns: 56px minmax(220px, 1fr) 230px 130px 36px; gap: 0; border-bottom: 1px solid var(--border); align-items: stretch; transition: background 0.1s; }
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: #fafaf8; }
.cart-item > div { padding: 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cart-item > div:last-child { border-right: none; }

/* Фото товара */
.ci-photo { padding: 8px !important; }
.ci-photo .photo-box { width: 100%; aspect-ratio: 1/1; background: var(--gray-light); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 9px; font-family: 'PT Sans Narrow', Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.5px; background-size: contain; background-repeat: no-repeat; background-position: center; }

/* Наименование */
.ci-name a { font-size: 13.5px; font-weight: 700; color: var(--black); text-decoration: none; font-family: 'PT Sans Narrow', Arial, sans-serif; line-height: 1.3; display: block; margin-bottom: 4px; }
.ci-name a:hover { color: #777; }
.ci-meta { font-size: 11px; color: #999; line-height: 1.5; }
.ci-meta .sep { color: #ccc; margin: 0 5px; }
.ci-meta .stock { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.ci-meta .stock::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.ci-meta .order { color: #c08600; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.ci-meta .order::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #f0a020; }

/* Калькулятор позиции (как в карточке/категории) */
.ci-calc { padding: 10px 12px !important; flex-direction: column !important; gap: 8px !important; }
.ci-calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ci-calc-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-calc-field label { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #aaa; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.ci-calc-field input { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; font-family: 'PT Sans', Arial, sans-serif; border: 1px solid var(--border); background: var(--white); color: var(--black); font-weight: 600; outline: none; transition: border-color 0.15s; appearance: textfield; -moz-appearance: textfield; }
.ci-calc-field input:focus { border-color: var(--black); }
.ci-calc-field input::-webkit-outer-spin-button,
.ci-calc-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ci-calc-refs { font-size: 10.5px; color: #999; line-height: 1.4; }
.ci-calc-refs b { color: #777; font-weight: 400; }
.ci-calc-refs .sep { color: #ccc; margin: 0 4px; }
.ci-calc-mult { font-size: 10.5px; color: #aaa; }
.ci-calc-mult b { color: var(--black); font-weight: 600; }

/* Цена позиции */
.ci-price { padding: 10px 12px !important; align-items: flex-end !important; text-align: right; }
.ci-price-main { font-size: 17px; font-weight: 700; color: var(--black); font-family: 'PT Sans Narrow', Arial, sans-serif; line-height: 1.1; margin-bottom: 4px; white-space: nowrap; }
.ci-price-main .rub { font-size: 14px; color: #555; font-weight: 600; }
.ci-price-unit { font-size: 11px; color: #999; white-space: nowrap; }
.ci-price-unit b { color: #555; font-weight: 700; font-family: 'PT Sans Narrow', Arial, sans-serif; }

/* Удалить */
.ci-remove { padding: 0 !important; }
.ci-remove button { width: 100%; height: 100%; background: var(--white); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #bbb; transition: color 0.15s, background 0.15s; padding: 0; margin: 0; }
.ci-remove button:hover { color: var(--red); background: #fdf3f3; }
.ci-remove svg { width: 14px; height: 14px; }

/* Скрытый класс для фильтрации поиском */
.cart-item.hidden { display: none; }

/* Пустая корзина (если найдено 0 после поиска) */
.cart-empty-search { padding: 32px 24px; text-align: center; color: #999; font-size: 13px; }

/* === ПРАВАЯ КОЛОНКА: сводка заказа === */
.cart-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }

.summary { border: 1px solid var(--border); padding: 20px 18px; background: var(--white); }
.summary-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #888; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-family: 'PT Sans Narrow', Arial, sans-serif; }

.summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.summary-row .label { color: var(--gray-text); }
.summary-row .label-sub { font-size: 11px; color: #999; display: block; margin-top: 1px; }
.summary-row .value { color: var(--black); font-weight: 700; font-family: 'PT Sans Narrow', Arial, sans-serif; white-space: nowrap; }
.summary-row .value-muted { color: #888; font-weight: 400; }
.summary-row .value-discount { color: var(--green); }

.summary-divider { height: 1px; background: var(--border); margin: 8px 0; }

.summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 14px; border-top: 2px solid var(--black); margin-top: 4px; }
.summary-total .label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--black); font-family: 'PT Sans Narrow', Arial, sans-serif; }
.summary-total .value { font-size: 24px; font-weight: 700; color: var(--black); font-family: 'PT Sans Narrow', Arial, sans-serif; line-height: 1; white-space: nowrap; }
.summary-total .value .rub { font-size: 18px; }

.btn { display: block; width: 100%; text-align: center; padding: 13px 14px; font-size: 12.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; border: none; cursor: pointer; font-family: 'PT Sans Narrow', Arial, sans-serif; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.btn-primary { background: var(--accent); color: var(--black); margin-bottom: 8px; }
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { background: #f0f0ec; color: #bbb; cursor: not-allowed; }
.btn-primary:disabled:hover { opacity: 1; }
.btn-secondary { background: var(--white); color: var(--black); border: 1px solid var(--black); }
.btn-secondary:hover { background: var(--black); color: var(--accent); }

/* Промокод */
.promo { border: 1px solid var(--border); padding: 16px 18px; background: var(--white); }
.promo-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #888; margin-bottom: 4px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.promo-hint { font-size: 11.5px; color: #999; margin-bottom: 10px; line-height: 1.4; }
.promo-form { display: flex; gap: 6px; }
.promo-form input { flex: 1; min-width: 0; padding: 9px 10px; font-size: 13px; font-family: 'PT Sans', Arial, sans-serif; border: 1px solid var(--border); background: var(--white); color: var(--black); outline: none; transition: border-color 0.15s; }
.promo-form input:focus { border-color: var(--black); }
.promo-form button { padding: 9px 14px; background: var(--black); color: var(--white); border: none; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-family: 'PT Sans Narrow', Arial, sans-serif; transition: background 0.15s; flex-shrink: 0; }
.promo-form button:hover { background: var(--accent); color: var(--black); }
.promo-status { font-size: 12px; margin-top: 8px; display: none; }
.promo-status.success { display: block; color: var(--green); }
.promo-status.error { display: block; color: var(--red); }

/* Информационный блок справа */
.side-info { padding: 14px 18px; background: var(--gray-light); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
.side-info-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--gray-text); line-height: 1.5; }
.side-info-row .ico { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.side-info-row a { color: var(--black); text-decoration: none; border-bottom: 1px dotted #bbb; }
.side-info-row a:hover { border-bottom-color: var(--black); }

/* Предупреждение о справочной цене */
.price-note { padding: 10px 14px; background: #fffbe6; border: 1px solid var(--accent); font-size: 11.5px; color: #555; line-height: 1.5; display: flex; gap: 8px; align-items: flex-start; }
.price-note .ico-warn { font-size: 13px; flex-shrink: 0; line-height: 1.3; }

/* Пустая корзина */
.empty-cart { border: 1px solid var(--border); padding: 60px 40px; text-align: center; }
.empty-cart-ico { font-size: 48px; color: #ddd; margin-bottom: 16px; }
.empty-cart h3 { font-size: 22px; font-weight: 700; color: var(--black); margin-bottom: 8px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.empty-cart p { font-size: 14px; color: var(--gray-text); margin-bottom: 24px; max-width: 380px; margin-left: auto; margin-right: auto; }
.empty-cart .btn { max-width: 280px; margin: 0 auto; }

/* === БЫСТРОЕ ОФОРМЛЕНИЕ — форма ниже === */
.quick-checkout { margin-top: 36px; border: 1px solid var(--border); padding: 24px 26px; background: var(--white); }
.quick-checkout-title { font-size: 17px; font-weight: 700; color: var(--black); margin-bottom: 4px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.quick-checkout-sub { font-size: 12.5px; color: #888; margin-bottom: 18px; }
.quick-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.quick-field { display: flex; flex-direction: column; gap: 4px; }
.quick-field label { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #888; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.quick-field input { padding: 10px 12px; font-size: 14px; font-family: 'PT Sans', Arial, sans-serif; border: 1px solid var(--border); background: var(--white); color: var(--black); outline: none; transition: border-color 0.15s; }
.quick-field input:focus { border-color: var(--black); }
.quick-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.quick-actions .btn { width: auto; padding: 13px 28px; flex: 0 0 auto; }
.quick-policy { font-size: 11px; color: #999; line-height: 1.5; flex: 1; min-width: 220px; }
.quick-policy a { color: var(--black); border-bottom: 1px dotted #bbb; text-decoration: none; }
.quick-policy a:hover { border-bottom-color: var(--black); }

/* === ПОХОЖИЕ ТОВАРЫ === */
.section-title { font-size: 19px; font-weight: 700; color: var(--black); margin-bottom: 4px; line-height: 1.25; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.section-title::after { content: ''; display: block; width: 32px; height: 2px; background: var(--accent); margin-top: 8px; }
.section-sub { font-size: 12px; color: #999; margin-bottom: 20px; }

.related { margin-top: 48px; margin-bottom: 36px; }
.related-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.related-card { background: var(--white); padding: 14px 14px 16px; text-decoration: none; color: var(--black); transition: background 0.15s; display: flex; flex-direction: column; }
.related-card:hover { background: var(--gray-light); }
.related-photo { background: var(--gray-light); aspect-ratio: 1/1; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 10px; font-family: 'PT Sans Narrow', Arial, sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.related-name { font-size: 12.5px; line-height: 1.35; margin-bottom: 8px; min-height: 50px; }
.related-price { font-size: 13px; font-weight: 700; color: var(--black); font-family: 'PT Sans Narrow', Arial, sans-serif; margin-top: auto; }
.related-price .unit { color: #999; font-weight: 400; font-size: 11px; }

/* CTA */
.cta { background: var(--accent); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 40px; }
.cta h3 { font-size: 17px; font-weight: 700; color: var(--black); margin-bottom: 2px; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.cta p { font-size: 13px; color: rgba(0,0,0,0.55); }
.cta-contacts { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.cta-contacts a { font-size: 16px; font-weight: 700; color: var(--black); text-decoration: none; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.cta-contacts span { font-size: 11px; color: rgba(0,0,0,0.45); }

/* FOOTER */
.footer { background: var(--black); color: #555; font-size: 12.5px; padding: 36px 0 20px; }
.footer .w { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer-col h4 { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #444; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #222; font-family: 'PT Sans Narrow', Arial, sans-serif; }
.footer-col a, .footer-col p { display: block; color: #555; text-decoration: none; margin-bottom: 6px; line-height: 1.5; }
.footer-col a:hover { color: var(--accent); }
.footer-col .phone { color: var(--accent); font-weight: 700; font-size: 14px; }
.footer-bottom { border-top: 1px solid #1e1e1e; padding-top: 14px; color: #333; font-size: 11px; }

.dev-note { display: inline-block; background: #eef6ff; border: 1px dashed #90bce8; color: #3a7bb5; font-size: 10.5px; padding: 3px 10px; font-family: monospace; margin-bottom: 12px; border-radius: 2px; }

/* ADAPTIVE */
@media (max-width: 1000px) {
    .cart-grid { grid-template-columns: 1fr; }
    .cart-side { position: static; }
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .cart-items-head { display: none; }
    .cart-item { grid-template-columns: 1fr; gap: 0; padding: 14px; border-bottom: 1px solid var(--border); }
    .cart-item > div { border-right: none; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 10px; }
    .cart-item > div:last-child { border-bottom: none; }
    .cart-item > div::before { content: attr(data-label); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #888; font-family: 'PT Sans Narrow', Arial, sans-serif; flex-shrink: 0; margin-right: 12px; padding-top: 2px; }
    .ci-photo { padding: 0 0 8px !important; }
    .ci-photo::before { display: none; }
    .ci-photo .photo-box { width: 80px; height: 80px; aspect-ratio: auto; }
    .ci-name::before { display: none; }
    .ci-calc { flex-direction: column !important; align-items: stretch !important; }
    .ci-calc::before { align-self: flex-start; }
    .ci-calc-fields { flex: 1; }
    .ci-price { align-items: flex-end !important; text-align: right; }
    .ci-remove { padding: 8px 0 0 !important; border-bottom: none !important; }
    .ci-remove::before { display: none; }
    .ci-remove button { width: auto; padding: 8px 14px; gap: 8px; color: #888; }
    .ci-remove button::after { content: 'Удалить из корзины'; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-family: 'PT Sans Narrow', Arial, sans-serif; }
    .quick-fields { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .cta { flex-direction: column; align-items: flex-start; }
    .cta-contacts { text-align: left; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .cart-toolbar { flex-wrap: wrap; }
    .cart-search { max-width: 100%; flex: 1 1 100%; }
    .cart-clear { margin-left: 0; }
}