/* Блок покупки: допы и склад. Работает поверх разметки темы speed011222 и системной корзины /order/. */

/* --- Карточка товара: название ближе к шапке, крошки над названием --- */
.action-product .uk-container > .uk-padding-large.uk-padding-remove-horizontal.uk-padding-remove-bottom { padding-top: 22px !important; }
.action-product .uk-margin-medium:has(> .wrapper-name > h1.page-name) { display: flex; flex-direction: column; margin-bottom: 22px !important; }
.action-product .uk-margin-medium:has(> .wrapper-name > h1.page-name) > .uk-breadcrumb { order: -1; margin: 0 0 8px !important; }
.action-product .wrapper-name > h1.page-name { margin: 0 !important; font-size: 26px; line-height: 1.25; }
@media (max-width: 959px) { .action-product .wrapper-name > h1.page-name { font-size: 21px; } }

/* --- Карточка товара: название не повторяется в блоке покупки --- */
.action-product #cart-flyer .uk-card-header { display: none !important; }
.action-product #cart-flyer #cart-form { padding-top: 1px; }

/* --- Карточка товара: нет остатка — нет строки «Склад» --- */
.action-product #cart-flyer .uk-card-body:has(> .stocks):not(:has(.stock-high, .stock-low, .stock-critical, .sku-no-stock)) { display: none !important; }

/* --- Допы в карточке товара: жёлтая плашка --- */
.action-product #cart-form .services { display: flex; flex-direction: column; background: #fff6d6; border: 1.5px solid #f1c40f; border-radius: 12px; padding: 14px 16px 6px; }
.action-product #cart-form .services::before { order: -2; content: "Добавьте к заказу"; font-weight: 700; font-size: 17px; color: #222; line-height: 1.3; margin-bottom: 10px; }
.action-product #cart-form .services:has(.service-1, .service-2, .service-4, .service-6)::before { content: "⚡ Не забудьте батарейки!"; margin-bottom: 0; }
.action-product #cart-form .services:has(.service-1, .service-2, .service-4, .service-6)::after { order: -1; content: "Пульт продаётся без батареек"; font-size: 14px; color: #6b5a00; margin: 2px 0 10px; }
.action-product #cart-form .services > div { margin: 0 !important; padding: 9px 0; border-top: 1px solid #f0dc8a; }
.action-product #cart-form .services > div[style*="display: none"] { display: none !important; }
.action-product #cart-form .services .uk-grid { display: flex; flex-wrap: nowrap; align-items: center; margin-left: 0; }
.action-product #cart-form .services .uk-grid > * { padding-left: 0; }
.action-product #cart-form .services .uk-grid > .uk-width-auto { display: flex; margin-right: 12px; }
.action-product #cart-form .services input[type="checkbox"] { transition: none !important; width: 24px; height: 24px; margin: 0; border: 2px solid #b9a24a; border-radius: 6px; background-color: #fff; cursor: pointer; }
html body.action-product #cart-form .services input[type="checkbox"]:checked,
html body .action-product #cart-form .services input[type="checkbox"]:checked:focus { background-color: #1ea74a !important; border-color: #1ea74a !important; }
.action-product #cart-form .services label { display: flex; align-items: center; gap: 10px; font-size: 16px; color: #222; cursor: pointer; margin: 0; }
.action-product #cart-form .services .service-variants { margin-top: 6px; }

