/* Screenshot slots and their modal are limited to the products pages. */
.product-gallery {
  margin-top: 24px;
}

.product-gallery .product-gallery__notice {
  margin: 8px 0 16px;
  font-size: 14px;
}

.product-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.product-gallery__slot {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #dce2f1;
  border-radius: 12px;
  background: #f8faff;
}

.product-gallery__media {
  min-width: 0;
}

.product-gallery__placeholder {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 120px;
  padding: 16px;
  border: 1px dashed #8b9cc8;
  border-radius: 8px;
  color: #53617b;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.product-gallery__placeholder small {
  display: block;
  font-size: 12px;
}

.product-gallery__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.product-gallery__slot figcaption {
  margin: 12px 0;
  color: #243961;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.product-gallery__open,
.product-lightbox button {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #bcc9e5;
  border-radius: 8px;
  background: #fff;
  color: #3155ce;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.product-gallery__open[hidden],
.product-lightbox [hidden],
.product-lightbox:not([open]) {
  display: none !important;
}

.product-lightbox {
  box-sizing: border-box;
  width: min(1100px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid #bcc9e5;
  border-radius: 16px;
  background: #fff;
  color: #17284a;
}

.product-lightbox::backdrop {
  background: rgba(16, 27, 60, .8);
}

.product-lightbox__header,
.product-lightbox__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-lightbox .product-lightbox__title {
  flex: 1 1 180px;
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.product-lightbox .product-lightbox__instructions {
  margin: 14px 0;
  color: #53617b;
  font-size: 14px;
  line-height: 1.6;
}

.product-lightbox__figure {
  margin: 0 0 20px;
}

.product-lightbox__media {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 12px;
  background: #f8faff;
  touch-action: pan-y pinch-zoom;
}

.product-lightbox__media img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  max-height: 60dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-lightbox__media .product-gallery__placeholder {
  box-sizing: border-box;
  width: 100%;
  min-height: min(40vh, 320px);
}

.product-lightbox__figure figcaption {
  margin-top: 14px;
  color: #243961;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.product-lightbox__controls p {
  margin: 0;
  font-size: 14px;
}

.product-lightbox button:focus-visible {
  outline: 3px solid #5574d8;
  outline-offset: 4px;
}

html.product-gallery-modal-open {
  overflow: hidden;
}

/* Approved galleries share the authentic-preview styling. */
[data-product-gallery="production"] .product-gallery__grid,
[data-product-gallery="reports"] .product-gallery__grid,
[data-product-gallery="retail"] .product-gallery__grid,
[data-product-gallery="services"] .product-gallery__grid,
[data-product-gallery="administration"] .product-gallery__grid,
[data-product-gallery="archive"] .product-gallery__grid,
[data-product-gallery="web"] .product-gallery__grid,
[data-product-gallery="hr"] .product-gallery__grid,
[data-product-gallery="payroll"] .product-gallery__grid,
[data-product-gallery="customers"] .product-gallery__grid,
[data-product-gallery="items"] .product-gallery__grid,
[data-product-gallery="finance"] .product-gallery__grid,
[data-product-gallery="purchasing"] .product-gallery__grid,
[data-product-gallery="dashboard"] .product-gallery__grid,
[data-product-gallery="sales"] .product-gallery__grid,
[data-product-gallery="inventory"] .product-gallery__grid,
[data-product-gallery="accounting"] .product-gallery__grid {
  grid-template-columns: minmax(0, 1fr);
}

[data-product-gallery="production"] .product-gallery__image-link,
[data-product-gallery="reports"] .product-gallery__image-link,
[data-product-gallery="retail"] .product-gallery__image-link,
[data-product-gallery="services"] .product-gallery__image-link,
[data-product-gallery="administration"] .product-gallery__image-link,
[data-product-gallery="archive"] .product-gallery__image-link,
[data-product-gallery="web"] .product-gallery__image-link,
[data-product-gallery="hr"] .product-gallery__image-link,
[data-product-gallery="payroll"] .product-gallery__image-link,
[data-product-gallery="customers"] .product-gallery__image-link,
[data-product-gallery="items"] .product-gallery__image-link,
[data-product-gallery="finance"] .product-gallery__image-link,
[data-product-gallery="purchasing"] .product-gallery__image-link,
[data-product-gallery="dashboard"] .product-gallery__image-link,
[data-product-gallery="sales"] .product-gallery__image-link,
[data-product-gallery="inventory"] .product-gallery__image-link,
[data-product-gallery="accounting"] .product-gallery__image-link {
  position: relative;
  display: block;
  border-radius: 8px;
}

[data-product-gallery="production"] .product-gallery__enlarge,
[data-product-gallery="reports"] .product-gallery__enlarge,
[data-product-gallery="retail"] .product-gallery__enlarge,
[data-product-gallery="services"] .product-gallery__enlarge,
[data-product-gallery="administration"] .product-gallery__enlarge,
[data-product-gallery="archive"] .product-gallery__enlarge,
[data-product-gallery="web"] .product-gallery__enlarge,
[data-product-gallery="hr"] .product-gallery__enlarge,
[data-product-gallery="payroll"] .product-gallery__enlarge,
[data-product-gallery="customers"] .product-gallery__enlarge,
[data-product-gallery="items"] .product-gallery__enlarge,
[data-product-gallery="finance"] .product-gallery__enlarge,
[data-product-gallery="purchasing"] .product-gallery__enlarge,
[data-product-gallery="dashboard"] .product-gallery__enlarge,
[data-product-gallery="sales"] .product-gallery__enlarge,
[data-product-gallery="inventory"] .product-gallery__enlarge,
[data-product-gallery="accounting"] .product-gallery__enlarge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 6px 10px;
  border: 1px solid #bcc9e5;
  border-radius: 6px;
  background: #fff;
  color: #3155ce;
  font-size: 13px;
  font-weight: 600;
}

[data-product-gallery="production"] .product-gallery__full-size,
[data-product-gallery="reports"] .product-gallery__full-size,
[data-product-gallery="retail"] .product-gallery__full-size,
[data-product-gallery="services"] .product-gallery__full-size,
[data-product-gallery="administration"] .product-gallery__full-size,
[data-product-gallery="archive"] .product-gallery__full-size,
[data-product-gallery="web"] .product-gallery__full-size,
[data-product-gallery="hr"] .product-gallery__full-size,
[data-product-gallery="payroll"] .product-gallery__full-size,
[data-product-gallery="customers"] .product-gallery__full-size,
[data-product-gallery="items"] .product-gallery__full-size,
[data-product-gallery="finance"] .product-gallery__full-size,
[data-product-gallery="purchasing"] .product-gallery__full-size,
[data-product-gallery="dashboard"] .product-gallery__full-size,
[data-product-gallery="sales"] .product-gallery__full-size,
[data-product-gallery="inventory"] .product-gallery__full-size,
[data-product-gallery="accounting"] .product-gallery__full-size {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
}

@media (min-width: 700px) {
  .product-catalog .pc-card[data-module="manufacturing"]:has(> details[open]),
  .product-catalog .pc-card[data-module="reports"]:has(> details[open]),
  .product-catalog .pc-card[data-module="retail"]:has(> details[open]),
  .product-catalog .pc-card[data-module="services"]:has(> details[open]),
  .product-catalog .pc-card[data-module="administration"]:has(> details[open]),
  .product-catalog .pc-card[data-module="archive"]:has(> details[open]),
  .product-catalog .pc-card[data-module="web"]:has(> details[open]),
  .product-catalog .pc-card[data-module="hr"]:has(> details[open]),
  .product-catalog .pc-card[data-module="payroll"]:has(> details[open]),
  .product-catalog .pc-card[data-module="customers"]:has(> details[open]),
  .product-catalog .pc-card[data-module="items"]:has(> details[open]),
  .product-catalog .pc-card[data-module="finance"]:has(> details[open]),
  .product-catalog .pc-card[data-module="purchasing"]:has(> details[open]),
  .product-catalog .pc-card[data-module="sales"]:has(> details[open]),
  .product-catalog .pc-card[data-module="inventory"]:has(> details[open]),
  .product-catalog .pc-card[data-module="accounting"]:has(> details[open]) {
    grid-column: 1 / -1;
  }

  [data-product-gallery="production"] .product-gallery__grid,
  [data-product-gallery="reports"] .product-gallery__grid,
  [data-product-gallery="retail"] .product-gallery__grid,
  [data-product-gallery="services"] .product-gallery__grid,
  [data-product-gallery="administration"] .product-gallery__grid,
  [data-product-gallery="archive"] .product-gallery__grid,
  [data-product-gallery="web"] .product-gallery__grid,
  [data-product-gallery="hr"] .product-gallery__grid,
  [data-product-gallery="payroll"] .product-gallery__grid,
  [data-product-gallery="customers"] .product-gallery__grid,
  [data-product-gallery="items"] .product-gallery__grid,
  [data-product-gallery="finance"] .product-gallery__grid,
  [data-product-gallery="purchasing"] .product-gallery__grid,
  [data-product-gallery="dashboard"] .product-gallery__grid,
  [data-product-gallery="sales"] .product-gallery__grid,
  [data-product-gallery="inventory"] .product-gallery__grid,
  [data-product-gallery="accounting"] .product-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-lightbox {
    padding: 28px;
  }
}
