/* ==========================================================
   AT ELECTRO — Cassiopeia / VirtueMart
   Этап 2: уточнение карточек, списков и оформление фильтров.
   Joomla и VirtueMart не изменяются. Только оформление.
   ========================================================== */

/* 01. Палитра и параметры для ручной настройки */
:root {
    --at-navy: #222c50;
    --at-accent: #365f98;
    --at-text: #263244;
    --at-muted: #627084;
    --at-line: #dde4ed;
    --at-bg: #f5f7fa;
    --at-card: #fff;
    --at-active: #eaf0f9;
    --at-radius: 10px;
    --at-font: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --at-card-shadow: 0 2px 8px rgba(34, 44, 80, .06);
    --at-image-height: 210px; /* Высота области фото в каталоге */
    --at-product-heading-size: 25px; /* Заголовок отдельного товара */
    --at-select-height: 40px; /* Минимальная высота выпадающих списков */
}

/* 02. Типографика магазина. Главную страницу и DJ-MegaMenu не меняем. */
body.com_virtuemart .container-component,
body.com_virtuemart .container-sidebar-left,
body.com_virtuemart .container-sidebar-right {
    font-family: var(--at-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--at-text);
}

body.com_virtuemart .container-component :is(h1, h2, h3, h4),
body.com_virtuemart .container-sidebar-left :is(h2, h3, h4),
body.com_virtuemart .container-sidebar-right :is(h2, h3, h4) {
    font-family: var(--at-font);
    color: var(--at-navy);
    font-weight: 600;
}

body.com_virtuemart .container-component,
body.com_virtuemart .container-sidebar-left,
body.com_virtuemart .container-sidebar-right {
    min-width: 0;
}

body.com_virtuemart .container-component a {
    color: var(--at-accent);
    text-underline-offset: 3px;
}

/* 03. Шапка — выше обычной галереи, не меняем sticky/fixed. */
.container-header.sticky-top {
    z-index: 1040;
}

/* Создаём локальный слой именно для обычной галереи товара.
   Не изменяем Fancybox и другие полноэкранные окна. */
body.com_virtuemart.view-productdetails .productdetails-view :is(.main-image, .vm-product-media-container) {
    position: relative;
    z-index: 0;
}

/* 04. Боковые модули.
   Назначить модулю категорий класс at-vm-categories,
   модулю поиска — at-vm-search (Дополнительно / класс модуля).
   Классы обеспечивают изоляцию от сертификатов и других модулей. */
.container-sidebar-left :is(.at-vm-categories, .at-vm-search),
.container-sidebar-right :is(.at-vm-categories, .at-vm-search) {
    font-family: var(--at-font);
    font-size: 14px;
    border: 1px solid var(--at-line);
    border-radius: var(--at-radius);
    background: var(--at-card);
    box-shadow: var(--at-card-shadow);
    min-width: 0;
}

:is(.at-vm-categories, .at-vm-search) .card-header,
:is(.at-vm-categories, .at-vm-search) .card-title {
    font-family: var(--at-font);
    font-size: 16px;
    font-weight: 600;
    color: var(--at-navy);
    background: var(--at-card);
    border-bottom: 1px solid var(--at-line);
    padding: 12px 14px;
    margin: 0;
    border-radius: var(--at-radius) var(--at-radius) 0 0;
}
:is(.at-vm-categories, .at-vm-search) .card-body {
    padding: 10px 12px;
    min-width: 0;
}

/* Дерево категорий: без маркеров, активная ветка выделена. */
.at-vm-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.at-vm-categories li {
    list-style: none;
    margin: 2px 0;
    padding: 0;
}
.at-vm-categories li::marker { content: ""; }
.at-vm-categories li ul {
    margin: 3px 0 8px 9px;
    padding-left: 8px;
    border-left: 1px solid var(--at-line);
}
.at-vm-categories li a {
    display: block;
    padding: 7px 9px;
    color: var(--at-text);
    text-decoration: none;
    border-radius: 6px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.at-vm-categories .card-body > ul > li > a,
.at-vm-categories ul.VMmenu > li > a {
    color: var(--at-navy);
    font-weight: 600;
}
.at-vm-categories li a:hover,
.at-vm-categories li a:focus-visible {
    background: var(--at-bg);
    color: var(--at-accent);
}
.at-vm-categories li:is(.current, .active, .VmOpen) > a,
.at-vm-categories li a:is(.current, .active, [aria-current="page"]) {
    background: var(--at-active);
    color: var(--at-navy);
    font-weight: 600;
}

/* Поиск: поддержка обычных input и кнопок старого модуля. */
.at-vm-search form { margin: 0; }
.at-vm-search input:is([type="text"], [type="search"]) {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--at-line);
    border-radius: 7px;
    font: inherit;
    color: var(--at-text);
    background: var(--at-card);
}
.at-vm-search :is(button, input[type="submit"]) {
    max-width: 100%;
    font: inherit;
    border: 1px solid var(--at-accent);
    border-radius: 7px;
    padding: 8px 12px;
    background: var(--at-accent);
    color: #fff;
    cursor: pointer;
}
.at-vm-search input[type="submit"] { margin-top: 8px; }

