.smc-front-gallery {
  --smc-gallery-arrow-width: 22px;
  --smc-gallery-control-gap: 4px;
  --smc-gallery-thumb-gap: 4px;
  container: smc-gallery / inline-size;
  width: 100%;
  max-width: 500px;
}
.smc-gallery-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.smc-gallery-preview {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  background: #fff;
}
.smc-gallery-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.smc-gallery-preview .smc-gallery-outgoing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.smc-gallery-navigation {
  display: flex;
  align-items: stretch;
  gap: var(--smc-gallery-control-gap);
  min-width: 0;
  margin-top: 8px;
}
.smc-gallery-thumbnails {
  --smc-gallery-thumb-count: 3;
  display: flex;
  flex: 1 1 0;
  gap: var(--smc-gallery-thumb-gap);
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0;
  scrollbar-width: none;
}
.smc-gallery-thumbnail {
  box-sizing: border-box;
  appearance: none;
  display: block;
  flex: 0 0 calc((100% - (var(--smc-gallery-thumb-count) - 1) * var(--smc-gallery-thumb-gap)) / var(--smc-gallery-thumb-count));
  min-width: 0;
  width: 100%;
  aspect-ratio: 1;
  scroll-snap-align: start;
  padding: clamp(2px, 1vw, 5px);
  margin: 0;
  border: 1px solid var(--smc-line, #dadada);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}
.smc-gallery-thumbnail[aria-pressed="true"] {
  border-color: var(--smc-accent, var(--awb-color4, #e4002b));
  box-shadow: inset 0 0 0 1px var(--smc-accent, var(--awb-color4, #e4002b));
}
.smc-gallery-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.smc-gallery-thumbnail:focus-visible {
  outline: 2px solid var(--smc-accent, #e4002b);
  outline-offset: 2px;
}
.smc-gallery-arrow {
  display: none;
}
.smc-gallery-stage--ready .smc-gallery-preview {
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.smc-gallery-stage--dragging .smc-gallery-preview {
  cursor: grabbing;
  user-select: none;
}
.smc-gallery-stage--ready .smc-gallery-preview img {
  -webkit-user-drag: none;
  user-select: none;
}
.smc-gallery-stage--ready .smc-gallery-image-arrow,
.smc-gallery-navigation > .smc-gallery-arrow {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--smc-gallery-arrow-width);
  padding: 3px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--smc-color3, var(--smc-ink, #4c4c4c));
  background: transparent;
  cursor: pointer;
}
.smc-gallery-stage--ready .smc-gallery-image-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
}
.smc-gallery-image-arrow[data-gallery-image="-1"] {
  left: 4px;
}
.smc-gallery-image-arrow[data-gallery-image="1"] {
  right: 4px;
}
.smc-gallery-navigation > .smc-gallery-arrow {
  flex: 0 0 var(--smc-gallery-arrow-width);
  height: auto;
}
.smc-gallery-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.smc-gallery-arrow svg path { fill: none; }
.smc-gallery-navigation > .smc-gallery-arrow:not(:disabled):hover,
.smc-gallery-stage--ready .smc-gallery-image-arrow:not(:disabled):hover {
  color: var(--smc-color5, var(--smc-accent, var(--awb-color4, #e4002b)));
  border-color: currentColor;
}
.smc-gallery-navigation > .smc-gallery-arrow:disabled,
.smc-gallery-stage--ready .smc-gallery-image-arrow:disabled {
  color: #bdbdbd;
  background: transparent;
  cursor: not-allowed;
  opacity: 0.6;
}
.smc-gallery-arrow:focus-visible {
  outline: 2px solid var(--smc-accent, #e4002b);
  outline-offset: 2px;
}
.smc-gallery-thumbnails::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
@media (min-width: 480px) {
  .smc-front-gallery {
    --smc-gallery-arrow-width: 26px;
    --smc-gallery-control-gap: 8px;
    --smc-gallery-thumb-gap: 8px;
  }
}
@container smc-gallery (min-width: 300px) {
  .smc-gallery-thumbnails { --smc-gallery-thumb-count: 4; }
}
@container smc-gallery (min-width: 400px) {
  .smc-gallery-thumbnails { --smc-gallery-thumb-count: 5; }
}
@media (forced-colors: active) {
  .smc-gallery-thumbnails {
    scrollbar-color: auto;
  }
}
.smc-drag-scroll.smc-drag-scroll--dragging {
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .smc-drag-scroll,
  .smc-drag-scroll a,
  .smc-drag-scroll button {
    cursor: grab;
  }
  .smc-drag-scroll.smc-drag-scroll--dragging,
  .smc-drag-scroll.smc-drag-scroll--dragging * {
    cursor: grabbing;
    user-select: none;
  }
}
