/* Vehicle Selector – vs-popup.css
   The plugin's one popup (field help, Top Layer video, Change Vehicle, cart
   file preview) and the cart's file preview boxes. Loaded wherever vs-core.js
   is, and on every page while the cart has items (the mini cart is on every
   page), see frontend-assets.php. */

.vs-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
  -webkit-overflow-scrolling: touch;
}
.vs-help-overlay[hidden] { display: none; }
html.vs-help-open { overflow: hidden; }

.vs-help-popup {
  --vs-ink: #111; --vs-muted: #666; --vs-line-2: #e5e5e5; --vs-accent: #007cba; --vs-radius: 4px;
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--vs-ink);
  border-radius: var(--vs-radius);
  overflow: hidden;
  animation: vs-popup-in .2s ease;
}
.vs-help-popup[hidden] { display: none; }
.vs-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--vs-line-2);
}
.vs-help-title {
  margin: 0;
  font-size: 1.125em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--vs-ink);
}
.vs-help-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 1.1em;
  line-height: 1;
  color: var(--vs-ink);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  min-height: 0;
}
.vs-help-close:hover { background: #f2f2f2; }
.vs-help-body {
  padding: 20px;
  overflow: auto;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}
.vs-help-body > :first-child { margin-top: 0; }
.vs-help-body > :last-child  { margin-bottom: 0; }
.vs-help-body img { max-width: 100%; height: auto; }
.vs-help-body table { width: 100%; border-collapse: collapse; font-size: .9375em; }
.vs-help-body th,
.vs-help-body td { padding: .5em .6em; border-bottom: 1px solid var(--vs-line-2); text-align: left; }
@keyframes vs-popup-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vs-help-popup { animation: none; }
}

/* Cart file preview popup (vs-popup.js openImage): the whole image fits on screen */
.vs-image-popup { width: auto; max-width: min(650px, 100%); }
.vs-image-popup .vs-help-body { display: flex; justify-content: center; padding: 16px; background: #f4f4f4; }
.vs-image-popup .vs-help-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  margin: 0;
  object-fit: contain;
}

/* Customer's uploaded file in cart / mini cart / checkout summary (vs_cart_file_thumb_html):
   fixed 48px box, the image fitted inside, so the option list keeps its layout.
   !important: theme / FunnelKit img and link rules must not resize it. */
.vs-cart-thumb {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 48px !important;
  height: 48px !important;
  margin: 2px 0;
  padding: 0 !important;
  vertical-align: middle;
  overflow: hidden;
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1 !important;
  letter-spacing: .04em;
  color: #777;
  text-decoration: none !important;
}
a.vs-cart-thumb { cursor: zoom-in; }
.vs-cart-thumb img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  object-fit: contain;
}
