/* Inherit the existing page's easing, colors, spacing and corner tokens. */

/* Product preview: the artwork itself fills the reserved card area. */
.picture {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.preview-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.preview-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 240ms var(--ease-in-out);
}

.preview-slide {
  display: grid;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
}

.preview-slide img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}

.preview-carousel .zoom {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.preview-arrow,
.gallery-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(17, 91, 137, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #115b89;
  box-shadow: 0 8px 24px rgba(36, 94, 126, .16);
  transform: translateY(-50%);
}

.preview-arrow:hover,
.gallery-arrow:hover {
  background: #fff;
}

.preview-arrow[disabled],
.gallery-arrow[disabled] {
  opacity: .32;
  cursor: default;
}

.preview-arrow.prev,
.gallery-arrow.prev { left: .65rem; }
.preview-arrow.next,
.gallery-arrow.next { right: .65rem; }

.preview-position,
.gallery-position {
  position: absolute;
  z-index: 4;
  bottom: .65rem;
  left: .7rem;
  min-width: 2.8rem;
  padding: .28rem .52rem;
  border-radius: 999px;
  background: rgba(17, 47, 70, .78);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.preview-carousel .zoom-badge {
  z-index: 4;
}

/* Original-resolution detail viewer. */
.details-dialog .gallery-toolbar {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .35rem .15rem .55rem;
}

.gallery-kind {
  color: #315c74;
  font-size: .84rem;
  font-weight: 850;
}

.gallery-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.gallery-zoom-controls button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  border: 1px solid #cce3ef;
  border-radius: .7rem;
  background: #fff;
  color: #115b89;
  font-size: 1.2rem;
  font-weight: 900;
}

.gallery-zoom-controls button[disabled] {
  opacity: .38;
}

.gallery-scale {
  min-width: 3.55rem;
  color: #315c74;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  font-weight: 850;
  text-align: center;
}

.gallery-panel {
  position: relative;
  min-height: min(64vh, 680px);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  user-select: none;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transition: transform 240ms var(--ease-in-out);
}

.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-height: inherit;
  overflow: hidden;
}

.gallery-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: center;
  transition: transform 180ms var(--ease-out);
}

.gallery-canvas.is-interacting {
  transition: none;
}

.gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  background: transparent;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-help {
  margin: .55rem 0 0;
  color: #587488;
  font-size: .76rem;
  line-height: 1.5;
  text-align: center;
}

@media (hover: none), (pointer: coarse) {
  .preview-arrow { display: none; }
}

@media (max-width: 720px) {
  .gallery-panel {
    min-height: 58vh;
  }

  .gallery-arrow {
    display: none;
  }

  .details-dialog .gallery-toolbar {
    align-items: flex-start;
  }

  .gallery-help {
    padding-inline: .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-track,
  .gallery-track,
  .gallery-canvas {
    transition-duration: .01ms !important;
  }
}

/* The three handoff answers are one optional question group. */
.meeting-group {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid #d7eaf3;
  border-radius: 1rem;
}

.meeting-group legend {
  padding: 0 .35rem;
  color: #143f58;
  font-weight: 900;
}

.meeting-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

@media (max-width: 720px) {
  .meeting-grid { grid-template-columns: 1fr; }
}

/* V2 uses one fitted canvas per slide; these scoped rules replace the original
   scroll-to-full-size viewer while retaining its native dialog shell. */
.preview-previous, .gallery-previous { left: 8px; }
.preview-next, .gallery-next { right: 8px; }
.preview-arrow, .gallery-arrow {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  color: var(--accent);
  box-shadow: none;
}
.preview-arrow svg, .gallery-arrow svg { width: 22px; height: 22px; }
.preview-carousel .zoom { touch-action: pan-y; }
.preview-carousel .zoom > span { z-index: 2; }
.preview-position { left: 8px; bottom: 8px; }
.picture > .select { z-index: 5; }
.preview-arrow:active:not(:disabled),
.gallery-arrow:active:not(:disabled) { transform: translateY(-50%); }
.categories .pill[hidden] { display: none; }
.details-dialog .gallery-toolbar {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 28px 12px;
}
.details-dialog .gallery-position {
  position: static;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}
.details-dialog .gallery-zoom-controls { margin-left: auto; }
.details-dialog .gallery-zoom-controls button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue-field);
  color: var(--accent);
}
.details-dialog .gallery-panel {
  flex: 1 1 0;
  min-height: 100px;
  overflow: hidden;
  touch-action: none;
}
.details-dialog .gallery-track {
  height: 100%;
  min-height: 0;
}
.details-dialog .gallery-slide {
  height: 100%;
  min-height: 0;
}
.details-dialog .gallery-canvas { inset: 0; display: block; }
.details-dialog .gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: transparent;
  transition: none;
}
.details-dialog .gallery-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  min-height: 0;
  background: var(--blue-field);
}
.details-dialog .gallery-help { padding: 0; text-align: left; }
.details-dialog .dialog-preview { display: none; }
.details-dialog .gallery-scale { color: var(--ink); font-weight: 600; }
.details-dialog .gallery-arrow { display: grid; }
.details-dialog .gallery-panel.is-gesturing .gallery-track { transition: none; }
.meeting-group {
  padding: 16px;
  border-color: #c8d1df;
  border-radius: var(--radius);
}
.meeting-group legend { color: var(--ink); font-weight: 600; }
.meeting-grid > label { display: grid; gap: 7px; min-width: 0; }
.quantity-control {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.quantity-control[hidden] { display: none; }
.quantity-control > span { margin-right: auto; }
.quantity-control button {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue-field);
  color: var(--accent);
  font-size: 20px;
}
.quantity-control button:disabled { opacity: .45; cursor: default; }
.quantity-control input {
  width: 46px;
  min-width: 0;
  height: 44px;
  border: 1px solid #bac6d7;
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
}
.quantity-control input::-webkit-inner-spin-button { appearance: none; }
.quantity-control input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 767px) {
  .preview-arrow { display: grid; width: 44px; }
  .preview-previous { left: 0; }
  .preview-next { right: 0; }
  .details-dialog .gallery-toolbar { padding: 4px 16px 8px; gap: 4px; }
  .details-dialog .gallery-position { font-size: 13px; }
  .details-dialog .gallery-size { display: none; }
  .details-dialog .gallery-arrow { width: 44px; }
  .quantity-control { flex-wrap: wrap; justify-content: center; gap: 2px; }
  .quantity-control > span { flex: 1 0 100%; margin: 0; }
  .quantity-control input { flex: 1; max-width: 56px; width: 34px; }
}