/* 05. Категория и панель сортировки.
   Селекторы взяты из вашего bs5-default.php. */
body.com_virtuemart .category-view .vm-category-title {
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 600 !important;
    text-align: left !important;
    margin-bottom: 16px !important;
}
body.com_virtuemart .category-view :is(.vm-category-description, .vm-manufacturer-description) {
    text-align: left !important;
    line-height: 1.65;
    margin-bottom: 22px !important;
}
body.com_virtuemart .category-view .orderby-displaynumber {
    background: var(--at-bg);
    padding: 14px !important;
    border: 1px solid var(--at-line) !important;
    border-radius: var(--at-radius);
    margin-bottom: 24px !important;
}
body.com_virtuemart .orderby-displaynumber .vm-order-list {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 10px;
}
body.com_virtuemart .orderby-displaynumber :is(label, .orderlistcontainer) {
    font-size: 13px;
    color: var(--at-muted);
}
body.com_virtuemart .orderby-displaynumber select,
body.com_virtuemart .productdetails-view select,
body.com_virtuemart .vm-product-grid select {
    max-width: 100%;
    font-family: var(--at-font);
    border-color: var(--at-line);
    border-radius: 7px;
    font-size: 14px;
}
body.com_virtuemart .applied-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 15px;
}
body.com_virtuemart .applied-filters :is(.btn, button, a) {
    border: 1px solid var(--at-line);
    border-radius: 6px;
    padding: 5px 9px;
    background: var(--at-active);
    color: var(--at-navy);
    font-size: 13px;
}

