/* AKB 2026-11-17: шапка каталога — теги (быстрые ссылки) и строка сортировки.
   Всё выровнено по левому и правому краю сетки товаров. Переписано начисто вместо слоёв правок от 16.11. */

/* ---------- теги ---------- */
#content .module-tile.tile-main { position: relative; margin: 0 0 18px !important; padding: 0 !important; border: 0; background: none; box-shadow: none; }
#content .module-tile .tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 !important; padding: 0 !important; max-height: none; overflow: hidden; }
#content .module-tile .tiles > a {
    display: inline-flex; align-items: center; height: 36px; margin: 0 !important; padding: 0 15px !important;
    border: 1px solid #e3e7ed !important; border-radius: 999px !important; background: #fff; color: #142b45 !important;
    font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none !important;
    transition: border-color .15s, color .15s, background-color .15s;
}
#content .module-tile .tiles > a:hover { border-color: #2787f5 !important; background: #f5f9ff; color: #2787f5 !important; }
#content .module-tile .tiles > a[href=""] { display: none !important; } /* теги без ссылки в настройках модуля */
#content .module-tile .button_tiles { display: none !important; }
#content .module-tile .akb-tiles-more { display: none; }
@media (min-width: 768px) {
    #content .module-tile.akb-tiles-fold .tiles { max-height: 36px; padding-right: 130px !important; }
    #content .module-tile.akb-tiles-fold.akb-open .tiles { max-height: none; padding-right: 0 !important; }
    #content .module-tile.akb-tiles-fold .akb-tiles-more {
        display: inline-flex; align-items: center; gap: 6px; position: absolute; right: 0; top: 0; height: 36px; padding: 0 2px 0 30px;
        border: 0; background: linear-gradient(90deg, rgba(255,255,255,0), #fff 26px); color: #2787f5; font-size: 14px; font-weight: 600; cursor: pointer;
    }
    #content .module-tile.akb-tiles-fold .akb-tiles-more::after {
        content: ''; width: 7px; height: 7px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s;
    }
    #content .module-tile.akb-tiles-fold.akb-open .akb-tiles-more { position: static; margin-top: 10px; padding-left: 0; background: none; }
    #content .module-tile.akb-tiles-fold.akb-open .akb-tiles-more::after { transform: rotate(-135deg); margin-top: 3px; }
}
@media (max-width: 767px) {
    #content .module-tile.tile-main { margin: 0 0 14px !important; }
    #content .module-tile .tiles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    #content .module-tile .tiles::-webkit-scrollbar { display: none; }
    #content .module-tile .tiles > a { flex: 0 0 auto; height: 38px; }
}

/* ---------- строка сортировки ---------- */
#content .akb-sortbar.well.well-sm {
    margin: 0 0 16px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
}
#content .akb-sortbar > .row { display: flex !important; align-items: center !important; justify-content: flex-end !important; flex-wrap: nowrap !important; gap: 16px !important; margin: 0 !important; }
#content .akb-sortbar > .row::before, #content .akb-sortbar > .row::after { content: none !important; display: none !important; }
#content .akb-sortbar > .row > [class*="col-"] {
    display: flex !important; align-items: center; gap: 10px; float: none !important; width: auto !important; max-width: none !important;
    flex: 0 0 auto !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; background: none !important;
}
#content .akb-sortbar > .row > .hidden-xs { margin-right: auto !important; }

/* переключатель вида: сетка / список */
#content .akb-sortbar .btn-group-justified {
    display: inline-flex !important; width: auto !important; height: auto !important; gap: 2px !important; margin: 0 !important; padding: 3px !important;
    border: 1px solid #e6e9ef !important; border-radius: 12px !important; background: #fff !important; box-shadow: none !important; table-layout: auto !important;
}
#content .akb-sortbar .btn-group-justified > .btn-group { display: block !important; float: none !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
#content .akb-sortbar .btn-group-justified > .btn-group[style*="display:none"], #content .akb-sortbar .btn-group-justified > .btn-group[style*="display: none"] { display: none !important; }
#content .akb-sortbar .btn-group-justified .btn {
    display: flex !important; align-items: center !important; justify-content: center !important; flex: none !important;
    width: 36px !important; height: 34px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
    border: 0 !important; border-radius: 9px !important; background: transparent !important; box-shadow: none !important; color: #8a94a6 !important;
    transition: background-color .15s, color .15s;
}
#content .akb-sortbar .btn-group-justified .btn .fa { margin: 0 !important; font-size: 16px !important; line-height: 1 !important; position: static !important; }
#content .akb-sortbar .btn-group-justified .btn:hover { color: #142b45 !important; }
#content .akb-sortbar .btn-group-justified .btn.active { background: #eef5ff !important; color: #2787f5 !important; }

/* сортировка и «показывать по» */
#content .akb-sortbar .input-group { display: flex !important; align-items: center !important; width: auto !important; margin: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
#content .akb-sortbar .input-group::after { content: none !important; display: none !important; }
#content .akb-sortbar .input-group-addon { display: none !important; }
#content .akb-sortbar select.form-control {
    display: block !important; width: auto !important; max-width: 100% !important; height: 40px !important; min-height: 40px !important; margin: 0 !important;
    padding: 0 36px 0 14px !important; border: 1px solid #e6e9ef !important; border-radius: 10px !important; box-shadow: none !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23142b45' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center !important;
    color: #142b45 !important; font-size: 14.5px !important; font-weight: 500 !important; line-height: 38px !important;
    -webkit-appearance: none !important; appearance: none !important; cursor: pointer !important; transition: border-color .15s, box-shadow .15s;
}
#content .akb-sortbar select.form-control:hover { border-color: #c5ccd7 !important; }
#content .akb-sortbar select.form-control:focus { border-color: #2787f5 !important; box-shadow: 0 0 0 3px rgba(39, 135, 245, .15) !important; outline: 0 !important; }
@media (min-width: 768px) {
    #content .akb-sortbar > .row > [class*="col-"]:has(#input-sort)::before { content: 'Сортировка'; color: #8a94a6; font-size: 14px; white-space: nowrap; }
    #content .akb-sortbar > .row > [class*="col-"]:has(#input-limit)::before { content: 'Показывать по'; color: #8a94a6; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 767px) {
    #content .akb-sortbar.well.well-sm { margin-bottom: 12px !important; }
    #content .akb-sortbar > .row { gap: 10px !important; }
    #content .akb-sortbar > .row > .hidden-xs { display: none !important; }
    #content .akb-sortbar > .row > [class*="col-"]:has(#input-sort) { flex: 1 1 auto !important; }
    #content .akb-sortbar > .row > [class*="col-"]:has(#input-sort) .input-group,
    #content .akb-sortbar #input-sort { width: 100% !important; }
    #content .akb-sortbar select.form-control { height: 44px !important; min-height: 44px !important; line-height: 42px !important; font-size: 15px !important; }
}
