/* BiT Homes v35.7.6.5 — scoped Service/Shopping/public search/performance repair. */

/* Keep the full rich editor toolbar compact. */
.bhcd35-rich-toolbar,
.v331-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.35rem;
  min-width:0;
}
.bhcd35-rich-toolbar > *,
.v331-toolbar > * {
  flex:0 0 auto;
  width:auto;
  max-width:100%;
}
.bhcd35-rich-toolbar select,
.v331-toolbar select { min-width:4.75rem; }
.bhcd35-rich-toolbar button,
.v331-toolbar button { white-space:nowrap; }
.bhcd35-rich-owner { min-width:0; }
.bhcd35-rich-owner .bhcd34-rich,
.bhcd35-rich-owner .v331-rich { width:100%;max-width:100%; }

/* Shared rich-editor image selector: overlay/popover, never part of editor row height. */
.bh35765-media-picker {
  position:relative;
  display:inline-block;
  flex:0 0 auto;
  margin:0;
  padding:0;
}
.bh35765-media-picker > summary {
  list-style:none;
  cursor:pointer;
  border:0;
  border-radius:.35rem;
  padding:.48rem .68rem;
  background:#2563eb;
  color:#fff;
  font:inherit;
  font-weight:700;
  line-height:1.15;
  white-space:nowrap;
}
.bh35765-media-picker > summary::-webkit-details-marker { display:none; }
.bh35765-media-picker[open] > summary { outline:2px solid rgba(37,99,235,.22);outline-offset:2px; }
.bh35765-media-popover {
  position:absolute;
  z-index:1200;
  top:calc(100% + .45rem);
  right:0;
  width:min(28rem,calc(100vw - 2rem));
  max-height:min(24rem,70vh);
  overflow:auto;
  padding:.75rem;
  border:1px solid #cbd5e1;
  border-radius:.65rem;
  background:#fff;
  color:#0f172a;
  box-shadow:0 .85rem 2.2rem rgba(15,23,42,.22);
}
.bh35765-media-popover label { display:block;margin:0 0 .5rem;font-weight:700; }
.bh35765-media-popover input[type="search"],
.bh35765-media-popover select { width:100%;max-width:100%; }
.bh35765-media-popover select { min-height:8rem;max-height:12rem; }
.bh35765-media-popover .btn,
.bh35765-media-popover button { margin-top:.5rem; }

/* Shopping admin: prevent the old dial-code enhancer from laying fields over label editors. */
[data-bithomes-no-dial-code] .v331-phone-wrap,
[data-bithomes-no-dial-code] .v331-phone-picker,
[data-bithomes-no-dial-code] [data-v331-phone-wrap] { max-width:100%; }
.bh35765-shopping-settings .bhcd34-grid { min-width:0; }
.bh35765-shopping-settings .bhcd35-rich-owner { grid-column:1/-1; }
.bh35765-shopping-settings details { min-width:0; }
.bh35765-shopping-settings summary { cursor:pointer; }
.bh35765-admin-fold { border:1px solid #dbe3ef;border-radius:.6rem;padding:.55rem;margin:.55rem 0; }
.bh35765-admin-fold > summary { cursor:pointer;font-weight:700;padding:.25rem; }
.bh35765-admin-fold-body { padding:.65rem .2rem .2rem;min-width:0; }
.bh35765-services-design-links { display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.65rem; }

/* Responsive Products admin: the table may scroll locally, never widen the admin page. */
body:has(a[href="/admin/products"].active) .content,
body:has(a[href="/admin/products"].active) main { min-width:0;max-width:100%; }
body:has(a[href="/admin/products"].active) .table-wrap { max-width:100%;overflow-x:auto; }
body:has(a[href="/admin/products"].active) table { width:100%;max-width:100%;table-layout:auto; }
body:has(a[href="/admin/products"].active) table th,
body:has(a[href="/admin/products"].active) table td { max-width:26rem;overflow-wrap:anywhere;word-break:break-word; }

/* Shared public search/filter card presentation. Desktop stays open. */
[data-bithomes-public-search-card],
.bh-service-search-v272,
.restaurant-search {
  position:relative;
  min-width:0;
}
.bh35765-search-toggle {
  display:none;
  width:100%;
  min-height:2.65rem;
  padding:.62rem .8rem;
  border:1px solid #245787;
  border-radius:.5rem;
  background:#245787;
  color:#fff;
  font:inherit;
  font-weight:800;
  text-align:left;
  cursor:pointer;
}
.bh35765-search-toggle::after { content:"▾";float:right; }
[data-bh35765-collapsed="0"] > .bh35765-search-toggle::after { content:"▴"; }
.bh35765-search-body { min-width:0; }

/* Use configured opacity without changing the configured gradient colors. */
[data-bithomes-public-search-card] {
  background:linear-gradient(var(--bh35762-bg-dir,135deg),var(--bh35762-bg-from,#fff),var(--bh35762-bg-to,#fff)) padding-box,
             linear-gradient(var(--bh35762-border-dir,90deg),var(--bh35762-border-from,#dbe3ef),var(--bh35762-border-to,#dbe3ef)) border-box;
  background:linear-gradient(var(--bh35762-bg-dir,135deg),
             color-mix(in srgb,var(--bh35762-bg-from,#fff) var(--bh35765-search-opacity,100%),transparent),
             color-mix(in srgb,var(--bh35762-bg-to,#fff) var(--bh35765-search-opacity,100%),transparent)) padding-box,
             linear-gradient(var(--bh35762-border-dir,90deg),var(--bh35762-border-from,#dbe3ef),var(--bh35762-border-to,#dbe3ef)) border-box;
  border:var(--bh35762-border-width,1px) solid transparent;
}

/* Shopping custom content participates in the public page flow without altering item cards. */
.bh35765-shopping-custom-stream { display:contents; }
.bh35765-shopping-block-slot { min-width:0; }
.v348-product-filter[data-bithomes-public-search-card] { min-width:0; }
.bh35765-rich-label-public { display:block; }

@media (max-width:760px) {
  .bh35765-media-popover { position:fixed;left:.75rem;right:.75rem;top:5rem;width:auto;max-height:calc(100vh - 6rem); }
  .bh35765-search-toggle { display:block; }
  [data-bh35765-collapsed="1"] > .bh35765-search-body { display:none!important; }
  [data-bh35765-collapsed="0"] > .bh35765-search-body { display:block; }
  [data-bithomes-public-search-card],
  .bh-service-search-v272,
  .restaurant-search { width:100%;max-width:100%!important; }
  .bh35765-search-body .pv33-filter,
  .bh35765-search-body.v348-product-filter,
  .bh35765-search-body { grid-template-columns:1fr!important; }
  .bh35765-search-body label,
  .bh35765-search-body input,
  .bh35765-search-body select,
  .bh35765-search-body button { max-width:100%; }
}
