.if-custom-cart-wrapper {
    margin: var(--if-wrapper-margin, 0);
    padding: var(--if-wrapper-padding, 0);
}

.if-single-cart-split {
    display: grid;
    grid-template-columns: var(--if-split-left-width, 1fr) var(--if-split-right-width, 1fr) var(--if-split-desc-width, 1.5fr);
    gap: var(--if-split-gap, 30px);
    align-items: var(--if-split-valign, flex-start);
}

.if-single-cart-left {
    display: flex;
    flex-direction: column;
    gap: var(--if-left-col-gap, 25px);
    align-items: var(--if-left-align, flex-start);
}

/* Product / category-product title above the variations (toggle + text controls). */
.if-single-cart-title {
    font-family: var(--if-font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    margin: 0;
    color: var(--if-color-dark, #111827);
}

.if-single-cart-description-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.if-single-cart-desc-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.if-single-cart-right {
    display: flex;
    flex-direction: column;
    align-items: var(--if-right-align, flex-start);
    gap: var(--if-right-col-gap, 20px);
}

.if-custom-cart-wrapper .woocommerce-variation-description {
    display: none !important;
}

/* Variations Swatches */
.if-cart-variations {
    display: flex;
    flex-direction: column;
    gap: var(--if-var-row-gap, 15px);
    width: 100%;
}

.if-variation-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: var(--if-var-align, flex-start);
}

.if-variation-label {
    font-weight: 600;
    text-transform: uppercase;
    margin: var(--if-label-margin, 0);
}

.if-swatches-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--if-swatch-gap, 10px);
    justify-content: var(--if-swatch-justify, flex-start);
}

/* Hide original selects */
.if-variation-row select {
    display: none !important;
}

