﻿/* ==========================================================================
   The watch grid's controls (Default.aspx), modern look.
   The left hand Refine column dissolves (display: contents): its quick bar
   (search, brand, model, Filters) runs across the top, its panel slides in
   from the right on every screen size, and the sell block becomes a banner
   under the watches. The cards themselves are untouched (Site.css).
   Colours and fonts come from the reseller's theme variables.
   ========================================================================== */

/* classic look: the original left hand column, search kept below brand and model as it always was */
body:not(.rs-modern) .rs-quick { display: flex; flex-direction: column; }
body:not(.rs-modern) .rs-quick-search { order: 3; }

body.rs-modern .rs-shop { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 0; }
body.rs-modern .rs-shop > .rs-refine:not([style*="none"]) { display: contents !important; }
body.rs-modern .rs-shop > .rs-shop-main { grid-row: 2; width: 100%; max-width: none; }

/* ---------- quick bar ---------- */
body.rs-modern .rs-quick {
  grid-row: 1; display: flex; align-items: center; gap: .55rem; margin: 0 0 1.4rem; padding: .55rem;
  background: var(--rs-surface); border: 1px solid var(--rs-line); border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 18px 40px -30px rgba(0, 0, 0, .35);
}
body.rs-modern .rs-quick > .mb-3 { margin: 0 !important; min-width: 0; }
body.rs-modern .rs-quick .form-label {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body.rs-modern .rs-quick-search { flex: 1 1 auto; }
body.rs-modern .rs-quick-brand, body.rs-modern .rs-quick-model { flex: 0 0 auto; width: clamp(150px, 16vw, 210px); }

body.rs-modern .rs-quick .input-group { position: relative; flex-wrap: nowrap; }
body.rs-modern .rs-quick .input-group::before {
  content: ""; position: absolute; left: 1.05rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; z-index: 4; pointer-events: none;
  background: var(--rs-muted); -webkit-mask: var(--rs-q-ico) center / contain no-repeat; mask: var(--rs-q-ico) center / contain no-repeat;
  --rs-q-ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.6-3.6'/></svg>");
}
body.rs-modern .rs-quick .input-group .form-control {
  height: 48px; padding: 0 1rem 0 2.9rem; border: 0 !important; border-radius: 999px !important; background: var(--rs-soft);
  font-size: .95rem; box-shadow: none !important;
}
body.rs-modern .rs-quick .input-group .form-control:focus { background: var(--rs-body-bg); box-shadow: 0 0 0 3px rgba(var(--rs-primary-rgb), .16) !important; }
body.rs-modern .rs-quick .input-group .btn {
  position: absolute; right: 5px; top: 5px; bottom: 5px; z-index: 5; padding: 0 1.15rem !important; border-radius: 999px !important;
  font-size: .82rem; box-shadow: none !important;
}
body.rs-modern .rs-quick .input-group .btn:hover { transform: none; }

body.rs-modern .rs-quick .form-select {
  height: 48px; padding: 0 2.4rem 0 1.1rem; border: 1px solid transparent !important; border-radius: 999px !important;
  background-color: var(--rs-soft); font-size: .9rem; font-weight: 600; color: var(--rs-body-fg); box-shadow: none !important; cursor: pointer;
  text-overflow: ellipsis;
}
body.rs-modern .rs-quick .form-select:hover { border-color: var(--rs-line-2) !important; }
body.rs-modern .rs-quick .form-select:focus { border-color: var(--rs-primary) !important; box-shadow: 0 0 0 3px rgba(var(--rs-primary-rgb), .16) !important; }

body.rs-modern .rs-filter-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5rem; height: 48px; padding: 0 1.15rem; margin: 0;
  border: 1px solid var(--rs-line-2); border-radius: 999px; background: var(--rs-surface); color: var(--rs-body-fg);
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: border-color .2s, background-color .2s;
}
body.rs-modern .rs-filter-btn:hover { border-color: var(--rs-primary); background: var(--rs-tint); }
body.rs-modern .rs-filter-btn svg { width: 19px; height: 19px; }
body.rs-modern .rs-filter-count {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px;
  background: var(--rs-primary); color: var(--rs-on-primary); font-size: .72rem; font-weight: 800;
}

