/* DS Catalog Pro: filter drawer, active chips, infinite-scroll loader, product back bar.
   Look: ink #0a111f + sky #7dd3fc, pill controls, 1px hairlines (see design-lux). Rules use :not(#x) chains where ds-lux/ds-skin fight back. */

/* ---- old client-side drawer and its triggers are replaced ---- */
html body #ds-open-filter-drawer-btn,
html body .tbay-filter .button-filter-mobile,
html body #ds-smart-filter-backdrop,
html body #ds-smart-category-filters:not([data-dscp]) { display: none !important; }

/* ---- trigger button ---- */
.dscp-open {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid #0a111f; background: #0a111f; color: #bae6fd;
  font: 800 15px/1 Heebo, system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.dscp-open:hover { background: #12203a; }
.dscp-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #7dd3fc; color: #0a111f;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.dscp-bar { display: flex; justify-content: flex-start; margin: 12px 0; }

/* ---- drawer ---- */
.dscp-backdrop { position: fixed; inset: 0; z-index: 100000; background: rgba(10, 17, 31, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.dscp-backdrop.is-open { opacity: 1; pointer-events: auto; }
.dscp-drawer {
  position: fixed; z-index: 100001; background: #fff; color: #0a111f; direction: rtl; display: flex; flex-direction: column;
  font-family: Heebo, system-ui, sans-serif; box-shadow: 0 24px 60px rgba(10, 17, 31, .35);
  top: 0; bottom: 0; right: 0; width: min(440px, 100vw); transform: translateX(105%); transition: transform .25s ease;
}
.dscp-drawer.is-open { transform: none; }
.dscp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e2e8f0; }
.dscp-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; }
.dscp-x { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #0a111f; cursor: pointer; }
.dscp-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; -webkit-overflow-scrolling: touch; }
.dscp-group { border-bottom: 1px solid #eef2f6; }
.dscp-group-h { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 0; font-size: 16px; font-weight: 800; cursor: pointer; }
.dscp-group-h::-webkit-details-marker { display: none; }
.dscp-group-h svg { transition: transform .2s; color: #64748b; }
.dscp-group[open] .dscp-group-h svg { transform: rotate(180deg); }
.dscp-n { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; background: #0a111f; color: #7dd3fc; font-size: 12px; align-items: center; justify-content: center; }
.dscp-opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; }
.dscp-opt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #0a111f; font: 600 15px/1 Heebo, system-ui, sans-serif; cursor: pointer;
}
.dscp-opt:hover { border-color: #0a111f; }
.dscp-opt.is-on { background: #0a111f; border-color: #0a111f; color: #bae6fd; }
.dscp-opt-n { font-size: 12px; font-weight: 700; color: #64748b; }
.dscp-opt.is-on .dscp-opt-n { color: #7dd3fc; }
.dscp-extra { display: none; }
.dscp-expanded .dscp-extra { display: inline-flex; }
.dscp-more { min-height: 40px; padding: 0 14px; border: 0; background: none; color: #0369a1; font: 700 14px/1 Heebo, system-ui, sans-serif; cursor: pointer; }
.dscp-foot { display: flex; gap: 10px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #e2e8f0; background: #fff; }
.dscp-apply { flex: 1; min-height: 50px; border: 0; border-radius: 999px; background: #0a111f; color: #bae6fd; font: 800 16px/1 Heebo, system-ui, sans-serif; cursor: pointer; }
.dscp-apply:disabled { opacity: .5; cursor: not-allowed; }
.dscp-reset { min-height: 50px; padding: 0 18px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #0a111f; font: 700 15px/1 Heebo, system-ui, sans-serif; cursor: pointer; }
.dscp-loading, .dscp-err { padding: 28px 4px; text-align: center; color: #475569; font-size: 15px; }
html.dscp-lock, html.dscp-lock body { overflow: hidden !important; }
@media (max-width: 767px) {
  .dscp-drawer { top: auto; left: 0; right: 0; width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 22px 22px 0 0; transform: translateY(105%); }
  .dscp-drawer.is-open { transform: none; }
}

/* ---- active filters (server rendered) ---- */
.dscp-active {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 12px 14px; direction: rtl;
  background: rgba(255, 255, 255, .96); border: 1px solid #e2e8f0; border-radius: 18px; font-family: Heebo, system-ui, sans-serif;
}
.dscp-active-count { font-weight: 800; font-size: 15px; margin-inline-end: 4px; }
.dscp-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px;
  background: #0a111f; color: #bae6fd !important; font-size: 14px; font-weight: 700; text-decoration: none !important;
}
.dscp-chip-k { color: #7dd3fc; font-weight: 600; }
.dscp-clear { margin-inline-start: auto; color: #0369a1 !important; font-weight: 700; font-size: 14px; text-decoration: underline; }

/* ---- infinite scroll: the button stays in the DOM (the theme script clicks it) but is invisible ---- */
.ds-load-more-wrap.dscp-auto .ds-load-more-btn {
  position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; opacity: 0 !important; border: 0 !important; pointer-events: none !important;
}
.ds-load-more-wrap.dscp-auto { min-height: 56px; }
.ds-load-more-wrap.dscp-auto.dscp-busy::before {
  content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #bae6fd; border-top-color: #0a111f;
  animation: dscp-spin .8s linear infinite;
}
@keyframes dscp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ds-load-more-wrap.dscp-auto.dscp-busy::before { animation-duration: 2s; } }
.dscp-restore {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 99990; padding: 10px 18px; border-radius: 999px;
  background: #0a111f; color: #bae6fd; font: 700 14px/1 Heebo, system-ui, sans-serif; box-shadow: 0 10px 30px rgba(10, 17, 31, .3);
}

/* ---- product page back bar ---- */
.dscp-back { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 14px; direction: rtl; font-family: Heebo, system-ui, sans-serif; position: relative; z-index: 2; }
.dscp-back-link, .dscp-back-cat {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid #cbd5e1; background: rgba(255, 255, 255, .96); color: #0a111f !important; font-size: 15px; font-weight: 700; text-decoration: none !important;
}
.dscp-back-link { background: #0a111f; border-color: #0a111f; color: #bae6fd !important; }
@media (min-width: 992px) { .dscp-back { margin: 16px auto; max-width: 1320px; } }

.dscp-empty { flex-basis: 100%; color: #475569; font-size: 14px; }