/* 06. Карточки товаров. Разметку PHP не меняем. */
body.com_virtuemart .vm-products-type-title {
    font-size: 22px;
    margin: 22px 0 12px;
}
body.com_virtuemart .vm-product-grid {
    padding-inline: 0;
    margin-top: 18px !important;
    margin-bottom: 24px !important;
}
body.com_virtuemart .vm-product-grid > .row {
    --bs-gutter-x: 16px;
    --bs-gutter-y: 16px;
}
body.com_virtuemart .vm-product-grid .product {
    min-width: 0;
}
body.com_virtuemart .vm-product-grid .product-container {
    padding: 14px;
    background: var(--at-card);
    border: 1px solid var(--at-line);
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow) !important;
    min-width: 0;
}
body.com_virtuemart .vm-product-grid .product-container:hover {
    border-color: #b8c9df;
    box-shadow: 0 5px 16px rgba(34,44,80,.09) !important;
}
body.com_virtuemart .vm-product-grid .vm-product-media-container {
    height: var(--at-image-height);
    min-height: 0 !important; /* Перекрываем inline min-height из override */
}
body.com_virtuemart .vm-product-grid .vm-product-media-container > a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 0;
}
body.com_virtuemart .vm-product-grid img.browseProductImage {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding-inline: 0 !important;
}
body.com_virtuemart .vm-product-grid .vm-product-rating-container {
    margin: 10px 0 12px !important;
    border-color: var(--at-line) !important;
    padding-bottom: 6px !important;
}
body.com_virtuemart .vm-product-grid .vm-product-title {
    text-align: left !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
body.com_virtuemart .vm-product-grid .vm-product-title a {
    color: var(--at-navy);
    text-decoration: none;
}
body.com_virtuemart .vm-product-grid .vm-product-title a:hover {
    text-decoration: underline;
}
body.com_virtuemart .vm-product-grid .vm-product-s-desc {
    text-align: left !important;
    color: var(--at-muted) !important;
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0 14px;
    flex: 1 0 auto; /* Прижимает блок цены ниже короткого описания */
}
body.com_virtuemart .vm-product-grid .product-container > .mx-2 {
    margin-inline: 0 !important;
}
body.com_virtuemart .vm-product-grid .product-price {
    margin: 6px 0 10px;
    font-size: 13px;
    color: var(--at-muted);
}
body.com_virtuemart .vm-product-grid .PricesalesPrice > span.PricesalesPrice {
    font-size: 18px;
    font-weight: 700;
    color: var(--at-navy);
}
/* Не меняем состояния AJAX-обновления цены и работу addtocart. */
body.com_virtuemart .vm-product-grid :is(.addtocart-area, .product-field, .product-fields) {
    min-width: 0;
    max-width: 100%;
}
body.com_virtuemart .vm-product-grid .product-field {
    margin: 8px 0;
    font-size: 13px;
}

/* 07. Страница товара. Стандартный VirtueMart, без override. */
body.com_virtuemart.view-productdetails .productdetails-view h1 {
    font-size: clamp(21px, 2vw, var(--at-product-heading-size));
    line-height: 1.32;
    font-weight: 600;
    overflow-wrap: anywhere;
    margin-bottom: 10px;
}
/* Производитель: оставляем ссылку рабочей, но убираем старое оформление. */
body.com_virtuemart.view-productdetails .productdetails-view :is(.manufacturer, .manufacturer-name) {
    font-size: 13px;
    line-height: 1.65;
    color: var(--at-muted);
}
body.com_virtuemart.view-productdetails .productdetails-view :is(.manufacturer, .manufacturer-name) a {
    display: inline;
    padding: 2px 6px;
    border-radius: 5px;
    background-color: var(--at-bg);
    color: var(--at-accent);
    font-weight: 600;
    text-decoration: none;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
body.com_virtuemart.view-productdetails .productdetails-view :is(.manufacturer, .manufacturer-name) a:is(:hover, :focus-visible) {
    background-color: var(--at-active);
    text-decoration: underline;
}
body.com_virtuemart.view-productdetails .productdetails-view .main-image {
    margin-bottom: 14px;
    text-align: center;
}
body.com_virtuemart.view-productdetails .productdetails-view .main-image img {
    max-width: 100%;
    height: auto;
    border-radius: 7px;
}
body.com_virtuemart.view-productdetails .productdetails-view .additional-images {
    margin-top: 12px;
}
body.com_virtuemart.view-productdetails .productdetails-view .additional-images img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
body.com_virtuemart.view-productdetails .productdetails-view :is(.product-short-description, .product-description) {
    font-size: 15px;
    line-height: 1.65;
    color: var(--at-text);
}
body.com_virtuemart.view-productdetails .productdetails-view .product-price {
    margin: 18px 0;
    color: var(--at-muted);
}
body.com_virtuemart.view-productdetails .productdetails-view .PricesalesPrice > span.PricesalesPrice {
    font-size: 26px;
    font-weight: 700;
    color: var(--at-navy);
}
body.com_virtuemart.view-productdetails .productdetails-view .product-field {
    margin: 10px 0;
    font-size: 14px;
    min-width: 0;
}

/* 08. Chosen — старые выпадающие списки.
   Ширина ограничена родителем, сам dropdown не обрезаем. */
body.com_virtuemart :is(.category-view, .productdetails-view) .chosen-container {
    max-width: 100%;
    font-family: var(--at-font);
    font-size: 13px;
}
body.com_virtuemart :is(.category-view, .productdetails-view) .chosen-container-single .chosen-single {
    border-color: var(--at-line);
    border-radius: 7px;
    box-shadow: none;
    background: var(--at-card);
    color: var(--at-text);
    /* Фон в предыдущей версии мог затереть штатную стрелку Chosen.
       Рисуем свою; функциональность списка остаётся у VirtueMart. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23627084' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
    min-height: var(--at-select-height);
    height: auto;
    display: flex;
    align-items: center;
    padding: 7px 34px 7px 12px;
    line-height: 1.4;
}
body.com_virtuemart :is(.category-view, .productdetails-view) .chosen-container-single .chosen-single > span {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Скрываем только старую декоративную стрелку, а не весь dropdown. */
body.com_virtuemart :is(.category-view, .productdetails-view) .chosen-container-single .chosen-single > div > b {
    visibility: hidden;
}
body.com_virtuemart :is(.category-view, .productdetails-view) .chosen-container-single .chosen-single:focus-visible {
    outline: 2px solid var(--at-accent);
    outline-offset: 2px;
}
/* Нативные Bootstrap select: не стираем background-image со стрелкой. */
body.com_virtuemart :is(.vm-product-grid, .productdetails-view, .orderby-displaynumber) select.form-select {
    min-height: var(--at-select-height);
    padding-block: 7px;
    padding-inline-start: 12px;
    padding-inline-end: 34px;
    line-height: 1.4;
}
/* Дополнительные параметры остаются в границах карточки. */
body.com_virtuemart :is(.vm-product-grid, .productdetails-view) .product-field :is(.product-field-display, .chosen-container) {
    min-width: 0;
    max-width: 100%;
}
body.com_virtuemart :is(.vm-product-grid, .productdetails-view) .product-field .product-fields-title-wrapper {
    overflow-wrap: anywhere;
}

/* 09. Мобильная адаптация. Две карточки на обычном телефоне,
   одна на особо узком экране. */
@media (max-width: 767.98px) {
    body.com_virtuemart .vm-product-grid > .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 12px;
    }
    body.com_virtuemart .vm-product-grid .product-container {
        padding: 10px;
    }
    body.com_virtuemart .vm-product-grid .vm-product-media-container {
        height: 145px;
    }
    body.com_virtuemart .vm-product-grid .vm-product-title {
        font-size: 14px;
    }
    body.com_virtuemart .vm-product-grid .PricesalesPrice > span.PricesalesPrice {
        font-size: 16px;
    }
    body.com_virtuemart .orderby-displaynumber .display-number {
        text-align: left !important;
    }
}
@media (max-width: 359.98px) {
    body.com_virtuemart .vm-product-grid .product {
        flex: 0 0 100%;
        width: 100%;
    }
}


/* 10. EasyVMFilter — первый проход оформления.
   Назначить модулю класс at-vm-filters.
   Сам модуль не предоставлен: здесь только общие элементы формы
   и стандартные классы jQuery UI, без изменения разметки/логики. */
.at-vm-filters {
    min-width: 0;
    font-family: var(--at-font);
    font-size: 14px;
    color: var(--at-text);
}
.at-vm-filters :is(h2, h3, h4, legend, .card-header, .card-title) {
    font-family: var(--at-font);
    font-weight: 600;
    color: var(--at-navy);
    font-size: 15px;
    line-height: 1.45;
}
.at-vm-filters.card {
    border: 1px solid var(--at-line);
    border-radius: var(--at-radius);
    box-shadow: var(--at-card-shadow);
    background: var(--at-card);
}
.at-vm-filters .card-header {
    background-color: var(--at-card);
    border-color: var(--at-line);
    padding: 12px 14px;
}
.at-vm-filters .card-body { padding: 12px; min-width: 0; }
.at-vm-filters label { font-family: var(--at-font); line-height: 1.5; cursor: pointer; }
.at-vm-filters input[type="checkbox"] {
    accent-color: var(--at-accent);
    width: 15px;
    height: 15px;
    vertical-align: -2px;
    margin-inline-end: 5px;
    cursor: pointer;
}
.at-vm-filters input[type="number"] {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 34px;
    padding: 4px 6px;
    font: inherit;
    color: var(--at-text);
    background-color: var(--at-card);
    border: 1px solid var(--at-line);
    border-radius: 6px;
}
.at-vm-filters input:focus-visible { outline: 2px solid var(--at-accent); outline-offset: 2px; }
.at-vm-filters .ui-widget { font-family: var(--at-font); font-size: 14px; }
.at-vm-filters .ui-accordion .ui-accordion-header {
    background: var(--at-bg);
    color: var(--at-navy);
    border: 1px solid var(--at-line);
    border-radius: 6px;
    font: 600 14px/1.4 var(--at-font);
    padding-block: 7px;
    margin-block: 7px 4px;
}
.at-vm-filters .ui-accordion .ui-accordion-content {
    background: var(--at-card);
    border: 0;
    padding: 6px 3px 10px;
}
/* Не изменяем размеры/позиции ползунков, рассчитанные скриптом. */
.at-vm-filters .ui-slider {
    background: #e6ebf2;
    border: 1px solid var(--at-line);
    border-radius: 8px;
}
.at-vm-filters .ui-slider .ui-slider-range {
    background: #a4b8d5;
    border-radius: 8px;
}
.at-vm-filters .ui-slider .ui-slider-handle {
    background: var(--at-card);
    border: 1px solid #90a8c7;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(34,44,80,.15);
    cursor: grab;
}
.at-vm-filters .ui-slider .ui-slider-handle:focus-visible {
    outline: 2px solid var(--at-accent);
    outline-offset: 2px;
}









/* ==========================================================
   AT ELECTRO — дополнение к user.css, страница товара (BS5).
   Добавить в КОНЕЦ существующего user.css один раз.
   Не заменяет предыдущие стили каталога и фильтров.
   ========================================================== */

/* Компактный заголовок товара, не затрагивает заголовки каталога. */
body.com_virtuemart.view-productdetails .productdetails-view h1.vm-page-title {
    font-size: clamp(21px, 2vw, var(--at-product-heading-size, 25px));
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Производитель — компактная строка; штатная ссылка остаётся рабочей. */
.productdetails-view .at-product-meta .manufacturer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--at-muted, #627084);
}
body.com_virtuemart.view-productdetails .productdetails-view .at-product-meta .manufacturer a {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    background: var(--at-active, #eaf0f9);
    color: var(--at-accent, #365f98);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
    max-width: 100%;
}
body.com_virtuemart.view-productdetails .productdetails-view .at-product-meta .manufacturer a:hover {
    text-decoration: underline;
}

/* Контактная кнопка: HTML details/summary, без JS и Bootstrap-плагинов. */
.productdetails-view .at-product-contact {
    --at-contact-radius: 8px; /* Скругление кнопки и панели */
    --at-contact-button-height: 48px;
    margin: 16px 0 12px;
    min-width: 0;
    font-family: var(--at-font, "Segoe UI", Arial, sans-serif);
    color: var(--at-text, #263244);
}
.productdetails-view .at-product-contact > .at-product-contact-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    min-height: var(--at-contact-button-height);
    padding: 12px 36px;
    border: 1px solid transparent;
    border-radius: var(--at-contact-radius);
    background: var(--at-accent, #365f98);
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    list-style: none;
    transition: background-color .15s ease;
}
/* Убираем штатный маркер details: рисуем одну собственную стрелку. */
.productdetails-view .at-product-contact-toggle::-webkit-details-marker { display: none; }
.productdetails-view .at-product-contact-toggle::marker { content: ""; }
.productdetails-view .at-product-contact-toggle:hover {
    background: var(--at-navy, #222c50);
}
.productdetails-view .at-product-contact-toggle:focus-visible,
.productdetails-view .at-contact-number:focus-visible {
    outline: 2px solid var(--at-accent, #365f98);
    outline-offset: 3px;
}
.productdetails-view .at-contact-phone-icon { flex: 0 0 20px; }
.productdetails-view .at-contact-chevron {
    position: absolute;
    right: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
}
.productdetails-view .at-product-contact[open] .at-contact-chevron {
    transform: translateY(-25%) rotate(225deg);
}
.productdetails-view .at-product-contact-panel {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--at-line, #dde4ed);
    border-radius: var(--at-contact-radius);
    background: var(--at-bg, #f5f7fa);
}
.productdetails-view .at-product-contact:not([open]) > .at-product-contact-panel {
    display: none;
}
.productdetails-view .at-contact-caption,
.productdetails-view .at-contact-hours {
    font-size: 12px;
    line-height: 1.5;
    color: var(--at-muted, #627084);
}
.productdetails-view .at-contact-caption { margin-bottom: 8px; }
body.com_virtuemart .productdetails-view a.at-contact-number {
    display: block;
    padding: 9px 10px;
    margin: 5px 0;
    border: 1px solid var(--at-line, #dde4ed);
    border-radius: 6px;
    background: var(--at-card, #fff);
    color: var(--at-accent, #365f98);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}
body.com_virtuemart .productdetails-view a.at-contact-number:hover {
    background: var(--at-active, #eaf0f9);
    text-decoration: underline;
}
.productdetails-view .at-contact-hours { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
    .productdetails-view .at-product-contact-toggle { transition: none; }
}
@media print {
    .productdetails-view .at-product-contact { display: none !important; }
}





/* =====================================================
   АТ ЕЛЕКТРО — ЕНЕРГОІНСТРУМЕНТИ
   Вітрина та навігація між калькуляторами
   ===================================================== */

.at-tools {
    --at-navy: #222c50;
    --at-accent: #365f98;
    --at-text: #263244;
    --at-muted: #627084;
    --at-border: #dfe5ed;
    --at-light: #f4f6f9;

    color: var(--at-text);
    line-height: 1.6;
    margin: 0 0 24px;
}

.at-tools *,
.at-tools *::before,
.at-tools *::after {
    box-sizing: border-box;
}

.at-tools a {
    text-decoration: none !important;
}

.at-tools a:focus-visible {
    outline: 3px solid #779dce;
    outline-offset: 3px;
}

.at-tools-intro {
    color: var(--at-muted);
    font-size: 15px;
    margin: 0 0 24px;
    max-width: 850px;
}


/* =====================================================
   Головна картка — енергетична аналітика
   ===================================================== */

.at-tools .at-tools-hero {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 30px 32px;
    border-radius: 14px;

    background: linear-gradient(
        120deg,
        #20294b 0%,
        #303e68 65%,
        #3c527a 100%
    );

    color: #fff;
    box-shadow: 0 5px 18px rgba(34, 44, 80, .12);

    transition:
        box-shadow .2s ease,
        transform .2s ease;
}

.at-tools-hero-label {
    display: flex;
    align-items: center;
    gap: 12px;

    color: #c2d0e5;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.at-tools .at-tools-hero h2 {
    color: #fff;
    font-size: clamp(21px, 2.6vw, 30px);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 12px;
}

.at-tools-hero p {
    color: #dbe3ef;
    font-size: 15px;
    max-width: 720px;
    margin: 0 0 20px;
}

/* Декоративний графік, без JavaScript */

.at-tools-chart {
    height: 85px;
    width: 100%;
    max-width: 660px;
    margin: 10px 0 20px;

    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 100%;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 80' preserveAspectRatio='none'%3E%3Cg fill='%238298c1'%3E%3Crect x='1' y='46' width='15' height='34' rx='2'/%3E%3Crect x='21' y='49' width='15' height='31' rx='2'/%3E%3Crect x='41' y='55' width='15' height='25' rx='2'/%3E%3Crect x='121' y='46' width='15' height='34' rx='2'/%3E%3Crect x='141' y='34' width='15' height='46' rx='2'/%3E%3Crect x='161' y='42' width='15' height='38' rx='2'/%3E%3Crect x='181' y='51' width='15' height='29' rx='2'/%3E%3Crect x='201' y='55' width='15' height='25' rx='2'/%3E%3Crect x='281' y='42' width='15' height='38' rx='2'/%3E%3Crect x='301' y='29' width='15' height='51' rx='2'/%3E%3Crect x='421' y='40' width='15' height='40' rx='2'/%3E%3Crect x='441' y='49' width='15' height='31' rx='2'/%3E%3Crect x='461' y='54' width='15' height='26' rx='2'/%3E%3C/g%3E%3Cg fill='%2381b6ad'%3E%3Crect x='61' y='64' width='15' height='16' rx='2'/%3E%3Crect x='81' y='67' width='15' height='13' rx='2'/%3E%3Crect x='101' y='59' width='15' height='21' rx='2'/%3E%3Crect x='221' y='61' width='15' height='19' rx='2'/%3E%3Crect x='241' y='65' width='15' height='15' rx='2'/%3E%3Crect x='261' y='58' width='15' height='22' rx='2'/%3E%3C/g%3E%3Cg fill='%23d9948b'%3E%3Crect x='321' y='18' width='15' height='62' rx='2'/%3E%3Crect x='341' y='5' width='15' height='75' rx='2'/%3E%3Crect x='361' y='11' width='15' height='69' rx='2'/%3E%3Crect x='381' y='17' width='15' height='63' rx='2'/%3E%3Crect x='401' y='27' width='15' height='53' rx='2'/%3E%3C/g%3E%3C/svg%3E");
}

.at-tools .at-tools-hero .at-tools-action {
    color: #fff;
}


/* =====================================================
   Картки інженерних калькуляторів
   ===================================================== */

.at-tools .at-tools-section-title {
    color: var(--at-navy);
    font-size: 21px;
    font-weight: 600;
    margin: 28px 0 16px;
}

.at-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.at-tools .at-tools-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    padding: 23px;

    color: var(--at-text);
    background: #fff;
    border: 1px solid var(--at-border);
    border-radius: 12px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.at-tools .at-tools-card h3 {
    color: var(--at-navy);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 14px 0 8px;
}

.at-tools-card p {
    color: var(--at-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px;
}

.at-tools-action {
    display: inline-block;
    margin-top: auto;

    font-size: 14px;
    font-weight: 600;
    color: var(--at-accent);
}

.at-tools .at-tools-help {
    background: #f0f3f8;
    border-color: #e2e7ef;
}

.at-tools-footer {
    color: var(--at-muted);
    font-size: 12px;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--at-border);
}


/* =====================================================
   Іконки — вбудовані SVG, без зовнішніх бібліотек
   ===================================================== */

.at-tools-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    width: 48px;
    height: 48px;

    border-radius: 11px;
    background: #eaf0f9;
    color: var(--at-accent);
}

.at-tools-icon::before {
    content: "";
    display: block;
    width: 26px;
    height: 26px;
    background-color: currentColor;

    -webkit-mask: var(--at-icon) center / contain no-repeat;
    mask: var(--at-icon) center / contain no-repeat;
}

.at-tools-hero .at-tools-icon {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    width: 42px;
    height: 42px;
}

/* Графік */
.ati-chart {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18M7 14l4-5 4 3 6-8M7 21v-3m5 3v-6m5 6v-4m4 4v-9'/%3E%3C/svg%3E");
}

/* Калькулятор */
.ati-calculator {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2'/%3E%3Cpath d='M8 6h8M8 10h2m4 0h2M8 14h2m4 0h2M8 18h2m4 0h2'/%3E%3C/svg%3E");
}

/* Реактивна потужність */
.ati-wave {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M2 12h20M2 12C6-2 8-2 12 12s6 14 10 0'/%3E%3C/svg%3E");
}

/* Акумулятор */
.ati-battery {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='18' height='12' rx='2'/%3E%3Cpath d='M23 10v4M12 8l-4 5h5l-2 3'/%3E%3C/svg%3E");
}

/* Трансформатор */
.ati-transformer {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M2 12h20M8 19v3m8-3v3M12 4V2'/%3E%3C/svg%3E");
}

/* Лічильник */
.ati-meter {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Crect x='7' y='5' width='10' height='5' rx='1'/%3E%3Cpath d='M7 14h5M7 18v1m5-1v1m5-1v1'/%3E%3Ccircle cx='16' cy='14' r='1'/%3E%3C/svg%3E");
}

/* Консультація */
.ati-headset {
    --at-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14v-3a9 9 0 0 1 18 0v5a5 5 0 0 1-5 5h-4'/%3E%3Crect x='3' y='11' width='4' height='7' rx='2'/%3E%3Crect x='17' y='11' width='4' height='7' rx='2'/%3E%3C/svg%3E");
}


/* =====================================================
   Компактна навігація між калькуляторами
   ===================================================== */

.at-tools-nav {
    margin: 32px 0 20px;
    padding: 20px;

    background: #fff;
    border: 1px solid var(--at-border);
    border-radius: 12px;
}

.at-tools.at-tools-nav h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--at-navy);
}

.at-tools-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.at-tools-nav-grid a {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 52px;
    padding: 10px 12px;

    border: 1px solid #e8ecf2;
    border-radius: 7px;
    background: var(--at-light);

    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--at-navy);

    transition:
        background-color .18s ease,
        border-color .18s ease;
}

.at-tools-nav-grid .at-tools-icon {
    width: 28px;
    height: 28px;
    background: transparent;
}

.at-tools-nav-grid .at-tools-icon::before {
    width: 22px;
    height: 22px;
}

/* Стрілка праворуч */
.at-tools-nav-grid a::after {
    content: "\203A";
    margin-left: auto;
    padding-left: 5px;
    color: #8291a6;
    font-size: 23px;
    font-weight: 400;
}

/* Поточний калькулятор */
.at-tools-nav-grid a.is-current,
.at-tools-nav-grid a[aria-current="page"] {
    background: #e6edf7;
    border-color: #b7c9e0;
    color: var(--at-accent);
}

.at-tools-nav-grid a[aria-current="page"]::after {
    content: "\2713";
    font-size: 15px;
    color: var(--at-accent);
}

.at-tools .at-tools-back {
    display: block;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--at-border);

    color: var(--at-accent);
    font-size: 13px;
    font-weight: 600;
}


/* =====================================================
   Ефекти наведення — лише для пристроїв з мишею
   ===================================================== */

@media (hover: hover) {

    .at-tools .at-tools-card:hover {
        transform: translateY(-3px);
        border-color: #a9bfdc;
        box-shadow: 0 7px 22px rgba(34, 44, 80, .09);
    }

    .at-tools .at-tools-hero:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 26px rgba(34, 44, 80, .18);
    }

    .at-tools-nav-grid a:hover {
        background: #eaf0f9;
        border-color: #c3d1e4;
    }

    .at-tools .at-tools-back:hover {
        text-decoration: underline !important;
    }
}


/* =====================================================
   Мобільна адаптація
   ===================================================== */

@media (max-width: 600px) {

    .at-tools-grid,
    .at-tools-nav-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .at-tools .at-tools-hero {
        padding: 22px 18px;
        border-radius: 10px;
    }

    .at-tools-hero-label {
        font-size: 10px;
        letter-spacing: 1px;
    }

    .at-tools-hero p {
        font-size: 14px;
    }

    .at-tools-chart {
        height: 60px;
    }

    .at-tools-grid {
        gap: 10px;
    }

    .at-tools .at-tools-card {
        padding: 17px;
    }

    .at-tools .at-tools-card h3 {
        font-size: 16px;
    }

    .at-tools .at-tools-section-title {
        font-size: 19px;
    }

    .at-tools-nav {
        padding: 12px;
    }

    .at-tools.at-tools-nav h2 {
        font-size: 16px;
    }

    .at-tools-nav-grid {
        gap: 6px;
    }

    .at-tools-footer {
        text-align: center;
    }
}

/* Врахування системного налаштування анімацій */
@media (prefers-reduced-motion: reduce) {
    .at-tools a {
        transition: none !important;
        transform: none !important;
    }
}


/* Заголовки груп енергоінструментів */
.at-menu-heading {
    display: block !important;
    margin: 12px 10px 4px !important;
    padding: 14px 0 5px !important;

    border: 0 !important;
    border-top: 1px solid #dfe5ed !important;

    background: transparent !important;
    color: #8590a0 !important;

    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-transform: uppercase;

    cursor: default;
}

.at-menu-heading:hover {
    background: transparent !important;
    color: #8590a0 !important;
}


/* =====================================================
   АТ ЕЛЕКТРО — Помічник з підбору обладнання
   ===================================================== */

.at-category-intro {
    font-size: 14px;
    line-height: 1.65;
    color: #263244;
    margin-bottom: 20px;
}

.at-category-intro > p {
    margin: 0 0 12px;
}

.at-category-assistant {
    display: flex;
    align-items: center;
    gap: 16px;

    margin: 20px 0;
    padding: 18px;

    background: linear-gradient(
        120deg,
        #f4f7fb,
        #edf2f9
    );

    border: 1px solid #dce5f1;
    border-left: 3px solid #365f98;
    border-radius: 10px;
}

.at-category-assistant > .at-tools-icon {
    align-self: flex-start;
    background: #e0e8f5;
}

.at-category-assistant-body {
    flex: 1;
    min-width: 0;
}

.at-category-assistant-body h3 {
    margin: 0 0 6px;
    color: #222c50;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.at-category-assistant-body p {
    margin: 0 0 6px;
    color: #536175;
    font-size: 13px;
    line-height: 1.6;
}

.at-category-assistant-body small {
    color: #7c889a;
    font-size: 11px;
}

a.at-category-assistant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    padding: 11px 16px;

    background: #365f98;
    color: #fff !important;
    border: 1px solid #365f98;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;

    transition: background-color .2s ease,
                box-shadow .2s ease;
}

a.at-category-assistant-btn:hover {
    background: #222c50;
    border-color: #222c50;
    box-shadow: 0 3px 10px rgba(34,44,80,.15);
}

a.at-category-assistant-btn:focus-visible {
    outline: 3px solid #779dce;
    outline-offset: 3px;
}

/* Адаптація до вузьких екранів */

@media (max-width: 900px) {

    .at-category-assistant {
        flex-wrap: wrap;
    }

    .at-category-assistant-btn {
        margin-left: auto;
    }
}

@media (max-width: 600px) {

    .at-category-assistant {
        padding: 14px;
        gap: 12px;
    }

    .at-category-assistant-body h3 {
        font-size: 16px;
    }

    .at-category-assistant > .at-tools-icon {
        width: 36px;
        height: 36px;
    }

    a.at-category-assistant-btn {
        width: 100%;
        margin: 0;
        white-space: normal;
    }
}