/* ---------- toolbar: count and sort ---------- */
body.rs-modern .rs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .9rem; min-height: 0; }
body.rs-modern .rs-toolbar .rs-pagecount { display: none !important; }
body.rs-modern .rs-result-count { font-size: .95rem; color: var(--rs-muted); }
body.rs-modern .rs-result-count b { color: var(--rs-body-fg); font-weight: 800; }
body.rs-modern .rs-sort { display: inline-flex; align-items: center; gap: .55rem; }
body.rs-modern .rs-sort label { margin: 0; font-size: .85rem; color: var(--rs-muted); white-space: nowrap; }
body.rs-modern .rs-sort .form-select {
  width: auto; height: 40px; padding: 0 2.3rem 0 .95rem; border: 1px solid var(--rs-line-2); border-radius: 999px;
  background-color: var(--rs-surface); font-size: .88rem; font-weight: 600; color: var(--rs-body-fg); box-shadow: none; cursor: pointer;
}
body.rs-modern .rs-sort .form-select:focus { border-color: var(--rs-primary); box-shadow: 0 0 0 3px rgba(var(--rs-primary-rgb), .16); }

/* ---------- active filter chips ---------- */
body.rs-modern .rs-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 1.2rem; }
body.rs-modern .rs-active-chip {
  display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .55rem 0 .9rem; margin: 0;
  border: 1px solid color-mix(in srgb, var(--rs-primary) 35%, transparent); border-radius: 999px; background: var(--rs-tint);
  color: var(--rs-body-fg); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: background-color .2s, border-color .2s;
}
body.rs-modern .rs-active-chip i {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 1rem; line-height: 1;
  background: color-mix(in srgb, var(--rs-primary) 16%, transparent); color: var(--rs-primary);
}
body.rs-modern .rs-active-chip:hover { border-color: var(--rs-primary); }
body.rs-modern .rs-active-chip:hover i { background: var(--rs-primary); color: var(--rs-on-primary); }
body.rs-modern .rs-clear-all { padding: 0 .4rem; border: 0; background: none; color: var(--rs-muted); font: inherit; font-size: .84rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body.rs-modern .rs-clear-all:hover { color: var(--rs-body-fg); }

/* ---------- the filters panel: slides in from the right on every screen ---------- */
body.rs-modern .rs-refine-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; display: flex; flex-direction: column; width: min(430px, 94vw);
  background: var(--rs-surface); box-shadow: -30px 0 70px rgba(0, 0, 0, .22); transform: translateX(104%); visibility: hidden;
  transition: transform .34s var(--rs-ease), visibility 0s linear .34s;
}
body.rs-modern.rs-drawer-open .rs-refine-panel { transform: translateX(0); visibility: visible; transition: transform .34s var(--rs-ease), visibility 0s; }
body.rs-modern .rs-refine-panel .rs-refine-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--rs-line); }
body.rs-modern .rs-refine-panel .rs-refine-head h2 { margin: 0; font-size: 1.25rem; }
body.rs-modern .rs-refine-panel .rs-refine-head h2::before { display: none; }
body.rs-modern .rs-refine-panel .rs-refine-close {
  display: grid !important; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: var(--rs-soft); color: var(--rs-body-fg); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
body.rs-modern .rs-refine-panel .rs-refine-close:hover { background: var(--rs-tint); }

body.rs-modern .rs-refine-panel .accordion { flex: 1 1 auto; overflow-y: auto; margin: 0 !important; padding: .2rem 1.5rem .8rem; border: 0; scrollbar-width: thin; }
body.rs-modern .rs-refine-panel .accordion-item { border: 0; border-bottom: 1px solid var(--rs-line); padding: 0; background: transparent; }
body.rs-modern .rs-refine-panel .accordion-item:last-child { border-bottom: 0; }
/* each group folds to one row: its name, how many are ticked, a chevron */
body.rs-modern .rs-refine-panel .accordion-button {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .95rem 0; background: none !important; box-shadow: none !important; cursor: pointer;
  font-family: var(--rs-font-heading); font-size: .95rem !important; font-weight: 700; letter-spacing: -.01em; text-transform: none; color: var(--rs-body-fg) !important;
}
body.rs-modern .rs-refine-panel .accordion-button::after {
  content: ""; display: block; flex: none; width: 8px; height: 8px; margin: -4px 2px 0 auto; background: none !important;
  border-right: 2px solid var(--rs-muted); border-bottom: 2px solid var(--rs-muted); transform: rotate(45deg); transition: transform .2s var(--rs-ease), margin .2s;
}
body.rs-modern .rs-refine-panel .accordion-item.is-open .accordion-button::after { transform: rotate(225deg); margin-top: 4px; }
body.rs-modern .rs-refine-panel .rs-acc-count {
  display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 999px;
  background: var(--rs-primary); color: var(--rs-on-primary); font-family: var(--rs-font-body); font-size: .7rem; font-weight: 800;
}
body.rs-modern .rs-refine-panel .accordion-collapse { display: none !important; height: auto !important; }
body.rs-modern .rs-refine-panel .accordion-item.is-open .accordion-collapse { display: block !important; }
body.rs-modern .rs-refine-panel .accordion-body { padding: 0 0 1rem; }
body.rs-modern .rs-refine-panel .accordion-item:has(.chkChoice:empty), body.rs-modern .rs-refine-panel .accordion-item:not(:has(input)) { display: none; }

/* checkbox lists (rendered as tables) become small tap chips, eight at a time */
body.rs-modern .rs-refine-panel table.chkChoice, body.rs-modern .rs-refine-panel table.chkChoice tbody { display: flex; flex-wrap: wrap; gap: .35rem; width: 100%; }
body.rs-modern .rs-refine-panel table.chkChoice tr { display: contents; }
body.rs-modern .rs-refine-panel table.chkChoice td { display: block; position: relative; padding: 0 !important; }
body.rs-modern .rs-refine-panel table.chkChoice.is-clipped tr:nth-child(n+9):not(:has(input:checked)) { display: none; }
body.rs-modern .rs-refine-panel .chkChoice input[type="checkbox"] { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
body.rs-modern .rs-refine-panel .chkChoice label {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; margin: 0 !important; padding: .3rem .75rem;
  border: 1px solid var(--rs-line-2); border-radius: 999px; background: var(--rs-surface); color: var(--rs-body-fg);
  font-size: .8rem !important; font-weight: 600; line-height: 1.15; text-transform: none; cursor: pointer; user-select: none;
  transition: background-color .18s, border-color .18s, color .18s;
}
body.rs-modern .rs-refine-panel .chkChoice label:hover { border-color: var(--rs-primary); background: var(--rs-tint); }
body.rs-modern .rs-refine-panel .chkChoice input:checked + label { background: var(--rs-primary); border-color: var(--rs-primary); color: var(--rs-on-primary); }
body.rs-modern .rs-refine-panel .chkChoice input:checked + label::before { content: ""; width: 6px; height: 10px; margin: -3px .1rem 0 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
body.rs-modern .rs-refine-panel .chkChoice input:focus-visible + label { outline: 2px solid var(--rs-primary); outline-offset: 2px; }
body.rs-modern .rs-refine-panel .rs-more-opts { display: inline-block; margin: .6rem 0 0; padding: 0; border: 0; background: none; color: var(--rs-body-fg); font: inherit; font-size: .82rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body.rs-modern .rs-refine-panel .rs-more-opts:hover { color: var(--rs-primary); }

body.rs-modern .rs-refine-panel .rs-refine-foot {
  flex: none; display: flex; gap: .6rem; margin: 0 !important; padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rs-line); background: var(--rs-surface);
}
body.rs-modern .rs-refine-panel .rs-refine-foot .btn { flex: 1 1 0; width: auto; min-height: 50px; padding: .8rem 1rem; box-shadow: none; }
body.rs-modern .rs-refine-panel .rs-refine-foot .rs-clear-btn { flex: 0 0 auto; padding-left: 1.3rem; padding-right: 1.3rem; }

/* the backdrop behind the panel, at every width */
body.rs-modern .rs-refine-backdrop { display: block !important; position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .42); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.rs-modern .rs-refine-backdrop.show { opacity: 1; pointer-events: auto; }
body.rs-modern.rs-drawer-open { overflow: hidden; }

/* ---------- pager ---------- */
body.rs-modern .rs-paging { display: none !important; }
body.rs-modern .rs-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--rs-line); }
body.rs-modern .rs-pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
body.rs-modern .rs-pg, body.rs-modern .rs-pg-arrow {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .7rem; margin: 0; border: 1px solid var(--rs-line);
  border-radius: 999px; background: var(--rs-surface); color: var(--rs-body-fg); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: border-color .18s, background-color .18s, color .18s;
}
body.rs-modern .rs-pg:hover, body.rs-modern .rs-pg-arrow:not([disabled]):hover { border-color: var(--rs-primary); background: var(--rs-tint); }
body.rs-modern .rs-pg.is-current { background: var(--rs-primary); border-color: var(--rs-primary); color: var(--rs-on-primary); cursor: default; }
body.rs-modern .rs-pg-arrow svg { width: 18px; height: 18px; }
body.rs-modern .rs-pg-arrow[disabled] { opacity: .35; cursor: default; }
body.rs-modern .rs-pg-gap { padding: 0 .2rem; color: var(--rs-muted); }
body.rs-modern .rs-pg-all { padding: .4rem .2rem; border: 0; background: none; color: var(--rs-body-fg); font: inherit; font-size: .9rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body.rs-modern .rs-pg-all:hover { color: var(--rs-primary); }

/* ---------- sell banner under the watches ---------- */
body.rs-modern .rs-shop > .rs-refine > #SellBlock {
  grid-row: 3; display: flex; align-items: center; gap: 1.2rem 2rem; margin: 2.4rem 0 0; padding: 1.5rem 1.8rem;
  border-radius: var(--rs-r-lg); background: var(--rs-tint); border: 1px solid color-mix(in srgb, var(--rs-primary) 22%, transparent);
}
body.rs-modern .rs-shop > .rs-refine > #SellBlock[style*="none"] { display: none !important; }
body.rs-modern #SellBlock h2 { flex: 0 0 auto; margin: 0; font-size: 1.15rem; }
body.rs-modern #ResellerContent #SellBlock p { flex: 1 1 auto; margin: 0; font-size: .95rem; color: var(--rs-muted); }
body.rs-modern #SellBlock .rs-sell-go { flex: 0 0 auto; text-decoration: none !important; color: var(--rs-on-primary) !important; }

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  body.rs-modern .rs-quick { flex-wrap: wrap; border-radius: 24px; padding: .5rem; }
  body.rs-modern .rs-quick-search { flex: 1 1 100%; }
  body.rs-modern .rs-quick-brand, body.rs-modern .rs-quick-model { flex: 1 1 0; width: auto; }
  body.rs-modern #SellBlock { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  body.rs-modern .rs-filter-btn span { display: none; }
  body.rs-modern .rs-filter-btn { padding: 0 .95rem; }
  body.rs-modern .rs-sort label { display: none; }
  body.rs-modern .rs-pager { justify-content: center; }
  body.rs-modern .rs-pg, body.rs-modern .rs-pg-arrow { min-width: 40px; height: 40px; }
}