/* --- Корзина /order/: строка товара сеткой (ширина колонок — как в теме, пополам с оформлением заказа) --- */
.s-order-page .wa-product .wa-product-body { display: grid !important; grid-template-columns: 72px auto minmax(0, 1fr) max-content; column-gap: 20px; row-gap: 12px; align-items: start; }
.s-order-page .wa-product .wa-column-details,
.s-order-page .wa-product .wa-details-section,
.s-order-page .wa-product .wa-details { display: contents !important; }
.s-order-page .wa-product .wa-column-image { grid-column: 1; grid-row: 1 / 4; width: auto !important; margin: 0 !important; padding: 0 !important; }
.s-order-page .wa-product .wa-column-image img { width: 72px; height: 72px; object-fit: contain; }
.s-order-page .wa-product .wa-name { grid-column: 2 / 5; grid-row: 1; min-width: 0; font-weight: 700; font-size: 17px; line-height: 1.3; color: #222; }
/* цена в одной строке со счётчиком, справа */
.s-order-page .wa-product .wa-column-price { grid-column: 3 / 5; grid-row: 2; align-self: center; justify-self: end; width: auto !important; margin: 0 !important; padding: 0 !important; text-align: right; }
.s-order-page .wa-product .wa-price-total { font-weight: 700; font-size: 20px; white-space: nowrap; }
.s-order-page .wa-product .wa-column-quantity { grid-column: 2; grid-row: 2; width: auto !important; margin: 0 !important; padding: 0 !important; }
/* «Удалить» не показываем: при 1 шт. минус удаляет товар (buyblock.js) */
.s-order-page .wa-product .wa-details .wa-actions { display: none !important; }
.s-order-page .wa-product .wa-services { grid-column: 2 / 5; grid-row: 3; }
/* лишние подписи: «шт.», «мин./макс.», «350 ₽/шт.», второе «Удалить» */
.s-order-page .wa-product .wa-unit,
.s-order-page .wa-product .js-min-description,
.s-order-page .wa-product .js-max-description,
.s-order-page .wa-product .wa-quantity-cart-section .wa-section-footer,
.s-order-page .wa-product .wa-quantity-actions { display: none !important; }
/* счётчик − 1 + */
.s-order-page .wa-product .wa-quantity-cart-section .wa-section-body { display: inline-flex !important; align-items: center; height: 40px; border: 1.5px solid #ddd; border-radius: 22px; overflow: hidden; padding: 0; margin: 0; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button-wrapper { margin: 0 !important; padding: 0 !important; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button { transition: none !important; width: 38px; height: 38px; min-width: 0; padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--buyblock-accent, #7b2471) !important; display: flex; align-items: center; justify-content: center; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button .wa-icon-wrapper { display: inline-flex !important; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button svg { fill: currentColor !important; color: inherit; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button:disabled { color: #ccc; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-button.is-locked { cursor: pointer; opacity: 1 !important; color: var(--buyblock-accent, #7b2471) !important; }
.s-order-page .wa-product .wa-quantity-cart-section .wa-field-wrapper { margin: 0 !important; padding: 0 !important; display: block; }
.s-order-page .wa-product .wa-quantity-cart-section input.js-product-quantity { width: 34px !important; height: 36px; padding: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent; text-align: center; font-size: 16px; font-weight: 600; }
@media (max-width: 639px) {
    .s-order-page .wa-product .wa-product-body { grid-template-columns: 52px auto minmax(0, 1fr) max-content; column-gap: 10px; }
    .s-order-page .wa-product .wa-column-image { grid-row: 1 / 3; }
    .s-order-page .wa-product .wa-column-image img { width: 52px; height: 52px; }
    .s-order-page .wa-product .wa-name { overflow-wrap: anywhere; }
    .s-order-page .wa-product .wa-quantity-cart-section .wa-section-body { height: 36px; }
    .s-order-page .wa-product .wa-quantity-cart-section .wa-button { width: 32px; height: 34px; }
    .s-order-page .wa-product .wa-quantity-cart-section input.js-product-quantity { width: 28px !important; height: 32px; }
    .s-order-page .wa-product .wa-name { font-size: 15px; }
    .s-order-page .wa-product .wa-price-total { font-size: 17px; }
    .s-order-page .wa-product .wa-services { grid-column: 1 / 5; }
}

/* --- Допы в корзине /order/: та же плашка --- */
.s-order-page .wa-services { display: flex; flex-direction: column; background: #fff6d6; border: 1.5px solid #f1c40f; border-radius: 12px; padding: 10px 14px 4px; margin-top: 2px; }
.s-order-page .wa-services::before { content: "Добавьте к заказу"; font-weight: 700; font-size: 15px; color: #222; margin-bottom: 4px; }
.s-order-page .wa-services:has([data-service-id="1"], [data-service-id="2"], [data-service-id="4"], [data-service-id="6"])::before { content: "⚡ Не забудьте батарейки!"; }
.s-order-page .wa-services .wa-service { margin: 0 !important; padding: 8px 0; border-top: 1px solid #f0dc8a; }
.s-order-page .wa-services .wa-label { display: flex !important; align-items: center; gap: 10px; margin: 0; padding-left: 0 !important; font-size: 15px; color: #222; cursor: pointer; }
.s-order-page .wa-services .wa-field { flex: none; display: flex; position: static !important; }
.s-order-page .wa-services .s-checkbox { transform: none !important; display: flex; }
.s-order-page .wa-services input.js-service-field { transition: none !important; width: 22px; height: 22px; margin: 0; border: 2px solid #b9a24a; border-radius: 6px; background-color: #fff; cursor: pointer; }
html body .s-order-page .wa-services input.js-service-field:checked,
html body .s-order-page .wa-services input.js-service-field:checked:focus { background-color: #1ea74a !important; border-color: #1ea74a !important; }
.s-order-page .wa-services .wa-variant { margin: 6px 0 0 32px; }

/* --- Подпись допа: название слева, цена справа (разбивку делает buyblock.js) --- */
.buyblock-name { flex: 1; line-height: 1.3; }
.buyblock-price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.buyblock-price .service-price { font-weight: inherit; }

/* --- Оформление заказа: «Я принимаю условия…» — красный квадрат, пока не отмечен --- */
html body .s-order-page .is-agreement-field input.wa-checkbox { width: 22px; height: 22px; border: 2px solid #e4003a !important; border-radius: 5px; background-color: #fff0f3 !important; box-shadow: 0 0 0 3px rgba(228, 0, 58, .15); transition: none !important; cursor: pointer; }
html body .s-order-page .is-agreement-field input.wa-checkbox:checked { border-color: #1ea74a !important; background-color: #1ea74a !important; box-shadow: none; }
html body .s-order-page .is-agreement-field .wa-checkbox-wrapper { display: flex; align-items: center; gap: 10px; cursor: pointer; }
html body .s-order-page .is-agreement-field .s-checkbox { transform: none !important; display: flex; flex: none; }
html body .s-order-page .is-agreement-field::after { content: "Обязательное поле — отметьте, чтобы оформить заказ"; display: block; margin: 4px 0 0 32px; font-size: 13px; color: #e4003a; }
html body .s-order-page .is-agreement-field:has(input.wa-checkbox:checked)::after { display: none; }

/* ===== Тема 101meshok (181122topshop): у допов label.checkbox с галочкой внутри ===== */
#cart-form .stocks:has(> div:not([style*="none"]) > .stock-none) { display: none !important; }
#cart-form .services:has(> div > label.checkbox) { display: flex; flex-direction: column; background: #fff6d6; border: 1.5px solid #f1c40f; border-radius: 12px; padding: 14px 16px 6px; margin: 10px 0; }
#cart-form .services:has(> div > label.checkbox)::before { order: -2; content: "Добавьте к заказу"; font-weight: 700; font-size: 17px; color: #222; line-height: 1.3; margin-bottom: 10px; }
#cart-form .services:has(> div > label.checkbox):has(.service-1, .service-2, .service-4, .service-6)::before { content: "⚡ Не забудьте батарейки!"; margin-bottom: 0; }
#cart-form .services:has(> div > label.checkbox):has(.service-1, .service-2, .service-4, .service-6)::after { order: -1; content: "Пульт продаётся без батареек"; font-size: 14px; color: #6b5a00; margin: 2px 0 10px; }
#cart-form .services > div:has(> label.checkbox) { margin: 0 !important; padding: 9px 0; border-top: 1px solid #f0dc8a; }
#cart-form .services > div:has(> label.checkbox)[style*="display: none"] { display: none !important; }
#cart-form .services > div > label.checkbox { display: flex !important; align-items: center; gap: 12px; margin: 0; padding: 0 !important; font-size: 16px; color: #222; cursor: pointer; }
#cart-form .services > div > label.checkbox input[type="checkbox"] { position: static !important; margin: 0 !important; flex: none; }

/* Галочки без оформления темы: рисуем сами (рамка, зелёная заливка и белая галка) */
#cart-form .services > div > label.checkbox input[type="checkbox"],
html body .s-order-page .is-agreement-field input.wa-checkbox { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border: 2px solid #b9a24a; border-radius: 6px; background: #fff center / 16px no-repeat; transition: none !important; cursor: pointer; }
#cart-form .services > div > label.checkbox input[type="checkbox"]:checked,
html body .s-order-page .is-agreement-field input.wa-checkbox:checked { background-color: #1ea74a !important; border-color: #1ea74a !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L19 7' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
html body .s-order-page .is-agreement-field input.wa-checkbox:not(:checked) { border-color: #e4003a !important; background-color: #fff0f3 !important; }

/* ===== Оформление заказа: варианты доставки карточками (buyblock.js, delivery) ===== */
.buyblock-dv-on > .wa-header,
.buyblock-dv-on > .js-variants-select { display: none !important; }
/* галочка на плитке типа доставки — только когда вариант действительно выбран */
.buyblock-novariant .wa-type-wrapper.is-active::after { display: none !important; }
.buyblock-dv { margin-top: 14px; }
.buyblock-dv__title { font-weight: 700; font-size: 15px; color: #222; margin-bottom: 2px; }
.buyblock-dv__opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid #ddd; border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: #fff; cursor: pointer; }
.buyblock-dv__opt:hover { border-color: #aaa; }
.buyblock-dv__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #aaa; flex: none; background: #fff; }
.buyblock-dv__opt.is-on { border-color: #2ab84a; background: #f2fbf4; }
.buyblock-dv__opt.is-on .buyblock-dv__radio { border: 6px solid #2ab84a; }
.buyblock-dv__name { flex: 1; font-size: 15px; color: #222; line-height: 1.3; }
.buyblock-dv__name span { display: block; font-size: 13px; color: #777; margin-top: 2px; }
.buyblock-dv__price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.buyblock-dv__chosen { display: flex; align-items: center; gap: 10px; border: 2px solid #2ab84a; background: #f2fbf4; border-radius: 10px; padding: 12px 14px; color: #222; }
.buyblock-dv__chosen svg { flex: none; color: #1a7f37; }
.buyblock-dv__change { color: #006bd8 !important; font-size: 14px; white-space: nowrap; text-decoration: none !important; }
.buyblock-dv__step { border: 2px solid #e4003a; background: #fff4f6; border-radius: 10px; padding: 14px 16px; }
.buyblock-dv__t { font-weight: 700; font-size: 16px; color: #222; }
.buyblock-dv__s { font-size: 13px; color: #b00030; margin-top: 2px; }
.buyblock-dv__map { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #e4003a; color: #fff !important; border-radius: 8px; padding: 12px; font-weight: 700; font-size: 15px; text-decoration: none !important; }
.buyblock-dv__map:hover { background: #c70033; }

/* ===== Оформление заказа: способ оплаты карточками (buyblock.js, payment) ===== */
.buyblock-pay-on .wa-methods-list { border: 0 !important; background: none !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper { border: 1.5px solid #ddd !important; border-radius: 10px !important; margin: 10px 0 0 !important; background: #fff !important; cursor: pointer; overflow: hidden; }
.buyblock-pay-on .wa-methods-list .wa-method-wrapper:hover { border-color: #aaa !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper .wa-method { display: flex !important; width: auto !important; align-items: center; gap: 12px; padding: 12px 14px !important; margin: 0 !important; border: 0 !important; background: none !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper .wa-method .wa-checkbox-wrapper { display: block !important; position: static !important; width: 20px !important; height: 20px; flex: none; border-radius: 50%; border: 2px solid #aaa; background: #fff; margin: 0 !important; padding: 0 !important; }
.buyblock-pay-on .wa-method .wa-checkbox-wrapper > * { display: none !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper .wa-method > * { display: block; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper .wa-method .wa-image-wrapper { display: flex !important; flex: none; width: 52px; margin: 0 !important; display: flex; justify-content: center; }
.buyblock-pay-on .wa-method .wa-image-wrapper img { max-width: 52px; max-height: 34px; }
.buyblock-pay-on .wa-method .wa-method-body { flex: 1; margin: 0 !important; padding: 0 !important; }
.buyblock-pay-on .wa-method .wa-payment-name, .buyblock-pay-on .wa-method .wa-payment-name a { color: #222 !important; font-weight: 700; font-size: 15px; text-decoration: none !important; }
.buyblock-pay-on .wa-method .wa-description { font-size: 13px; color: #777; margin-top: 2px; }
.buyblock-pay-on .wa-method-wrapper.is-active { border-color: #2ab84a !important; background: #f2fbf4 !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper.is-active .wa-method .wa-checkbox-wrapper { border: 6px solid #2ab84a; }
html body .s-order-page .wa-order-form-wrapper .buyblock-pay-on .wa-methods-list .wa-method-wrapper.is-active,
html body .s-order-page .wa-order-form-wrapper .buyblock-pay-on .wa-methods-list .wa-method-wrapper.is-active .wa-method { border-color: #2ab84a !important; background: #f2fbf4 !important; }
body .buyblock-pay-on .wa-methods-list .wa-method-wrapper::before, body .buyblock-pay-on .wa-methods-list .wa-method-wrapper::after { display: none !important; content: none !important; }
.buyblock-pay__badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: #e4003a; color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px; white-space: nowrap; }
.buyblock-pay__hint { font-size: 13px; color: #555; margin: -2px 0 2px; }
/* выбранная карточка оплаты — зелёная рамка и фон, как выбранный пункт доставки (сильнее правил темы и fixorder) */
html body #wa-step-payment-section.buyblock-pay-on .wa-methods-list .wa-method-wrapper { transition: none !important; border: 1.5px solid #ddd !important; border-radius: 10px !important; background: #fff !important; box-shadow: none !important; }
html body #wa-step-payment-section.buyblock-pay-on .wa-methods-list .wa-method-wrapper.is-active { border: 2px solid #2ab84a !important; background: #f2fbf4 !important; }
html body #wa-step-payment-section.buyblock-pay-on .wa-methods-list .wa-method-wrapper .wa-method { background: transparent !important; box-shadow: none !important; }

/* ===== Оформление заказа: единый скруглённый вид (как карточки корзины, доставки и оплаты) ===== */
html body .s-order-page .wa-delivery-types-section .wa-types-list { border-radius: 10px; overflow: hidden; }
html body .s-order-page .wa-step-auth-section .wa-section-body { border-radius: 10px; bottom: 0; }
html body .s-order-page .wa-order-form-wrapper .wa-details-rates-section { border-radius: 10px; }
html body .s-order-page .wa-order-form-wrapper .wa-details-rates-section:has(+ .wa-details-fields-section) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
html body .s-order-page .wa-order-form-wrapper .wa-step-details-section .wa-details-fields-section { border-radius: 0 0 10px 10px; }
html body .s-order-page .wa-order-form-wrapper .wa-step-details-section .wa-details-fields-section:first-child { border-radius: 10px; }
html body .s-order-page .bb-delivery-description { border-radius: 10px; }
html body .s-order-page .bb-delivery-description::before { border-radius: 6px; }
html body .s-order-page input.wa-input, html body .s-order-page textarea.wa-textarea, html body .s-order-page select.wa-select { border-radius: 8px; }
html body .s-order-page .wa-step-payment-section .wa-error-text, html body .s-order-page .wa-step-shipping-section .wa-error-text { border-radius: 8px; }