/* One continuous quantity control, with the product name in its accessible label. */
.customer-page .quantity-control {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 0;
  width: 168px;
  max-width: 100%;
  height: 46px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground);
  overflow: hidden;
}
.customer-page .quantity-control > span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.customer-page .quantity-control button { width: 44px; height: 44px; border-radius: 0; background: transparent; color: var(--ink); font-size: 20px; font-weight: 400; }
.customer-page .quantity-control input { width: 100%; max-width: none; height: 44px; padding: 0; border: 0; border-radius: 0; color: var(--ink); font-size: 16px; font-weight: 500; }
.customer-page .quantity-control button:disabled { color: #9aa5b5; opacity: 1; background: transparent; }
.customer-page .quantity-control:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.customer-page .quantity-control :focus-visible { outline: 0; }
.customer-page .card.is-selected .quantity-control { border-color: var(--accent); }
.customer-page .card.is-selected .quantity-control input { color: var(--accent); font-weight: 600; }
.customer-page .details-dialog .quantity-control { margin-top: 0; flex: none; }
.customer-page .preview-position { min-width: 0; padding: 5px 7px; border-radius: 4px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 500; }
.customer-page .preview-arrow { background: rgb(255 255 255 / 94%); }
.customer-page .preview-arrow[disabled] { opacity: 0; pointer-events: none; }
.customer-page .details-dialog .gallery-toolbar { padding-block: 4px 12px; }
.customer-page .details-dialog .gallery-position { font-size: 13px; }
.customer-page .details-dialog .dialog-heading h2 { font-size: 24px; letter-spacing: -.025em; }
@media (hover: hover) and (pointer: fine) {
  .customer-page .quantity-control button:hover:not(:disabled) { background: var(--blue-field); color: var(--accent); }
}
@media (max-width: 767px) {
  .customer-page .quantity-control { width: 100%; }
  .customer-page .details-dialog .quantity-control { width: 168px; align-self: flex-end; }
  .customer-page .preview-arrow { width: 44px; }
  .customer-page .details-dialog .dialog-heading h2 { font-size: 21px; }
}

/* Cards use the image action for adding; direct numbers keep the summary compact. */
.customer-page .product-add.select {
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.customer-page .product-add svg { width: 20px; height: 20px; }
.customer-page .product-add:disabled { border-color: var(--line); background: #fff; color: #9aa5b5; cursor: default; }
.customer-page .card-info .quantity-control {
  grid-template-columns: minmax(0, 1fr) 14px;
  width: 72px;
  height: 44px;
  margin: 0;
  padding-inline: 5px;
  background: #fff;
  align-self: center;
}
.customer-page .card-info .quantity-control button { display: none; }
.customer-page .card-info .quantity-control input { height: 42px; grid-column: 1; font-variant-numeric: tabular-nums; }
.customer-page .card-info .quantity-control::after { content: "개"; grid-column: 2; align-self: center; color: var(--muted); font-size: 12px; }
@media (hover: hover) and (pointer: fine) {
  .customer-page .product-add:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
}
@media (max-width: 767px) {
  .customer-page .product-add.select { top: 8px; right: 8px; }
  .customer-page .card-info .quantity-control { width: 64px; }
}
