/* NOTE: this file still has !important rules on purpose. Removing them changes how pages look (checked page by page with admin/tests/tools/css_check.php) because they override older rules; merge the overlapping rules before removing them. */
/* Home page browse: the tags on a model card (sale, rating, featured star).
   Colours come from the admin theme (--msg-* from Msg\Theme::styleTag on the page) or, for the featured star, inline from the join-button colours. */
.browse-show-btn { display: none; }
@media (max-width: 899px) {
  .browse-show-btn { display: block; position: sticky; bottom: 0; width: calc(100% - 24px); margin: 12px; min-height: 48px; border: 0; border-radius: var(--btn-r, 10px); background: var(--msg-accent); color: var(--msg-on-accent) !important; font-size: 16px; font-weight: 700; }
  }
.browse-nomatch { text-align: center; padding: 50px 16px; color: var(--msg-muted); }
/* a long category name wraps instead of running into the next heading */
.sidebar_filters a.collection-item { height: auto !important; min-height: 36px; line-height: 20px !important; padding-top: 8px !important; padding-bottom: 8px !important; }

/* the heading block above the grid (inside #card, so it lines up with the cards): title, the admin's paragraph and category pills */
.browse-head { display: block; box-sizing: border-box; width: 0; min-width: 100%; text-align: left; padding: 4px 8px 0 4px; } /* width 0 + min-width 100%: the grid's table (#card) is as wide as the cards, never as wide as a long row of pills */
.browse-head > div { text-align: left; }
.browse-title { margin: 6px 0 4px; font-size: 28px; font-weight: 700; color: var(--msg-text); }
.browse-text { margin: 0 0 6px; max-width: 1100px; color: var(--msg-muted); font-size: 15px; line-height: 1.5; }
.browse-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 8px; }
.browse-pills::-webkit-scrollbar { display: none; }
.browse-pill { flex: none; min-height: 32px; padding: 0 14px; border-radius: var(--btn-r, 999px); border: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-text) !important; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.browse-pill.on { background: var(--msg-accent); border-color: var(--msg-accent); color: var(--msg-on-accent) !important; font-weight: 700; }
.browse-pills:not(:has(.on)) .browse-pill[data-pill-all] { background: var(--msg-accent); border-color: var(--msg-accent); color: var(--msg-on-accent) !important; font-weight: 700; }
@media (max-width: 899px) { .browse-title { font-size: 22px; } .browse-text { font-size: 14px; } }
/* the main list on a phone: no visible heading (kept for search engines and screen readers), the cards start under the filters */
.browse-title.is-off, .browse-text.is-off { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; } /* the admin switched the main page's heading off: same, on every screen */
@media (max-width: 899px) { .browse-title.is-home, .browse-text.is-home { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; } }

