/* SIM 2026-11-26: залепващ филтър „Марка“ на категорийните страници.
   Включва се от templates/browse/list.tpl; елементите ги създава js/sim-sticky.js.
   След промяна тук вдигнете ?v= в list.tpl (Cloudflare пази файла 30 дни). */

/* ---------- телефон: плаващ бутон горе ---------- */
.sim-pill {
    position: fixed; left: 50%; top: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 99990;
    display: flex; white-space: nowrap; background: #1c1c1e; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
    transform: translate(-50%, -200%); visibility: hidden; transition: transform .22s, visibility 0s .22s;
}
.sim-pill.sim-show { transform: translate(-50%, 0); visibility: visible; transition: transform .22s; }
.sim-pill button { background: none; border: 0; margin: 0; color: #fff; padding: 14px 16px; font: 700 13px/1 Roboto, Arial, sans-serif; cursor: pointer; }
.sim-pill button + button { border-left: 1px solid rgba(255,255,255,.18); }
.sim-pill .sim-cnt { color: #fcaf17; }
.sim-dot { display: inline-block; background: #fcaf17; color: #222; border-radius: 99px; padding: 1px 7px; margin: -2px 0 -2px 6px; font-size: 11px; }

/* ---------- телефон: панел отдолу ---------- */
html.sim-lock, html.sim-lock body { overflow: hidden; }
.sim-shade { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483000; background: rgba(0,0,0,.45); touch-action: none; }
.sim-sheet {
    display: none; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483001; max-height: 82%;
    background: #fff; border-radius: 20px 20px 0 0; font-family: Roboto, Arial, sans-serif; color: #222;
}
.sim-open .sim-shade { display: block; }
.sim-open .sim-sheet { display: flex; }
.sim-sheet button { background: none; border: 0; margin: 0; font-family: inherit; color: #222; cursor: pointer; }
.sim-sh-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; font: 700 17px Rubik, Arial, sans-serif; }
.sim-sheet .sim-x { font-size: 28px; line-height: 1; color: #888; padding: 0 4px; }
.sim-sheet .sim-sh-s { display: block; flex: 0 0 auto; margin: 0 12px 8px; padding: 10px 12px; border: 1.5px solid #e6e8ec; border-radius: 12px; font-size: 16px; line-height: 1.2; }
.sim-sh-b { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 12px 12px; min-height: 0; }
.sim-tiles { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; gap: 8px; }
.sim-sheet .sim-tile { display: flex; justify-content: space-between; align-items: center; height: 44px; min-width: 0; padding: 0 11px; border: 1.5px solid #e6e8ec; border-radius: 12px; font-size: 13px; }
.sim-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-tile small { font-weight: 700; color: #999; margin-left: 6px; font-size: 12px; }
.sim-sheet .sim-tile.sim-on { border-color: #fcaf17; background: #fff4e1; font-weight: 700; }
.sim-sheet .sim-tile.sim-all { grid-column: 1 / -1; }
.sim-sheet .sim-sortrow { display: block; width: 100%; text-align: left; padding: 15px 6px; border-bottom: 1px solid #e6e8ec; font-size: 15px; }
.sim-sheet .sim-sortrow.sim-on { color: #ce8113; font-weight: 700; }
.sim-sh-f { display: flex; padding: 10px 12px 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e6e8ec; }
.sim-sheet .sim-clr { height: 46px; padding: 0 14px; margin-right: 8px; color: #666; font-size: 14px; }
.sim-sheet .sim-go { flex: 1; height: 46px; background: #fcaf17; color: #fff; border-radius: 12px; font-weight: 700; font-size: 15px; }

/* ---------- компютър: залепена лява колона ---------- */
.sim-extra, .sim-bsearch { display: none; }

@media screen and (min-width: 1000px) {
    .sim-pill, .sim-shade, .sim-sheet { display: none !important; }

    /* overflow:hidden на .site-wrapper пречи на залепването; clip + flow-root изрязва и подрежда по същия начин */
    html.sim-sticky .site-wrapper { overflow: clip; display: flow-root; }

    .sim-stick { position: -webkit-sticky; position: sticky; top: 12px; display: flow-root; width: 200px; }
    .sim-stick.sim-stuck .widget { margin-bottom: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
    .sim-stick.sim-stuck .sim-extra { display: block; }

    .sim-bsearch { display: block; padding: 8px 10px 4px; background: #fff; }
    .sim-bsearch input { display: block; width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1.5px solid #e6e8ec; border-radius: 9px; font: 13px Roboto, Arial, sans-serif; }

    .sim-box { background: #fff; border-radius: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-bottom: 10px; padding: 10px 12px; font-size: 13px; color: #666; }
    .sim-box button { font-family: Roboto, Arial, sans-serif; cursor: pointer; }
    .sim-sel { display: flex; flex-wrap: wrap; align-items: center; max-height: 76px; overflow-y: auto; }
    .sim-sel .sim-total { margin: 3px 8px 3px 0; white-space: nowrap; }
    .sim-sel .sim-total b { color: #222; }
    .sim-box .sim-chip { margin: 3px 6px 3px 0; padding: 4px 9px; background: #fff4e1; border: 1px solid #fcaf17; border-radius: 99px; font-size: 12px; font-weight: 700; color: #222; }
    .sim-price .ui-slider { margin: 12px 11px 14px; }
    .sim-price .ui-slider-handle { box-shadow: 0 1px 6px rgba(0,0,0,.35); }
    .sim-fromto { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: grey; }
    .sim-fromto b { color: #ce8113; }
    .sim-sorts { display: flex; flex-wrap: wrap; padding: 8px 6px 2px 10px; }
    .sim-box .sim-sort { margin: 0 6px 6px 0; padding: 7px 9px; background: #fff; border: 1.5px solid #e6e8ec; border-radius: 10px; font-size: 12px; color: #333; }
    .sim-box .sim-sort.sim-on { border-color: #fcaf17; background: #fff4e1; font-weight: 700; }
}
@media screen and (min-width: 1210px) { .sim-stick { width: 240px; } }
@media screen and (min-width: 1440px) { .sim-stick { width: 285px; } }
@media screen and (max-width: 999px) { .sim-stick { width: auto; } }