.if-swatch-btn {
    background: var(--if-swatch-bg, #f5f5f5);
    color: var(--if-swatch-color, #333);
    border: var(--if-swatch-border-width, 1px) var(--if-swatch-border-style, solid) var(--if-swatch-border-color, #ccc);
    border-radius: var(--if-swatch-radius, 20px);
    padding: var(--if-swatch-padding, 8px 16px);
    margin: var(--if-swatch-margin, 0);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Длинные значения («Крепление к карнизу, 2 шт»): reset.css темы Hello ставит
   кнопкам white-space: nowrap — на телефоне кнопка не должна выходить за экран. */
.if-swatch-btn {
    white-space: normal;
    text-align: center;
    max-width: 100%;
}

.if-swatch-btn:hover {
    background: var(--if-swatch-bg-hover, #ebebeb);
    color: var(--if-swatch-color-hover, #000);
    border-color: var(--if-swatch-border-color-hover, #999);
}

.if-swatch-btn.is-active {
    background: var(--if-swatch-bg-active, #fff);
    color: var(--if-swatch-color-active, #d40000);
    border-color: var(--if-swatch-border-color-active, #d40000);
}

/* Beat reset.css button:hover/:focus (pink) on the swatches — otherwise a freshly
   selected swatch shows the reset's pink/white on :focus instead of its state. */
.if-single-cart-split .if-swatch-btn:hover,
.if-single-cart-split .if-swatch-btn:focus {
    background: var(--if-swatch-bg-hover, #ebebeb);
    color: var(--if-swatch-color-hover, #000);
    border-color: var(--if-swatch-border-color-hover, #999);
}

.if-single-cart-split .if-swatch-btn.is-active,
.if-single-cart-split .if-swatch-btn.is-active:hover,
.if-single-cart-split .if-swatch-btn.is-active:focus {
    background: var(--if-swatch-bg-active, #fff);
    color: var(--if-swatch-color-active, #d40000);
    border-color: var(--if-swatch-border-color-active, #d40000);
}

.if-swatch-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Action Buttons */
.if-cart-custom-action {
    width: 100%;
    margin: var(--if-order-margin, 0);
    text-align: var(--if-order-align, left);
}

.if-cart-custom-action .elementor-button {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.if-custom-cart-wrapper .quantity {
    display: flex;
    align-items: center;
    margin: var(--if-qty-margin, 0);
}

.if-qty-btn {
    border-radius: var(--if-qty-radius, 50%);
    border: var(--if-qty-border-width, 1px) solid var(--if-qty-border-color, #000);
    background: var(--if-qty-bg, transparent);
    color: var(--if-qty-color, #000);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
    transition: all 0.3s;
}

/* Size scoped to the widget wrapper so it wins by specificity (0,2,0) over the
   theme's bare .if-qty-btn (cart/card rules in style.css) regardless of
   stylesheet load order — fixes the split stepper rendering at 34px. Driven by
   --if-qty-btn-size, which the Elementor "Размер кнопок" control sets. */
.if-custom-cart-wrapper .if-qty-btn {
    box-sizing: border-box;
    width: var(--if-qty-btn-size, 20px);
    height: var(--if-qty-btn-size, 20px);
    min-width: var(--if-qty-btn-size, 20px);
    /* Beats reset.css top/left 14px. The +/- is an SVG now (if_qty_icon), centred
       by flex — the old text glyph needed a 3px bottom nudge and still sat off. */
    padding: 0;
    flex: 0 0 auto;
}

/* The icon follows «Размер значка + / −» (font-size on the button) and the
   button's own colour controls, including hover. */
.if-custom-cart-wrapper .if-qty-btn .if-qty-ico {
    width: 0.6em;
    height: 0.6em;
    fill: currentColor;
}

.if-qty-btn:hover {
    background: var(--if-qty-bg-hover, #f0f0f0);
    color: var(--if-qty-color-hover, #000);
    border-color: var(--if-qty-border-color-hover, #000);
}

/* Neutralise reset.css `button:hover/:focus { background:#c36; color:#fff }` on the
   split +/- for hover/focus/active. (0,3,0) beats the reset's [type=button]:hover (0,2,0). */
.if-custom-cart-wrapper .if-qty-btn:hover,
.if-custom-cart-wrapper .if-qty-btn:focus,
.if-custom-cart-wrapper .if-qty-btn:active {
    background: var(--if-qty-bg-hover, transparent);
    color: var(--if-qty-color-hover, var(--if-color-dark, #111827));
    border-color: var(--if-qty-border-color-hover, var(--if-qty-border-color, #000));
}

.if-custom-cart-wrapper .quantity input.qty {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
    font-weight: 600;
}

.if-custom-cart-wrapper .quantity input.qty::-webkit-outer-spin-button,
.if-custom-cart-wrapper .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Price block (WooCommerce output) */
.if-custom-cart-wrapper .woocommerce-variation-price {
    margin: var(--if-price-margin, 0 0 15px 0) !important;
}

.if-custom-cart-wrapper .woocommerce-variation-price .price,
.if-custom-cart-wrapper .woocommerce-variation-price .price span,
.if-custom-cart-wrapper .woocommerce-variation-price .price ins,
.if-custom-cart-wrapper .woocommerce-variation-price .price ins .amount,
.if-custom-cart-wrapper .woocommerce-variation-price .price > .amount {
    color: var(--if-price-color, inherit) !important;
    background: var(--if-price-bg, transparent);
    padding: var(--if-price-padding, 0);
}

/* Submit Add to Cart Button with HIGH specificity to override theme defaults */
.if-custom-cart-wrapper button[type="submit"].single_add_to_cart_button.button.alt {
    background-color: var(--if-submit-bg, #e3000f) !important;
    color: var(--if-submit-color, #fff) !important;
    border: var(--if-submit-border, none) !important;
    border-radius: var(--if-submit-radius, 3px) !important;
    padding: var(--if-submit-padding, 12px 30px) !important;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease !important;
    margin: var(--if-submit-margin, 0) !important;
}

.if-custom-cart-wrapper button[type="submit"].single_add_to_cart_button.button.alt:hover {
    background-color: var(--if-submit-bg-hover, #c2000d) !important;
    color: var(--if-submit-color-hover, #fff) !important;
    border: var(--if-submit-border-hover, none) !important;
}

.if-custom-cart-wrapper button[type="submit"].single_add_to_cart_button.button.alt.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.if-custom-cart-wrapper button[type="submit"].single_add_to_cart_button.loading {
    opacity: 0.7 !important;
    cursor: wait !important;
}

.if-custom-cart-wrapper button[type="submit"].single_add_to_cart_button.is-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

/* Inline notices */
.if-cart-notice {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.if-cart-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* «Параметры …» — третий столбец (desc_mode = params). Строки вариативных
   атрибутов скрыты, пока JS не подставит значение выбранной вариации. */
.if-single-cart-params {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.if-single-cart-params__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.if-single-cart-params__item[hidden] {
    display: none;
}

.if-single-cart-params__value {
    overflow-wrap: anywhere;
}

/* Где название параметра, а где значение: название полужирное и с двоеточием,
   значение обычным — «Диаметр (мм): 100» (раньше всё одним шрифтом:
   «Диаметр (мм) 100», «Покрытие Оцинковка + Порошковая окраска»). */
.if-single-cart-params__label {
    font-weight: 600;
}

.if-single-cart-params__label::after {
    content: ':';
}

.if-single-cart-params__value {
    font-weight: 400;
}

/* Подпись атрибута в строке с кнопками (label_position = inline): подпись — первая
   ячейка сетки, как «D (ММ): 100 106 110» в макете. min-width кнопок (контрол
   «Мин. ширина кнопки», {{WRAPPER}} .if-swatch-btn) снимается — ширину задаёт сетка.
   Столбец не уже своего самого длинного слова (minmax(min-content, …)): с minmax(0, …)
   на ноутбуках 1025–1365px ячейка 52–68px, а «МЕТАЛЛА» в подписи 5px ONDER — 69px,
   слово рвалось посередине; «15×84×150×15» вылезало из пилюли на 7–15px. Пока всё
   помещается (1366+ и телефоны), столбцы по-прежнему равные. */
.if-var-label-inline .if-single-cart-split .if-variation-row {
    display: grid;
    grid-template-columns: repeat(var(--if-swatch-cols, 4), minmax(min-content, 1fr));
    gap: var(--if-swatch-gap, 10px);
    align-items: center;
}

/* Самые узкие телефоны (320): три длинных значения «10×30×30×10» в четыре столбца не
   помещаются — строка выходила за колонку к краю экрана. Здесь три кнопки в ряд
   (переменная на строке перекрывает значение виджета на обёртке). */
@media (max-width: 359px) {
    .if-var-label-inline .if-single-cart-split .if-variation-row {
        --if-swatch-cols: 3;
    }
}

.if-var-label-inline .if-single-cart-split .if-swatches-wrap {
    display: contents;
}

.elementor-widget-if_single_product_cart.if-var-label-inline .if-single-cart-split .if-variation-row .if-swatch-btn {
    min-width: 0;
    width: 100%;
}

/* Длинная подпись («Толщина металла:») переносится внутри своей ячейки, а не
   наезжает на первую кнопку. */
.if-var-label-inline .if-single-cart-split .if-variation-label {
    margin: 0;
    min-width: 0;
    overflow-wrap: break-word;
}

/* Знака ₽ нет в ONDER: без этого он рисуется запасным шрифтом в номинальном
   размере цены — вдвое мельче цифр (ONDER визуально примерно ×2). */
.if-custom-cart-wrapper .woocommerce-variation-price .woocommerce-Price-currencySymbol {
    font-family: 'Inter', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1;
}

/* Метка-логотип в левом верхнем углу фото товара — как на карточках каталога и в
   макете. Файл тот же, что у карточек (images/Group.png). */
body.single-product .elementor-widget-woocommerce-product-images .woocommerce-product-gallery::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 16px;
    width: 24px;
    height: 24px;
    background: url('../../images/Group.png') no-repeat center / contain;
    z-index: 3;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 767px) {
    .if-single-cart-split {
        grid-template-columns: 1fr;
    }

    /* Название товара над вариантами — Inter Black (900) 10,8px обычным регистром (было
       ONDER 5px капсом, потом Inter 700 12px). Страница товара на телефоне — две колонки
       (mobile-product.css), название вверху правой колонки по левому краю, как «Желоб
       водосточный оцинкованный» в кадре 1435:4017. Шрифт в Elementor не задаётся
       отдельно для телефона, поэтому здесь; вес (0,4,1) — выше настройки виджета (0,4,0).
       Inter 900 — тот же переменный файл, что и 400–700, лишней загрузки нет.
       На компьютере остаётся ONDER, как в desk-product-card. */
    body .elementor-widget-if_single_product_cart.elementor-element .if-single-cart-split .if-single-cart-title {
        font-family: var(--if-font-body, 'Inter', sans-serif);
        font-size: 10.8px;
        font-weight: 900;
        line-height: 1.1;
        letter-spacing: 0;
        text-transform: none;
        text-align: left;
        color: #000;
    }
}