/* ---- the row above the list: dropdown buttons (each opens a panel of checkboxes), Clear All, a divider and the category pills */
.browse-bar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; padding: 4px 0 6px; }
/* phones: the filter buttons (Appearance, Countries ...) sit close to the strip above and the cards below: 12px each side (it was about 20) */
@media (max-width: 899px) { .browse-head { padding-top: 0; } .browse-bar { padding: 0; } .bp-main .bp-grid { margin-top: 12px; } }
.browse-menus { display: flex; gap: 8px; flex: none; }
.browse-menu { position: relative; display: flex; align-items: center; flex: none; }
.browse-menubtn { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: 320px; padding: 0 12px; border-radius: var(--btn-r, 999px); border: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-text) !important; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.browse-menubtn[aria-expanded="true"] { border-color: var(--msg-accent); }
.browse-menubtn.on { border-color: var(--msg-accent); padding-right: 36px; }
.browse-menulabel { overflow: hidden; text-overflow: ellipsis; }
.browse-menubtn.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--msg-accent); order: -1; flex: none; }
.browse-menubtn i { color: var(--msg-muted); }
.browse-menux { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--msg-text) 25%, transparent); color: var(--msg-text) !important; font-size: 16px; line-height: 24px; cursor: pointer; }
.browse-clearall { flex: none; min-height: 32px; padding: 0 12px; border-radius: var(--btn-r, 999px); border: 1px solid var(--msg-border); background: transparent; color: var(--msg-text) !important; font: inherit; font-size: 13px; cursor: pointer; }
.browse-bar-sep { flex: none; width: 1px; align-self: stretch; margin: 4px 2px; background: var(--msg-border); }
.browse-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 70; width: min(560px, 92vw); max-height: min(560px, 72vh); display: flex; flex-direction: column; border-radius: 14px; background: var(--msg-surface); border: 1px solid var(--msg-border); box-shadow: 0 18px 50px color-mix(in srgb, var(--msg-black) 55%, transparent); }
.browse-panel[hidden] { display: none; }
.browse-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--msg-border); font-size: 18px; }
.browse-panel-x { width: 40px; height: 40px; border: 0; background: transparent; color: var(--msg-muted) !important; font-size: 26px; cursor: pointer; }
.browse-panel-body { overflow-y: auto; padding: 6px 18px 10px; flex: 1; }
.browse-panel-h { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--msg-muted); }
.browse-panel-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.browse-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; font-weight: 400; color: var(--msg-text); }
.browse-opt input { width: 20px; height: 20px; flex: none; accent-color: var(--msg-accent); }
.browse-panel-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--msg-border); }
.browse-panel-foot [hidden] { display: none !important; }
.browse-foot-apply { display: flex; align-items: center; gap: 14px; width: 100%; justify-content: space-between; }
.browse-foot-close, .browse-foot-clear, .browse-foot-go { min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.browse-foot-close { background: var(--msg-surface-2); color: var(--msg-text) !important; }
.browse-foot-clear { background: transparent; color: var(--msg-muted) !important; }
.browse-foot-go { background: var(--msg-accent); color: var(--msg-on-accent) !important; }

/* the pills: one scrolling line; the arrow scrolls it, and at the end opens every pill in rows under the title */
.browse-pillbox { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.browse-pillbox .browse-pills { flex: 1; min-width: 0; padding: 0; }
.browse-pills-next { display: none; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--msg-border); background: var(--msg-surface); color: var(--msg-text) !important; cursor: pointer; opacity: 0; transition: opacity .15s ease; box-shadow: -14px 0 14px 4px var(--msg-bg); }
.browse-pillbox.has-more .browse-pills-next { display: block; }
.browse-pillbox:hover .browse-pills-next, .browse-pills-next:focus-visible { opacity: 1; }
@media (hover: none) { .browse-pillbox .browse-pills-next { opacity: 1; } }
.browse-pillbox.open { flex: 1 1 100%; order: 9; align-items: flex-start; }
.browse-pillbox.open .browse-pills { flex-wrap: wrap; overflow: visible; }
.browse-pillbox.open .browse-pills-next { position: static; transform: none; margin-left: 8px; opacity: 1; box-shadow: none; flex: none; }
.browse-bar:has(.browse-pillbox.open) { flex-wrap: wrap; }
.browse-bar:has(.browse-pillbox.open) .browse-bar-sep { display: none; }
@media (max-width: 899px) {
  .browse-bar { flex-wrap: wrap; }
  .browse-menus { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .browse-bar-sep { display: none; }
  .browse-pillbox { flex: 1 1 100%; }
  .browse-menu { position: static; }
  .browse-panel { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto; width: auto; max-height: 82vh; border-radius: 16px 16px 0 0; z-index: 1000; }
  body.browse-panel-open::after { content: ""; position: fixed; inset: 0; z-index: 999; background: color-mix(in srgb, var(--msg-scrim) 60%, transparent); }
  .browse-panel-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- the home page's sections (live/lib/Browse/Home.php, home.js): two rows of cards that slide sideways, a "See All" link, arrows on hover; a phone swipes */
.browse-home { width: 100%; text-align: left; }
.browse-home:empty { display: none; }
.home-sec { margin: 0 0 14px; }
.home-sec-head { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 4px; }
.home-sec-title { flex: 1; min-width: 0; margin: 6px 0 4px; font-size: 22px; font-weight: 700; color: var(--msg-text); }
.home-seeall, .home-clear { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; background: none; border: 0; color: var(--msg-accent) !important; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.home-clear { color: var(--msg-muted) !important; font-weight: 400; }
.home-sec-text { margin: 0 0 6px 4px; max-width: 1100px; color: var(--msg-muted); font-size: 15px; line-height: 1.5; }
.home-rail { position: relative; }
.home-track { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; container-type: inline-size; -webkit-overflow-scrolling: touch; }
.home-track::-webkit-scrollbar { display: none; }
.home-track .home-grid { --n: 6; --gap: 8px; display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: var(--cw, 252px); gap: var(--gap); width: auto; margin: 0; padding: 0; list-style: none; }
.home-track .home-grid > li { float: none !important; width: auto !important; height: auto !important; aspect-ratio: 4 / 3; margin: 0 !important; scroll-snap-align: start; }
@container (max-width: 699px) { .home-rail-wrap .home-track .home-grid { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); } .home-track .home-grid { --n: 3; grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)); } }
@container (max-width: 479px) { .home-track .home-grid { --n: 2; grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)); } }
/* a phone (like the big sites): the row always snaps with a card flush at the left and the next card showing 28px at the right edge; never a strip of the previous card */
@media (max-width: 1199px) { .home-rail[data-scroll] .home-track { --peek: 28px; scroll-padding-inline-start: 0; scroll-snap-type: x mandatory; } }
@container (max-width: 699px) { .home-rail[data-scroll] .home-track .home-grid { grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap) - var(--peek, 0px)) / var(--n)); } }
@container (max-width: 479px) { .home-rail[data-scroll] .home-track .home-grid { grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap) - var(--peek, 0px)) / var(--n)); } }
.home-rail.is-short .home-track .home-grid { grid-template-rows: auto; } /* one row of up to six: a short list fills the first row, not two thin columns */
.home-rail-wrap .home-track { overflow: visible; }
.home-rail-wrap .home-track .home-grid { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, var(--cw, 252px)); justify-content: start; grid-auto-columns: auto; }
.home-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--msg-border); background: color-mix(in srgb, var(--msg-surface) 92%, transparent); color: var(--msg-text) !important; font-size: 18px; cursor: pointer; box-shadow: 0 4px 14px color-mix(in srgb, var(--msg-black) 50%, transparent); }
.home-arrow[hidden] { display: none !important; }
.home-prev { left: 6px; }
.home-next { right: 6px; }
@media (hover: hover) { .home-arrow { opacity: 0; transition: opacity .15s; } .home-rail:hover .home-arrow, .home-arrow:focus-visible { opacity: 1; } }
@media (hover: none) { .home-arrow { display: none !important; } }
@media (max-width: 899px) { .home-sec-title { font-size: 18px; } }

