/* V5: per-card cover choice, scoped to previews and card covers only.
   Detail galleries always retain the original, uncropped photographs. */
:is(.equipment-tile,.catalog-product-tile,.catalog-card,.admin-product-picker-tile)[data-cover-fit="cover"] img.cover-img,
:is(.equipment-tile,.catalog-product-tile,.catalog-card,.admin-product-picker-tile)[data-cover-fit="cover"] img.admin-product-picker-image {
  object-fit:cover;
  object-position:center;
  padding:0;
}
/* V4 contains a more specific no-crop rule for client/project logos. */
body:not(.admin-area) :is(.home-production-section,.production-group)
  .equipment-tile[data-cover-fit="cover"] > .project-client-mark > img.project-logo {
  object-fit:cover;
  object-position:center;
}

/* Admin: native checkbox operated as a two-position slider; keyboard accessible. */
.cover-fit-editor {
  max-width:600px;
  border:1px solid var(--hairline,#c7c7c7);
  border-radius:14px;
  padding:18px 20px 20px;
  margin:16px 0 24px;
  min-width:0;
}
.cover-fit-editor legend {font-weight:700;padding:0 6px;}
.cover-fit-choice {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  font-weight:600;
  cursor:pointer;
  min-height:46px;
}
.cover-fit-toggle {display:inline-flex;position:relative;width:58px;height:32px;flex:0 0 58px;}
.cover-fit-toggle input {
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
}
.cover-fit-track {
  display:block;
  position:absolute;
  inset:0;
  background:#b0b0b0;
  border:1px solid #666;
  border-radius:999px;
  transition:background-color .16s ease;
  pointer-events:none;
}
.cover-fit-track::before {
  content:"";
  position:absolute;
  left:3px;
  top:3px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px #0005;
  transition:transform .16s ease;
}
.cover-fit-toggle input:checked + .cover-fit-track {background:#216c49;border-color:#216c49;}
.cover-fit-toggle input:checked + .cover-fit-track::before {transform:translateX(26px);}
.cover-fit-toggle input:focus-visible + .cover-fit-track {outline:3px solid #b17808;outline-offset:3px;}
.cover-fit-editor .hint {margin:12px 0 0;line-height:1.45;}
.cover-fit-example {
  margin-top:14px;
  border:1px solid var(--hairline,#c7c7c7);
  padding:8px;
  width:min(100%,320px);
  border-radius:12px;
}
.cover-fit-example img {display:block;width:100%;height:180px;object-fit:contain;object-position:center;background:#fff;border-radius:8px;}
.cover-fit-example img[data-cover-fit="cover"] {object-fit:cover;}
html[data-theme="dark"] .cover-fit-editor {border-color:#555;}
html[data-theme="dark"] .cover-fit-example {border-color:#555;}
@media (prefers-reduced-motion:reduce) {
  .cover-fit-track,.cover-fit-track::before {transition:none;}
}

/* Gallery: selected image has a distinct dual ring in both themes.
   Extra scrollable padding prevents the outer ring from being clipped. */
.gallery-thumbnails {padding:9px 7px 13px;scrollbar-gutter:stable;}
.gallery-thumbnails button[data-gallery-thumb] {
  position:relative;
  border:2px solid #949494;
  outline:none;
  outline-offset:0;
  transition:border-color .13s ease,box-shadow .13s ease;
}
.gallery-thumbnails button[data-gallery-thumb][aria-pressed="true"] {
  border:3px solid #c88f14;
  box-shadow:0 0 0 2px #111,0 0 0 4px #e6ac2f;
  outline:0;
  background:#fff;
}
.gallery-thumbnails button[data-gallery-thumb]:focus-visible {
  outline:3px dashed #c88f14;
  outline-offset:5px;
}
html[data-theme="dark"] .gallery-thumbnails button[data-gallery-thumb][aria-pressed="true"] {
  border-color:#eab94b;
  box-shadow:0 0 0 2px #fff,0 0 0 4px #eab94b;
}
@media (prefers-reduced-motion:reduce) {
  .gallery-thumbnails button[data-gallery-thumb] {transition:none;}
}
