/* Адаптация Tabler: навигация по-прежнему в верхней шапке. */
.lk-app .lk-navbar { background:var(--tblr-bg-surface,#fff); box-shadow:0 1px 4px rgba(0,0,0,.06); z-index:1030; }
.lk-app .lk-navbar .navbar-brand {font-weight:700;}
.lk-app .card {border:1px solid var(--tblr-border-color,#e6e7eb);border-radius:var(--tblr-border-radius-lg,10px);box-shadow:0 2px 9px rgba(12,27,49,.04)}
.lk-app .card-header {background:var(--tblr-bg-surface,#fff);}
.lk-app .table thead th {color:var(--tblr-secondary-color,#626976);font-size:.75rem;letter-spacing:.045em;text-transform:uppercase;}
.lk-app .table td {vertical-align:middle;}
.lk-app .btn-lk {background:var(--lk-accent,#b28a52);border-color:var(--lk-accent,#b28a52);color:white;}
.lk-app .btn-lk:hover{filter:brightness(.91);color:white;}
.lk-app .lk-sidebar {background:var(--tblr-bg-surface,#fff)}
.lk-app .lk-product-card {overflow:hidden}
.lk-app .nav-pills .nav-link.active{background:var(--lk-accent,#b28a52)}
.lk-file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:12px}
.lk-file-tile{border:1px solid var(--tblr-border-color,#dee2e6);border-radius:10px;overflow:hidden;cursor:pointer;background:var(--tblr-bg-surface,#fff);text-align:left;padding:8px;transition:border-color .15s,box-shadow .15s}
.lk-file-tile:hover,.lk-file-tile:focus{border-color:var(--lk-accent,#b28a52);box-shadow:0 0 0 2px rgba(178,138,82,.14)}
.lk-file-tile img{height:96px;width:100%;object-fit:contain;background:var(--tblr-bg-surface-secondary,#f6f8fa)}
.lk-file-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:7px;font-size:12px}
.lk-file-preview{max-width:100%;max-height:160px;object-fit:contain}
@media(max-width:767px){.lk-app .lk-navbar .container-fluid{flex-wrap:wrap;gap:8px}.lk-app .lk-navbar .d-flex{flex-wrap:wrap}}

/* v0.8.1 — реальные элементы навигации и административного UI Tabler. */
.lk-app .lk-navbar { background:var(--lk-header,var(--tblr-bg-surface,#fff)); border-bottom:1px solid var(--tblr-border-color,#e6e7eb); box-shadow:none; }
.lk-app .lk-nav-container { max-width:100%; padding-inline:1.5rem; }
.lk-app .lk-main-items .nav-link { padding: .85rem .8rem; font-size:.9rem; font-weight:500; border-bottom:2px solid transparent; }
.lk-app .lk-main-items .nav-link.active { border-bottom-color:var(--lk-accent,#206bc4); color:var(--lk-accent,#206bc4); }
.lk-app .lk-main-items .nav-link:hover { color:var(--lk-accent,#206bc4); }
.lk-app .dropdown-menu { box-shadow:var(--tblr-shadow-dropdown,0 8px 24px rgba(0,0,0,.1)); border-radius:9px; min-width:220px; }
.lk-app .dropdown-item { padding:.55rem .9rem; }
.lk-app .lk-page-content { min-height:calc(100vh - 64px); }
.lk-app .page-wrapper { min-height:calc(100vh - 64px); }
.lk-app .btn { font-weight:500; border-radius:var(--tblr-border-radius,6px); }
.lk-app .btn-primary { --tblr-btn-bg:var(--lk-accent,#206bc4); --tblr-btn-border-color:var(--lk-accent,#206bc4); }
.lk-app .card { box-shadow:var(--tblr-shadow-card,0 1px 2px rgba(0,0,0,.04)); }
.lk-app .table-responsive { border-radius:var(--tblr-border-radius,6px); }
.lk-app .modal-header { background:var(--tblr-bg-surface-secondary,#f8fafc); }
.lk-app .lk-cart-link { padding:.35rem .5rem; }
@media(max-width:767.98px) {
 .lk-app .lk-navbar .lk-nav-container { padding-inline:1rem; }
 .lk-app .lk-main-items .nav-link { border-bottom:0; padding:.7rem 0; }
 .lk-app #lkMainNav { order:3; flex-basis:100%; padding:.35rem 0 .75rem; }
 .lk-app .dropdown-menu { box-shadow:none; }
}

/* v0.8.2: единый Tabler-стиль витрины и администрирования. */
.lk-shop-layout .lk-catalog-panel {position:sticky;top:82px;max-height:calc(100vh - 100px);overflow:auto;}
.lk-shop-layout .lk-tree li {line-height:1.45;}
.lk-shop-layout .lk-tree a {display:block;padding:.35rem .55rem;border-radius:6px;}
.lk-shop-layout .lk-tree a:hover,.lk-shop-layout .lk-tree a.active{background:var(--tblr-primary-lt,#eef4ff);text-decoration:none;}
.lk-shop-layout .lk-product-card .card-body{padding:1rem;}
.lk-shop-layout .lk-product-card .card-title {line-height:1.5;}
.lk-shop-layout .lk-product-card{transition:transform .16s,box-shadow .16s;}
.lk-shop-layout .lk-product-card:hover{transform:translateY(-3px);box-shadow:0 7px 24px rgba(24,36,51,.12)!important;}
.lk-variants .table td,.lk-variants .table th{vertical-align:middle;}
@media(max-width:991.98px){.lk-shop-layout .lk-catalog-panel{position:static;max-height:none;}}

/* v0.8.3 — единая витрина Tabler, без ограничения ширины экрана. */
.lk-cat-list{list-style:none;margin:0;padding:0}.lk-cat-list-children{margin:2px 0 6px 13px;padding-left:9px;border-left:1px solid var(--tblr-border-color,#e6e7eb)}
.lk-tree .lk-cat-item{margin:2px 0}.lk-tree .lk-cat-link{display:flex;gap:9px;align-items:center;padding:10px 11px;border-radius:8px;color:var(--tblr-body-color,#25344a);text-decoration:none;line-height:1.35;font-size:.9rem;transition:background .12s ease,color .12s ease}
.lk-tree .lk-cat-link:hover{background:var(--tblr-bg-surface-secondary,#eef3fa);color:var(--tblr-primary,#206bc4)}
.lk-tree .lk-cat-link.active{background:var(--tblr-primary-lt,#e8f2ff);color:var(--tblr-primary,#206bc4);font-weight:600;box-shadow:inset 3px 0 var(--tblr-primary,#206bc4)}
.lk-tree .lk-cat-link.branch{color:var(--tblr-primary,#206bc4)}.lk-cat-icon{font-size:1rem;flex:none;color:var(--tblr-secondary,#667a96)}.lk-cat-link.active .lk-cat-icon{color:inherit}.lk-cat-chevron{font-size:.7rem;color:var(--tblr-secondary,#667a96)}
.lk-shop-layout .lk-catalog-panel .card-body{padding:12px!important}.lk-product-page .page-title{line-height:1.3}.lk-photo-stage{height:clamp(260px,30vw,520px);display:flex;align-items:center;justify-content:center;background:var(--tblr-bg-surface-secondary,#f8fafc);border-radius:10px;overflow:hidden}.lk-photo-stage img{display:block;width:100%;height:100%;object-fit:contain;padding:16px}.lk-photo-thumbs{display:flex;gap:9px;overflow-x:auto;padding:10px 1px 2px}.lk-photo-thumb{width:70px;height:70px;padding:4px;flex:0 0 70px;border:1px solid var(--tblr-border-color,#dce2ea);border-radius:8px;background:var(--tblr-bg-surface,#fff);cursor:pointer}.lk-photo-thumb:hover,.lk-photo-thumb.active{border-color:var(--tblr-primary,#206bc4);box-shadow:0 0 0 1px var(--tblr-primary,#206bc4)}.lk-photo-thumb img{width:100%;height:100%;object-fit:contain}.lk-variant-card .card-header{padding:1rem 1.25rem}.lk-product-variants thead th{white-space:nowrap}.lk-product-variants td{vertical-align:middle}.lk-product-order-form{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:nowrap}.lk-product-order-form .lk-quantity{width:78px;min-width:65px;flex:none}.lk-product-modal .lk-photo-stage{height:clamp(240px,30vw,400px)}.lk-product-modal .lk-variant-card{box-shadow:none}.lk-product-page .lk-catalog-panel{position:sticky;top:82px}
@media(max-width:1199.98px){.lk-product-page .lk-catalog-panel{position:static}.lk-product-page .lk-photo-stage{height:350px}}
@media(max-width:575.98px){.lk-product-order-form{flex-wrap:wrap}.lk-product-order-form .btn{white-space:nowrap}.lk-photo-stage{height:300px}}

/* v0.9.1: контраст кнопок Tabler и текста. Не подменяем фон без цвета текста. */
.lk-app .btn-primary,.lk-app .btn-primary:hover,.lk-app .btn-primary:focus,
.lk-app .btn-lk,.lk-app .btn-lk:hover,.lk-app .lk-readable-primary,
.lk-app .nav-pills .nav-link.active { color:#fff !important; }
.lk-app .btn-primary { background-color:var(--lk-accent,#206bc4) !important; border-color:var(--lk-accent,#206bc4) !important; }
.lk-app .btn-primary:hover {filter:brightness(.91)}
.lk-app .btn-outline-primary { color:var(--lk-accent,#206bc4); border-color:var(--lk-accent,#206bc4); background:transparent; }
.lk-app .btn-outline-primary:hover {color:#fff !important;background:var(--lk-accent,#206bc4)}
.lk-app .nav-pills .nav-link.active {background:var(--lk-accent,#206bc4) !important}
.lk-app .btn-outline-secondary {color:var(--tblr-body-color,#24344a)}
.lk-app #lkMediaDialog {max-height:45vh;overflow:auto}

/* v0.9.5: фильтры как единая Tabler Card и адаптация для телефонов. */
.lk-filter-card{border-radius:14px!important;overflow:hidden;background:var(--tblr-bg-surface,#fff)}
.lk-filter-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.lk-filter-heading .card-title{font-weight:650;font-size:1.05rem;margin:0}
.lk-search-line{display:flex;align-items:center;gap:.55rem;border:1px solid var(--tblr-border-color,#dce2e9);border-radius:9px;padding:0 .75rem;background:var(--tblr-bg-surface,#fff)}
.lk-search-line:focus-within{border-color:var(--tblr-primary,#206bc4);box-shadow:0 0 0 3px rgba(32,107,196,.11)}
.lk-search-line input{min-height:42px;width:100%}
.lk-filter-card .lk-filters-line{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) repeat(2,minmax(0,.73fr)) auto;gap:10px;align-items:end;overflow:visible}
.lk-filter-card .lk-filter-field{min-width:0;flex:initial}
.lk-filter-card .lk-filter-field .form-label{font-size:.78rem;font-weight:600;line-height:1.2;color:var(--tblr-secondary-color,#626976);margin-bottom:7px}
.lk-filter-card .form-control,.lk-filter-card .form-select{height:39px;min-width:0}
.lk-filter-card .lk-filter-reset{align-self:end}
.lk-filter-card .lk-filter-reset .btn{height:39px;min-width:39px}
.lk-results-heading{padding:.1rem .2rem}
@media(max-width:1199.98px) and (min-width:992px){.lk-filter-card .lk-filters-line{grid-template-columns:repeat(3,minmax(0,1fr))}.lk-filter-card .lk-filter-reset{justify-self:end}}
@media(max-width:991.98px){.lk-shop-layout{gap:.4rem!important}.lk-shop-layout .lk-catalog-panel{position:static;max-height:unset}.lk-filter-card .lk-filters-line{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.lk-filter-card .lk-filter-reset{grid-column:1/-1}.lk-filter-card .lk-filter-reset .btn{width:100%}.lk-filter-card .card-header{padding:.9rem 1rem 0}.lk-filter-card .card-body{padding:1rem}.lk-shop-heading{margin-top:.25rem}.lk-cat-list-children{margin-left:7px}}
@media(max-width:575.98px){.lk-shop-layout{padding-top:.6rem!important}.lk-shop-layout aside{padding-inline:0}.lk-shop-layout main{min-width:0}.lk-shop-layout .lk-filter-card{border-radius:12px!important}.lk-filter-card .lk-filters-line{grid-template-columns:repeat(2,minmax(0,1fr))}.lk-filter-card .lk-filter-field .form-label{white-space:normal}.lk-filter-card .lk-filter-heading .small{font-size:.75rem}.lk-shop-layout .lk-product-card .card-body{padding:.7rem}.lk-product-card .card-title{font-size:.88rem}.lk-product-image{aspect-ratio:1/1}.lk-product-page .lk-product-variants{overflow-x:auto}}

/* Общие хлебные крошки и наглядное состояние корзины. */
.lk-breadcrumbs{padding:12px 3px 3px; font-size:.82rem}
.lk-breadcrumbs .breadcrumb{background:transparent;}
.lk-cart-link{display:flex;align-items:center;gap:.45rem;padding:.45rem .7rem!important;border-radius:8px}
.lk-cart-has-items{color:#fff!important;background:#206bc4!important}
.lk-cart-has-items .bi{color:#fff}
.lk-cart-caption{font-weight:600}
@media(max-width:575px){.lk-cart-caption{font-size:.78rem}.lk-breadcrumbs{padding-top:8px}}

/* Таблицы DataTables: единое оформление и адаптивность. */
.dt-container .dt-layout-row {display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.75rem; padding: .8rem 1rem;}
.dt-container .dt-search input, .dt-container .dt-length select {border:1px solid var(--tblr-border-color,#dce1e7);border-radius:var(--tblr-border-radius,.375rem);padding:.35rem .65rem;background:var(--tblr-bg-surface,#fff);color:inherit;}
.dt-container .dt-paging .dt-paging-button {min-width:2rem;border-radius:.375rem!important;}
.dt-container table.dataTable thead th {white-space:nowrap;cursor:pointer;}
.dt-container table.dataTable td {vertical-align:middle;}
@media(max-width:767.98px){.dt-container .dt-layout-row {align-items:stretch;}.dt-container .dt-layout-cell {width:100%;}.dt-container .dt-search input {max-width:100%;width:100%;}.dt-container .dt-paging {overflow-x:auto;}}

/* Автономные стили: внешний CDN не требуется. */
.js-lk-server thead th[data-sort] {cursor:pointer;user-select:none;white-space:nowrap;}
.js-lk-server thead th[data-sort]:hover {color:#206bc4;background:#f1f6ff;}
.lk-server-controls {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px;}
.lk-server-controls input {max-width:300px;}
.lk-server-pager {display:flex;gap:8px;align-items:center;}
.lk-server-loading {opacity:.6;pointer-events:none;}
.bi {display:inline-block;min-width:1em;}

/* v0.10.1 — компактная шапка AJAX-таблиц внутри карточки */
.lk-table-card-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;border-bottom:1px solid #e5e7eb;background:#fff;padding:1rem 1.25rem;}
.lk-table-card-header .card-title{font-weight:600;font-size:1rem;}
.lk-table-card-header .lk-server-controls{padding:0;flex:1;justify-content:flex-end;}
.lk-table-card-header .lk-server-controls input{width:min(100%,320px);}
.js-lk-server{background:#fff;}
.js-lk-server th{background:#f8fafc;color:#52617a;font-weight:600;}
.lk-server-pager .btn{min-width:2.25rem;}
.bi>svg{display:inline-block;vertical-align:-.14em;width:1em;height:1em;}
@media(max-width:767.98px){.lk-table-card-header{align-items:stretch;}.lk-table-card-header .lk-server-controls{width:100%;justify-content:space-between;}.lk-table-card-header .lk-server-controls input{max-width:100%;flex:1;min-width:150px;}}

/* v0.10.2: локальные замены визуальных переменных Tabler */
:root {--tblr-primary:#206bc4;--tblr-primary-lt:#e8f2ff;--tblr-secondary:#667382;--tblr-bg-surface-secondary:#f1f5f9;}
.lk-app .badge.bg-secondary-lt{background-color:#e8edf3!important;color:#334155!important;border:1px solid #d3dce8;}
.lk-app .badge.bg-azure-lt{background-color:#e8f4ff!important;color:#1656a4!important;}
.lk-app .badge.bg-green-lt{background-color:#dff8e7!important;color:#17643b!important;}
.lk-app .badge.bg-yellow-lt{background-color:#fff4cb!important;color:#79530b!important;}
.lk-app .badge.bg-red-lt{background-color:#ffe5e7!important;color:#982333!important;}
.lk-app .badge.bg-secondary,.lk-app .badge.text-bg-secondary{background-color:#475569!important;color:white!important;}
.lk-app .lk-tree .lk-cat-link .lk-cat-icon{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;visibility:visible;opacity:1}
.lk-app .lk-tree .lk-cat-link .lk-cat-icon svg{width:17px;height:17px;stroke-width:1.8}
.js-lk-server thead th[data-sort]{position:relative;padding-right:1.7rem!important;}
.js-lk-server thead th[data-sort]::after{content:'⇅';position:absolute;right:.5rem;top:50%;transform:translateY(-50%);color:#64748b;font-size:14px;font-weight:700;}
.js-lk-server thead th[data-sort][aria-sort='ascending']::after{content:'↑';color:#206bc4;}
.js-lk-server thead th[data-sort][aria-sort='descending']::after{content:'↓';color:#206bc4;}
.lk-app .card{background:#fff;border:1px solid #e2e8f0;box-shadow:0 2px 7px rgba(30,41,59,.035)}

/* v0.10.9: логотип строго по центру всей шапки */
.lk-app .lk-navbar .lk-nav-container { position:relative; }
.lk-app .lk-navbar .lk-header-logo {
 position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
 display:flex;align-items:center;justify-content:center;
 width:min(17vw,240px);height:44px;z-index:1;
 pointer-events:auto;
}
.lk-app .lk-navbar .lk-header-logo img {display:block;max-width:100%;max-height:42px;width:auto;height:auto;object-fit:contain;}
/* На планшете и телефоне логотип переносится в собственную строку: без перекрытия кнопок. */
@media (max-width:1100px) {
 .lk-app .lk-navbar .lk-header-logo {position:relative;left:auto;top:auto;transform:none;order:4;flex:0 0 100%;width:100%;height:48px;margin:2px auto 4px;}
 .lk-app .lk-navbar .lk-header-logo img {max-height:44px;max-width:240px;}
 .lk-app .lk-navbar .lk-nav-container {flex-wrap:wrap;}
}

/* v0.11.0: контролируемое оформление логотипа из параметров администратора. */
.lk-app .lk-navbar .lk-header-logo {
 width:var(--lk-logo-width,220px);
 height:var(--lk-logo-height,42px);
 left:calc(50% + var(--lk-logo-x,0px));
 top:calc(50% + var(--lk-logo-y,0px));
}
.lk-app .lk-navbar .lk-header-logo img {
 width:100%;height:100%;max-width:none;max-height:none;
 object-fit:var(--lk-logo-fit,contain);
}
@media(max-width:1100px){
 .lk-app .lk-navbar .lk-header-logo {
  left:auto;top:auto;transform:translate(var(--lk-logo-x,0px),var(--lk-logo-y,0px));
  width:100%;height:var(--lk-logo-mobile-height,42px);
 }
 .lk-app .lk-navbar .lk-header-logo img {
  width:var(--lk-logo-mobile-width,180px);height:var(--lk-logo-mobile-height,42px);
  max-height:none;max-width:none;
 }
}


/* v0.11.8. Шапка: без текстового бренда; логотип центрируется только в свободной области. */
@media (min-width: 1101px) {
  .lk-app .lk-navbar .lk-nav-container {
    display:flex; flex-wrap:nowrap; align-items:center; gap:0;
  }
  .lk-app .lk-navbar #lkMainNav {
    order:1; flex:0 1 auto; width:auto; min-width:0;
  }
  .lk-app .lk-navbar .lk-main-items {margin-left:0!important; flex-wrap:nowrap;}
  .lk-app .lk-navbar .lk-header-logo {
    order:2; position:relative; left:auto; top:auto;
    transform:translate(var(--lk-logo-x,0px),var(--lk-logo-y,0px));
    flex:1 1 0; min-width:0; width:auto;
    height:var(--lk-logo-height,42px);
    display:flex; align-items:center; justify-content:center;
    overflow:hidden; margin:0 12px; pointer-events:auto;
  }
  .lk-app .lk-navbar .lk-header-logo img {
    width:min(100%,var(--lk-logo-width,220px));
    height:var(--lk-logo-height,42px); object-fit:var(--lk-logo-fit,contain);
    max-width:100%; max-height:100%;
  }
  .lk-app .lk-navbar .navbar-nav.order-md-last {order:3!important; flex:0 0 auto; margin-left:0!important;}
  .lk-app .lk-navbar .navbar-toggler {order:4;}
}
@media (max-width:1100px) {
  .lk-app .lk-navbar .lk-header-logo {
    order:4; position:relative; left:auto; top:auto;
    transform:translate(var(--lk-logo-x,0px),var(--lk-logo-y,0px));
    margin:0; flex:0 0 100%; width:100%;
    height:var(--lk-logo-mobile-height,42px);
  }
  .lk-app .lk-navbar .lk-header-logo img {
    width:min(100%,var(--lk-logo-mobile-width,180px));
    height:var(--lk-logo-mobile-height,42px);
    object-fit:var(--lk-logo-fit,contain);
  }
}

/* v0.12.3: одиночная покупка без вариантов — в одну строку, без лишнего заголовка. */
.lk-single-purchase{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:nowrap}
.lk-single-purchase .lk-single-price{flex:1 1 auto}
.lk-product-order-form--single{flex:0 0 auto;justify-content:flex-end}
.lk-product-order-form--single .btn{white-space:nowrap}

@media(max-width:575.98px){
 .lk-single-purchase{gap:.75rem}
 .lk-product-order-form--single{flex-wrap:nowrap}
}

/* v0.12.7: выбор нескольких изображений непосредственно в карточке */
.lk-selected-photos{display:flex;flex-wrap:wrap;gap:10px}
.lk-selected-photo{display:flex;flex-direction:column;align-items:center;gap:4px;width:112px;padding:7px;border:1px solid #dbe2eb;border-radius:9px;background:white}
.lk-selected-photo img{height:85px;width:100%;object-fit:contain}
.lk-selected-photo small{color:#52647a;font-weight:600}
.lk-selected-photo .btn{width:100%}

/* v0.12.8 — явное состояние галереи, хорошо видное при прокрутке. */
.lk-attachments-card{border:1px solid #c8d7f0;border-radius:10px;padding:12px;background:#f4f8ff}
.lk-attachments-title{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.lk-attachments-card .lk-selected-photos:empty::before{content:'Пока нет прикреплённых фотографий — выберите их в библиотеке.';color:#68778c;font-size:.875rem}
.lk-attachments-card .lk-selected-photo{border:2px solid #4471c3;background:#fff;width:120px;box-shadow:0 1px 6px rgba(40,83,157,.12)}
.lk-attachments-card .lk-selected-photo:first-child{border-color:#16815d;background:#f0fff8}
.lk-library-selection-bar{position:sticky;top:0;z-index:3;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;margin-bottom:12px;border:1px solid #bfd1ee;border-radius:9px;background:#ecf4ff}
.lk-library-selection-bar .btn{margin-left:auto}
.lk-file-tile{position:relative}
.lk-file-tile--selected{border:3px solid #16815d!important;background:#eafff2!important;box-shadow:0 0 0 2px rgba(22,129,93,.15)}
.lk-file-choice-marker{display:block;padding:3px 4px;text-align:center;font-size:.72rem;line-height:1.3;font-weight:600;color:#64748b}
.lk-file-tile--selected .lk-file-choice-marker{color:#0a724d}
