/* =========================================================================
   Шапка xcontrol.com.ua — раскладка «как у Comfy». 28.08.2026
   Подключается последней строкой перед </head> в header.twig.
   Откат: удалить строку подключения и этот файл.
   ========================================================================= */

:root {
    --xc-accent: #fb9130;
    --xc-accent-dark: #e07b1d;
    --xc-ink: #272323;
    --xc-muted: #6d7484;
    --xc-line: #e4e4ea;
    --xc-util-bg: #f4f4f7;
}

/* ---------- каркас ------------------------------------------------------- */
.xc-hdr { background: #fff; position: sticky; top: 0; z-index: 1020; }
.xc-hdr__wrap {
    max-width: 1230px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ---------- служебная строка -------------------------------------------- */
.xc-hdr__util { background: var(--xc-util-bg); border-bottom: 1px solid var(--xc-line); }
.xc-hdr__util .xc-hdr__wrap { height: 38px; gap: 18px; font-size: 12.5px; color: var(--xc-muted); }
.xc-hdr__util a { color: var(--xc-muted); text-decoration: none; }
.xc-hdr__util a:hover { color: var(--xc-ink); }

.xc-lang { display: flex; align-items: center; gap: 4px; }
.xc-lang button {
    border: 0; background: transparent; padding: 3px 7px; border-radius: 3px;
    font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--xc-muted); cursor: pointer;
}
.xc-lang button.is-current { background: var(--xc-ink); color: #fff; }

.xc-city { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.xc-city::before { content: "◎"; font-size: 13px; }

.xc-toplinks { margin-left: auto; display: flex; gap: 18px; white-space: nowrap; }

.xc-tel {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: var(--xc-accent-dark) !important; white-space: nowrap;
}
.xc-tel::before { content: "✆"; font-size: 14px; }
.xc-tel-call { font-size: 12px; font-weight: 400; border-bottom: 1px dashed currentColor; }

/* ---------- основная строка --------------------------------------------- */
.xc-hdr__main { border-bottom: 1px solid var(--xc-line); }
.xc-hdr__main .xc-hdr__wrap { height: 82px; }

.xc-logo { flex: none; display: block; }
.xc-logo img { display: block; width: 126px; height: 50px; object-fit: contain; }

.xc-cat {
    flex: none;
    display: inline-flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 22px; border: 0; border-radius: 8px;
    background: var(--xc-accent); color: #fff;
    font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.xc-cat:hover { background: var(--xc-accent-dark); }
.xc-cat__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5px; }
.xc-cat__grid i { display: block; width: 6px; height: 6px; background: currentColor; border-radius: 1.5px; }

/* поиск: тема кладёт кнопку абсолютом слева — переносим вправо и делаем кнопкой */
.xc-search { flex: 1 1 auto; min-width: 0; }
.xc-search .rm-search {
    margin: 0 !important;
    height: 50px;
    display: flex;
    align-items: stretch;
    border: 2px solid var(--xc-accent);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.xc-search .rm-search input {
    flex: 1 1 auto; min-width: 0;
    padding: 0 16px !important;
    height: 100% !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 14px;
}
.xc-search .btn-search {
    position: static !important;
    flex: none;
    width: auto !important;
    padding: 0 22px !important;
    background: var(--xc-accent) !important;
    border: 0;
    gap: 8px;
}
.xc-search .btn-search:hover { background: var(--xc-accent-dark) !important; }
.xc-search .btn-search img { filter: brightness(0) invert(1); }
.xc-search-btn-text { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; }

/* выпадашка живого поиска не должна быть частью флекс-строки — иначе она съедает ширину поля */
.xc-search .rm-search #rm_livesearch {
    position: absolute;
    top: 100%; left: 0; right: 0;
    width: 100%;
    z-index: 1040;
}
.xc-search .rm-search #rm_livesearch_close {
    left: auto;
    right: 128px;                 /* слева от кнопки «Пошук» */
}
.xc-search .rm-search input[type="hidden"] { display: none; }

/* иконки с подписями */
.xc-actions { flex: none; display: flex; gap: 20px; }
.xc-act {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: 11.5px; color: var(--xc-muted); text-decoration: none; white-space: nowrap;
}
.xc-act:hover { color: var(--xc-ink); }
.xc-act img { width: 22px; height: 22px; }

/* корзина кнопкой в рамке */
.xc-cart { flex: none; }
.xc-cart .rm-header-cart {
    flex-direction: row !important;
    align-items: center;
    gap: 9px;
    height: 50px;
    padding: 0 18px;
    border: 1.5px solid var(--xc-accent);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}
.xc-cart .rm-header-cart-icon { margin: 0 !important; left: 0 !important; }
.xc-cart .rm-header-cart-text { font-weight: 600; }

.xc-visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- планшет и узкое окно ---------------------------------------- */
@media (max-width: 1199.98px) {
    .xc-toplinks { gap: 14px; }
    .xc-actions { gap: 14px; }
    .xc-logo img { width: 104px; height: 42px; }
}

@media (max-width: 991.98px) {
    .xc-toplinks { display: none; }               /* служебные ссылки — в подвал и меню */
    .xc-actions { display: none; }                /* избранное/сравнение — в боковой панели темы */
    .xc-hdr__main .xc-hdr__wrap { height: 70px; }
    .xc-cat { height: 44px; padding: 0 16px; font-size: 14px; }
    .xc-search .rm-search { height: 44px; }
}

/* ---------- телефон ------------------------------------------------------ */
@media (max-width: 767.98px) {
    .xc-hdr { top: 0; }
    .xc-hdr__util .xc-hdr__wrap { height: 34px; gap: 12px; }
    .xc-city { display: none; }
    .xc-tel { margin-left: auto; }
    .xc-hdr__main .xc-hdr__wrap {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 10px;
    }
    .xc-logo img { width: 92px; height: 37px; }
    .xc-cat { order: -1; height: 40px; padding: 0 14px; }
    .xc-search { flex: 1 1 100%; order: 3; }
    .xc-search .rm-search { height: 42px; }
    .xc-search .btn-search { padding: 0 16px !important; }
}

@media (max-width: 400px) {
    .xc-search-btn-text { display: none; }
    .xc-search .btn-search { padding: 0 14px !important; }
}


/* ---------- виджет языка темы внутри служебной строки -------------------- */
.xc-hdr__util .top-nav-account-links-item { padding: 0 !important; }
.xc-hdr__util .rm-dropdown-box { position: relative; }
.xc-hdr__util .btn-lang { border: 0; background: transparent; padding: 0; font-size: 12.5px; color: #6d7484; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.xc-hdr__util .btn-lang img.lang { width: 16px; height: 11px; }
.xc-hdr__util .rm-dropdown { z-index: 1035; }

/* счётчик у иконок «Порівняння» и «Обране» */
.xc-act { position: relative; }
.xc-act__count {
    position: absolute; top: -4px; right: 50%; transform: translateX(26px);
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--xc-accent); color: #fff;
    font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; border-radius: 9px;
}

/* --- корзина в шапке на планшете и телефоне --- */
@media (max-width: 991.98px) {
    .xc-cart .rm-header-cart {
        position: static !important;
        width: auto !important;
        height: 44px !important;
        line-height: normal !important;
        border: 1.5px solid var(--xc-accent) !important;
        padding: 0 12px;
        gap: 7px;
    }
    .xc-cart .rm-header-cart-text { font-size: 13px; }
}
@media (max-width: 767.98px) {
    .xc-cart { margin-left: auto; }
    .xc-cart .rm-header-cart { height: 40px !important; padding: 0 10px; }
    .xc-cart .rm-header-cart-text { display: none; }
}

/* =========================================================================
   Первый экран главной. Добавлено 31.08.2026.
   Было: плашка с H1 занимала 140 px (30 отступ + 30 паддинг бокса + 16 margin
   + 32 сам заголовок), из-за чего плитки категорий уходили под сгиб.
   Откат: удалить этот блок до конца файла.
   ========================================================================= */
#common-home > .row-padding-top:first-child { padding-top: 10px; }
#common-home > .row-padding-top:first-child .rm-content { padding: 14px 20px; }
#common-home > .row-padding-top:first-child .rm-content > .mt-3 { margin-top: 0 !important; }
#common-home > .row-padding-top:first-child h1 { font-size: 24px; line-height: 1.25; margin: 0; }

@media (max-width: 767.98px) {
    #common-home > .row-padding-top:first-child .rm-content { padding: 12px 14px; }
    #common-home > .row-padding-top:first-child h1 { font-size: 19px; }
}

/* --- слайдер главной ---------------------------------------------------
   Текст в слайде был растянут по высоте: заголовок вверху, кнопка внизу,
   между ними пустота. Собираем в один блок по центру и делаем список читаемее.
   Откат: удалить этот блок. */
.rm-slideshow-plus-item-box { justify-content: center !important; }
.rm-slideshow-plus-item-title { margin-bottom: 14px; }
.rm-slideshow-plus-item-description { font-size: 16px; line-height: 1.85; }
.rm-slideshow-plus-item-box .rm-slideshow-plus-item-button,
.rm-slideshow-plus-item-box a[class*="button"] {
    margin-top: 22px;
    font-weight: 600;
    letter-spacing: .2px;
}
@media (max-width: 767.98px) {
    .rm-slideshow-plus-item-description { font-size: 14px; line-height: 1.7; }
}

/* текстовая часть слайда: было 30/30/30/50 при узкой колонке — заголовок ломался */
.rm-slideshow-plus-item-box { padding: 26px 20px 26px 34px !important; }
.rm-slideshow-plus-item-title { font-size: 26px !important; line-height: 1.2; }
.rm-slideshow-plus-item-box .rm-btn { padding: 12px 26px; }
@media (max-width: 991.98px) {
    .rm-slideshow-plus-item-title { font-size: 22px !important; }
}

/* =========================================================================
   Плитки «Популярні категорії» — раскладка как у Comfy. Добавлено 31.08.2026.
   Было: картинка сверху, текст снизу, по центру, 190 px на плитку, фона нет.
   Стало: цветная пастельная плашка, текст слева, картинка справа, ~92 px.
   Картинки категорий — JPEG на белом фоне; вместо перерисовки в PNG
   используем mix-blend-mode: multiply — белое сливается с цветом плашки.
   Откат: удалить этот блок до конца файла.
   ========================================================================= */
.rm-category-wall .row.no-gutters { margin: 0 -5px; }
.rm-category-wall-item { padding: 5px !important; }

.rm-category-wall-item > a {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    height: 92px;
    padding: 12px 14px !important;
    border-radius: 14px;
    background: var(--xc-tile, #EFEDFB);
    color: #272323;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.rm-category-wall-item > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 35, 35, .12);
    color: #272323;
}
.rm-category-wall-item > a > span:last-child {
    font-size: 13.5px;
    line-height: 1.25;
    font-weight: 500;
    flex: 1 1 auto;
    padding-right: 8px;
}
.rm-category-wall-item-image {
    order: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 68px;
}
.rm-category-wall-item-image img {
    max-width: 74px;
    max-height: 68px;
    width: auto !important;
    height: auto !important;
    mix-blend-mode: multiply;      /* убирает белый фон фотографии */
}

/* палитра плашек — шесть пастельных тонов по кругу, как у Comfy */
.rm-category-wall-item:nth-child(6n+1) > a { --xc-tile: #EFEDFB; }
.rm-category-wall-item:nth-child(6n+2) > a { --xc-tile: #FDF3E4; }
.rm-category-wall-item:nth-child(6n+3) > a { --xc-tile: #E9F6F1; }
.rm-category-wall-item:nth-child(6n+4) > a { --xc-tile: #FBEDF2; }
.rm-category-wall-item:nth-child(6n+5) > a { --xc-tile: #EAF1FD; }
.rm-category-wall-item:nth-child(6n)   > a { --xc-tile: #F1F4E8; }

@media (max-width: 991.98px) {
    .rm-category-wall-item > a { height: 84px; padding: 10px 12px !important; }
    .rm-category-wall-item-image, .rm-category-wall-item-image img { width: 62px; max-width: 62px; height: 58px; max-height: 58px; }
    .rm-category-wall-item > a > span:last-child { font-size: 12.5px; }
}

/* слайдер стал вторым блоком после плиток — ужимаем его по высоте,
   было 411 px (картинка 329 + отступы 26/26 + 30 сверху), стало ~310 */
.rm-slideshow-plus-box .row.row-padding-top,
.rm-slideshow-plus-box { padding-top: 18px !important; }
.rm-slideshow-plus-item-box { padding: 18px 18px 18px 30px !important; }
/* высоту слайда держит не картинка, а список: 5 строк при line-height 1.85.
   Возвращаем плотную строку — слайд ниже ещё примерно на 40 px. */
.rm-slideshow-plus-item-description { line-height: 1.6 !important; }
.rm-slideshow-plus-item-box .rm-btn { margin-top: 16px !important; }
/* настоящая причина высоты слайда: у обёртки кнопки отступы 48 сверху и 50 снизу,
   у заголовка 20 сверху, у списка 30 снизу — вместе почти 150 px воздуха */
.rm-slideshow-plus-item-text .rm-slideshow-plus-item-title { margin: 6px 0 10px !important; }
.rm-slideshow-plus-item-text p { margin-bottom: 16px !important; }
.rm-slideshow-plus-item-text .rm-slideshow-plus-item-btn { margin: 14px 0 6px !important; }

/* =========================================================================
   Переключатель языка: убираем флаг у русского пункта. Добавлено 31.08.2026.
   Разметка темы: в выпадающем списке у каждого языка <img src=".../ru-ru.png">.
   Прячем только картинку — сам пункт и переключение остаются рабочими.
   Откат: удалить этот блок.
   ========================================================================= */
#language img[src*="ru-ru"],
.language-select img[src*="ru-ru"],
.btn-lang img[src*="ru-ru"] { display: none !important; }

/* без картинки текст «Русский» уезжал влево — выравниваем по украинскому пункту */
.language-select img[src*="ru-ru"] + span,
#language .language-select:has(img[src*="ru-ru"]) { padding-left: 2px; }

/* заголовок блока товаров стал <h2> (раньше был <span> — из-за этого страницы шли без H2).
   Возвращаем ему прежний вид, чтобы визуально ничего не поменялось. */
.rm-module-header h2.rm-module-header-title {
    font: inherit;
    margin: 0;
    padding: 0;
    display: inline;
    color: inherit;
}