/* the picture next to a category (an icon the admin picked, or a country flag) in the left list and the sub-category pills */
.browse-pill .cat-flag { width: 18px; height: 18px; vertical-align: -3px; }

/* phones keep finger-sized buttons */
@media (max-width: 899px) { .browse-menubtn, .browse-clearall, .browse-pill { min-height: 40px; font-size: 15px; } }
/* the strip under the site header (Girls / Couples / Guys / Trans ...): full width, like the big sites, always under the header; on phones its buttons scroll sideways */
.browse-tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--msg-surface); border-bottom: 1px solid var(--msg-border); overflow-x: auto; scrollbar-width: none; }
.browse-tabs::-webkit-scrollbar { display: none; }
.browse-tabs:empty { display: none; }
.browse-tab { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; color: var(--msg-muted) !important; font-size: 16px; font-weight: 500; text-decoration: none; border-bottom: 3px solid transparent; box-sizing: border-box; }
.browse-tab.on { color: var(--msg-text) !important; font-weight: 700; border-bottom-color: var(--msg-text); }
@media (hover: hover) { .browse-tab:hover { color: var(--msg-text) !important; } }
#browseTabs { position: fixed; top: var(--ch-h, 54px); left: 0; right: 0; z-index: 100; } /* the strip is fixed under the header on every screen: it never scrolls away */
body.acct-bn-on #browseTabs { top: calc(var(--ch-h, 54px) + var(--acct-bn)); }
body:has(#browseTabs .browse-tabs) .bp { padding-top: calc(var(--ch-h, 54px) + 3px); }
body:has(#browseTabs .browse-tabs) .bp-main { margin-top: 0; } /* the strip's own room is enough: the list's 19px top margin put a blank line above the heading */
body:has(#browseTabs .browse-tabs) .pay-promo-top { margin-top: 106px; } /* margins collapse with the body's: this is the distance from the top of the page, under the fixed strip */
@media (min-width: 1200px) {
  body:has(#browseTabs .browse-tabs) .ch-sidebar { top: 98px !important; }
  body.acct-bn-on:has(#browseTabs .browse-tabs) .ch-sidebar { top: calc(98px + var(--acct-bn)) !important; }
}

/* the search button at the right end of the strip: phones only (wide screens have the search in the header) */
.browse-tab-search { display: none; margin-left: auto; flex: none; width: 48px; height: 44px; border: 0; background: none; color: var(--msg-muted) !important; cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 899px) { .browse-tab-search { display: inline-flex; position: sticky; right: 0; background: var(--msg-surface); } .browse-tab-search:has(+ .browse-tab-filter) { right: 48px; } .browse-tab.no-phone { display: none; } }
/* the Categories icon beside the search icon (phones; the admin can switch it off): opens the full-screen panel */
.browse-tab-filter { display: none; flex: none; width: 48px; height: 44px; border: 0; background: none; color: var(--msg-muted) !important; cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 899px) { .browse-tab-filter { display: inline-flex; position: sticky; right: 0; background: var(--msg-surface); } }

/* the phone's pills under the strip (Sidebar::phonePills): Categories, then every category, sliding sideways */
.phone-pills { display: none; }
@media (max-width: 899px) {
  .phone-pills { display: flex; gap: 10px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 12px 8px 6px; }
  .phone-pills::-webkit-scrollbar { display: none; }
  .phone-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: var(--mp-h, 36px); padding: 0 calc(var(--mp-h, 36px) * .4); border-radius: var(--btn-r, 999px); border: 0; background: var(--msg-surface-2); color: var(--msg-text) !important; font: inherit; font-size: var(--mp-fs, 14px); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
  .phone-pill.on { background: var(--msg-accent); color: var(--msg-on-accent) !important; font-weight: 700; }
  .phone-pill .cat-flag { width: 28px; height: 28px; margin: 0; }
  .phone-pill .cat-icon { width: 22px; margin: 0; text-align: center; }
  .phone-pill-sep { flex: none; width: 1px; align-self: stretch; margin: 8px 0; background: var(--msg-border); }
}

/* the tool box at the right end of the strip under the header (wide screens only: on phones and tablets the cards have fixed columns) */
.browse-tools { display: none; }
@media (min-width: 1200px) {
  .browse-tools { position: fixed; top: var(--ch-h, 54px); right: 20px; z-index: 101; height: 44px; display: flex; align-items: center; gap: 4px; }
  body.acct-bn-on .browse-tools { top: calc(var(--ch-h, 54px) + var(--acct-bn)); }
  .bt-btn { position: relative; width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--btn-r, 8px); background: none; color: var(--msg-muted) !important; cursor: pointer; }
  .bt-btn svg { width: 22px; height: 22px; }
  .bt-btn[aria-pressed="true"], .bt-btn[aria-expanded="true"] { color: var(--msg-accent) !important; background: var(--msg-hover); }
  @media (hover: hover) { .bt-btn:hover { color: var(--msg-text) !important; background: var(--msg-hover); } }
  .bt-btn:focus-visible { outline: 2px solid var(--msg-accent); outline-offset: 1px; }
  .bt-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--msg-border); }
  .bt-sort { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; color: var(--msg-muted); font-size: 14px; }
  .bt-sort-s { min-height: var(--btn-h, 36px); max-width: 190px; padding: 0 30px 0 12px; border: 1px solid var(--msg-border); border-radius: var(--btn-r, 8px); background: var(--msg-surface); color: var(--msg-text); font: inherit; font-size: 16px; }
  .bt-panel { position: absolute; top: 100%; right: 0; width: min(1180px, calc(100vw - 40px)); max-height: calc(100vh - 110px); display: flex; flex-direction: column; border-radius: 0 0 10px 10px; /* it hangs from the bar: square where it meets it */ background: #000000ed; color: var(--msg-white); border: 0; box-shadow: 0 16px 44px var(--msg-scrim); overflow: hidden; } /* black and a little see-through whatever the look: the owner's choice, so its text is always white */
  .bt-panel[hidden] { display: none; }
  .bt-panel-body { overflow-y: auto; padding: 18px 22px 8px; column-width: 150px; column-gap: 30px; }
  .bt-panel-body section { break-inside: avoid; margin: 0 0 16px; }
  .bt-panel-body h3 { margin: 0 0 7px; font-size: 13px; font-weight: 700; color: var(--msg-white); }
  .bt-panel-body ul { list-style: none; margin: 0; padding: 0; }
  .bt-panel-body li { break-inside: avoid; } /* Firefox split a row that sat on a column edge into two pieces, its number dropping under it (owner 2026-11-02) */
  .bt-panel-body .collection-item { display: flex; align-items: baseline; gap: 6px; min-height: 0; padding: 2px 0; border-radius: 0; background: none !important; color: var(--msg-white) !important; opacity: .72; text-decoration: none; font-size: 13px; line-height: 1.5; break-inside: avoid; }
  .bt-panel-body .collection-item .count { color: inherit; opacity: .7; font-size: 11px; float: none !important; margin: 0; }
  .bt-panel-body .collection-item:hover { opacity: 1; }
  .bt-panel-body .collection-item.second-nv-active { color: var(--msg-accent) !important; opacity: 1; font-weight: 700; }
  .bt-panel-foot { flex: none; display: flex; justify-content: flex-end; padding: 6px 22px 12px; }
  .bt-clear { border: 0; background: none; color: var(--msg-white) !important; opacity: .7; font-size: 12px; cursor: pointer; padding: 4px 0; text-decoration: underline; }
  .bt-clear:hover { opacity: 1; }
}

/* the categories after the strip tabs are for phones only (a wide screen has the left list) */
@media (min-width: 900px) { .browse-tab.phone-only { display: none; } }

/* phones: the strip's tabs fade out before the search and Categories icons, and nothing shows to the right of them */
@media (max-width: 899px) {
  .browse-tabs { padding-right: 0; }
  .browse-tab-search, .browse-tab-filter { position: sticky; }
  .browse-tab-search::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 34px; pointer-events: none; background: linear-gradient(to left, var(--msg-surface), transparent); }
  .browse-tab-search:not(:has(+ .browse-tab-filter))::before, .browse-tab-search + .browse-tab-filter { z-index: 1; }
}
