/**
 * BitStudio Virtual Try-On Extension Styles
 * Mobile-first responsive design
 */

/* Container and Button */
.bitstudio-tryon-container {
  position: relative;
  width: 100%;
  margin: 1rem 0;
  opacity: 0;
  --bitstudio-motion-ease-snap: cubic-bezier(0.22, 0.86, 0.32, 1);
  --bitstudio-motion-ease-commit: cubic-bezier(0.22, 0.86, 0.4, 1);
  --bitstudio-motion-ease-exit: cubic-bezier(0.4, 0, 0.2, 1);
  --bitstudio-motion-160: 160ms;
  --bitstudio-motion-220: 220ms;
  --bitstudio-motion-300: 300ms;
  --bitstudio-motion-380: 380ms;
  --bitstudio-motion-520: 520ms;
  color: var(--bitstudio-surface-text, inherit);
  font-family: var(--bitstudio-button-font-family, var(--bitstudio-font-family, inherit));
  transition: opacity 0.4s ease-out;
}

.bitstudio-tryon-container.bitstudio-visible {
  opacity: 1;
}

.bitstudio-tryon-overlay-host {
  overflow: visible !important;
}

.bitstudio-tryon-container.bitstudio-display-overlay {
  width: min(92vw, 286px);
  max-width: min(92vw, 286px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-button,
.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-dropdown,
.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-panel-controls,
.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-panel-side-controls,
.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-swap-dock {
  pointer-events: auto;
}

.bitstudio-tryon-container--overlay {
  position: absolute;
  max-width: min(92vw, 286px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: var(--bitstudio-overlay-z-index, 1001);
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-panel-active {
  width: var(--bitstudio-panel-open-width, min(92vw, 286px));
  max-width: var(--bitstudio-panel-open-width, min(92vw, 286px));
}

.bitstudio-tryon-container--overlay.bitstudio-overlay-top-right {
  top: var(--bitstudio-overlay-offset-y, 12px);
  right: var(--bitstudio-overlay-offset-x, 12px);
}

.bitstudio-tryon-container--overlay.bitstudio-overlay-top-left {
  top: var(--bitstudio-overlay-offset-y, 12px);
  left: var(--bitstudio-overlay-offset-x, 12px);
}

.bitstudio-tryon-container--overlay.bitstudio-overlay-bottom-right {
  bottom: var(--bitstudio-overlay-offset-y, 12px);
  right: var(--bitstudio-overlay-offset-x, 12px);
}

.bitstudio-tryon-container--overlay.bitstudio-overlay-bottom-left {
  bottom: var(--bitstudio-overlay-offset-y, 12px);
  left: var(--bitstudio-overlay-offset-x, 12px);
}

.bitstudio-tryon-button {
  width: 100%;
  padding: var(--bitstudio-button-padding-y, 0.875rem) var(--bitstudio-button-padding-x, 1.25rem);
  background: var(--bitstudio-button-bg, var(--color-button-primary, #000));
  color: var(--bitstudio-button-text, var(--color-button-primary-text, #fff));
  border: var(--bitstudio-button-border, none);
  border-radius: var(--bitstudio-button-radius, var(--button-radius, 0));
  font-size: var(--bitstudio-button-font-size, var(--button-font-size, 1rem));
  font-family: var(--bitstudio-button-font-family, var(--bitstudio-font-family, inherit));
  font-weight: var(--bitstudio-button-font-weight, var(--button-font-weight, 500));
  line-height: var(--bitstudio-button-line-height, var(--button-line-height, 1.5));
  text-transform: var(--bitstudio-button-text-transform, none);
  letter-spacing: var(--bitstudio-button-letter-spacing, normal);
  box-shadow: var(--bitstudio-button-shadow, none);
  -webkit-backdrop-filter: var(--bitstudio-button-backdrop-filter, none);
  backdrop-filter: var(--bitstudio-button-backdrop-filter, none);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    width var(--bitstudio-motion-300) var(--bitstudio-motion-ease-commit),
    background-color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    border-color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bitstudio-tryon-button::before,
.bitstudio-generate-button::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--bitstudio-progress-width, 0%);
  opacity: var(--bitstudio-progress-opacity, 0);
  background: rgba(255, 255, 255, 0.22);
  background: color-mix(in srgb, currentColor 24%, transparent);
  pointer-events: none;
  z-index: 0;
  transition: width 0.22s ease, opacity 0.18s ease;
}

.bitstudio-tryon-button.bitstudio-button--progress::after {
  content: '';
  position: absolute;
  right: 0.8rem;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  transform: translateY(-50%);
  animation: bitstudio-button-spinner 0.72s linear infinite;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

.bitstudio-tryon-button.bitstudio-button--progress .bitstudio-button-icon {
  opacity: 0;
  transform: none;
}

@keyframes bitstudio-button-spinner {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.bitstudio-tryon-button > *,
.bitstudio-generate-button > * {
  position: relative;
  z-index: 1;
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-button {
  width: auto;
  min-width: 0;
  margin-left: auto;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-top-left .bitstudio-tryon-button,
.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-left .bitstudio-tryon-button {
  margin-left: 0;
  margin-right: auto;
}

.bitstudio-button-icon {
  margin-left: 0.25rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.bitstudio-tryon-button:active:not(:disabled) {
  background: var(--bitstudio-button-hover-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000)));
  color: var(--bitstudio-button-hover-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff)));
  border: var(--bitstudio-button-hover-border, var(--bitstudio-button-border, none));
  box-shadow: var(--bitstudio-button-hover-shadow, var(--bitstudio-button-shadow, none));
  opacity: var(--bitstudio-button-hover-opacity, 1);
  filter: var(--bitstudio-button-hover-filter, none);
}

.bitstudio-tryon-button[aria-expanded="true"] .bitstudio-button-icon {
  transform: rotate(180deg);
}

.bitstudio-button-leading-icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.92;
}

.bitstudio-button-leading-icon svg {
  width: 100%;
  height: 100%;
}

/* Product card availability badge */
.bitstudio-card-badge-host {
  isolation: isolate;
}

.bitstudio-card-badge {
  position: absolute !important;
  inset: 0 !important;
  z-index: 5;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  padding: 8px !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: none !important;
  transition: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
}

.bitstudio-card-badge-host:hover > .bitstudio-card-badge,
.bitstudio-card-badge-host:focus-within > .bitstudio-card-badge,
.bitstudio-card-badge:hover,
.bitstudio-card-badge:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.bitstudio-card-badge-label {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  min-width: 0 !important;
  min-height: 24px;
  flex: 0 0 auto !important;
  padding: 5px 9px;
  overflow: hidden;
  background: var(--bitstudio-card-badge-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000)));
  color: var(--bitstudio-card-badge-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff)));
  border: var(--bitstudio-card-badge-border, var(--bitstudio-button-border, none));
  border-radius: var(--bitstudio-card-badge-radius, var(--bitstudio-button-radius, var(--button-radius, 0)));
  box-shadow: var(--bitstudio-card-badge-shadow, var(--bitstudio-button-shadow, 0 2px 10px rgba(0, 0, 0, 0.18)));
  -webkit-backdrop-filter: var(--bitstudio-button-backdrop-filter, none);
  backdrop-filter: var(--bitstudio-button-backdrop-filter, none);
  font-family: var(--bitstudio-card-badge-font-family, var(--bitstudio-button-font-family, var(--bitstudio-font-family, inherit)));
  font-size: var(--bitstudio-card-badge-font-size, 12px);
  font-weight: var(--bitstudio-button-font-weight, var(--button-font-weight, 600));
  line-height: 1;
  letter-spacing: 0;
  text-transform: var(--bitstudio-button-text-transform, none);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.bitstudio-card-badge[data-position="bottom-left"] {
  justify-content: flex-start !important;
}

.bitstudio-card-badge[data-position="top-right"] {
  align-items: flex-start !important;
}

.bitstudio-card-badge[data-position="top-left"] {
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

/* Dropdown */
.bitstudio-tryon-dropdown {
  background: var(--bitstudio-dropdown-bg, white);
  color: var(--bitstudio-surface-text, inherit);
  border: var(--bitstudio-pane-border, 1px solid var(--bitstudio-surface-border, #e5e5e5));
  border-radius: var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px)));
  box-shadow: var(--bitstudio-pane-shadow, 0 18px 40px rgba(12, 18, 28, 0.16));
  margin-top: 0.75rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  -webkit-clip-path: inset(0 0 100% 0 round var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))));
  clip-path: inset(0 0 100% 0 round var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))));
  transform: translateY(-8px);
  transition:
    max-height var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    -webkit-clip-path var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    clip-path var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit);
  position: relative;
}

.bitstudio-tryon-dropdown[aria-hidden="false"] {
  max-height: 960px;
  opacity: 1;
  -webkit-clip-path: inset(0 0 0 0 round var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))));
  clip-path: inset(0 0 0 0 round var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))));
  transform: translateY(0);
  transition:
    max-height var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    -webkit-clip-path var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit),
    clip-path var(--bitstudio-motion-380) var(--bitstudio-motion-ease-commit);
}

.bitstudio-tryon-dropdown.bitstudio-panel-morphing {
  max-height: none !important;
  opacity: 1 !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
  border-radius: var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))) !important;
  overflow: hidden;
  transition: none !important;
  will-change: transform, width, height;
  pointer-events: none;
}

.bitstudio-tryon-dropdown.bitstudio-panel-morphing .bitstudio-dropdown-content {
  opacity: 1;
  transform: translateY(0);
  transition: none !important;
}

.bitstudio-tryon-dropdown.bitstudio-panel-state-morphing {
  max-height: none !important;
  opacity: 1 !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
  border-radius: var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px))) !important;
  overflow: hidden !important;
  transition: none !important;
  will-change: transform, width, height;
}

.bitstudio-tryon-dropdown.bitstudio-panel-state-morphing .bitstudio-dropdown-content {
  animation: bitstudio-panel-state-content-in var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit) 70ms both;
}

@keyframes bitstudio-panel-state-content-in {
  from {
    opacity: 0;
    transform: translate3d(0, 4px, 0) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.bitstudio-dropdown-content {
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit);
}

.bitstudio-panel-content-reveal {
  will-change: opacity, transform;
}

.bitstudio-panel-content-reveal--in {
  animation: bitstudio-panel-content-reveal-in var(--bitstudio-content-reveal-duration, var(--bitstudio-motion-300)) var(--bitstudio-motion-ease-commit) var(--bitstudio-content-reveal-delay, 0ms) both;
}

.bitstudio-panel-content-reveal--out {
  animation: bitstudio-panel-content-reveal-out var(--bitstudio-content-reveal-duration, var(--bitstudio-motion-220)) var(--bitstudio-motion-ease-exit) var(--bitstudio-content-reveal-delay, 0ms) both;
}

@keyframes bitstudio-panel-content-reveal-in {
  from {
    opacity: 0;
    transform: translate3d(0, var(--bitstudio-content-reveal-y, 5px), 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bitstudio-panel-content-reveal-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 0;
    transform: translate3d(0, -4px, 0);
  }
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-dropdown {
  position: absolute;
  top: var(--bitstudio-panel-anchor-top, 0);
  right: var(--bitstudio-panel-anchor-right, 0);
  margin-top: 0;
  width: var(--bitstudio-panel-open-width, min(92vw, 286px));
  max-height: 0;
  overflow: hidden;
  z-index: 31;
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-dropdown[aria-hidden="false"] {
  max-height: min(78vh, 960px);
  overflow: hidden;
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-dropdown[aria-hidden="true"] {
  pointer-events: none;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-right .bitstudio-tryon-dropdown,
.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-left .bitstudio-tryon-dropdown {
  top: auto;
  bottom: var(--bitstudio-panel-anchor-bottom, 0);
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-top-left .bitstudio-tryon-dropdown,
.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-left .bitstudio-tryon-dropdown {
  left: var(--bitstudio-panel-anchor-left, 0);
  right: auto;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-panel-active .bitstudio-tryon-button {
  visibility: hidden;
  pointer-events: none;
}

.bitstudio-tryon-container.bitstudio-panel-active .bitstudio-tryon-dropdown {
  background: var(--bitstudio-button-bg, var(--color-button-primary, #000));
  color: var(--bitstudio-button-text, var(--color-button-primary-text, #fff));
  border: var(--bitstudio-button-border, none);
  border-radius: var(--bitstudio-panel-radius, var(--bitstudio-dropdown-radius-compact, var(--bitstudio-button-radius-compact, 8px)));
  box-shadow: var(--bitstudio-button-shadow, none);
  -webkit-clip-path: none;
  clip-path: none;
}

.bitstudio-tryon-container.bitstudio-panel-active .bitstudio-tryon-dropdown:not(.bitstudio-panel-morphing) {
  overflow: visible;
}

.bitstudio-tryon-container.bitstudio-panel-active .bitstudio-dropdown-content {
  background: var(--bitstudio-dropdown-bg, #fff);
  color: #111;
  border-radius: inherit;
}

.bitstudio-panel-controls {
  --bitstudio-panel-controls-offset: 5px;
  position: absolute;
  top: calc(var(--bitstudio-panel-surface-top, var(--bitstudio-panel-anchor-top, 0px)) - var(--bitstudio-panel-controls-offset));
  right: calc(var(--bitstudio-panel-anchor-right, 0px) - var(--bitstudio-panel-controls-offset));
  z-index: 33;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  opacity: 1;
  pointer-events: auto;
}

.bitstudio-panel-controls[hidden] {
  display: none;
}

.bitstudio-panel-side-controls {
  --bitstudio-panel-side-controls-offset: 5px;
  --bitstudio-panel-side-open-delay: 150ms;
  position: absolute;
  top: calc(var(--bitstudio-panel-surface-top, var(--bitstudio-panel-anchor-top, 0px)) + 1.1rem);
  left: calc(var(--bitstudio-panel-anchor-right, 0px) - var(--bitstudio-panel-side-controls-offset));
  z-index: 32;
  display: inline-flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(4px);
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    visibility 0ms linear var(--bitstudio-motion-220);
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-panel-side-controls {
  pointer-events: none;
}

.bitstudio-panel-side-controls--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    visibility 0ms linear 0ms;
}

.bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-panel-side-controls--visible {
  pointer-events: auto;
}

.bitstudio-panel-side-controls--visible.bitstudio-panel-side-controls--opening {
  pointer-events: none;
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit) var(--bitstudio-panel-side-open-delay),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit) var(--bitstudio-panel-side-open-delay),
    visibility 0ms linear 0ms;
}

.bitstudio-tryon-container.bitstudio-overlay-top-left .bitstudio-panel-side-controls,
.bitstudio-tryon-container.bitstudio-overlay-bottom-left .bitstudio-panel-side-controls {
  left: auto;
  right: calc(var(--bitstudio-panel-anchor-left, 0px) - var(--bitstudio-panel-side-controls-offset));
  transform: translateX(-4px);
}

.bitstudio-tryon-container.bitstudio-overlay-top-left .bitstudio-panel-side-controls--visible,
.bitstudio-tryon-container.bitstudio-overlay-bottom-left .bitstudio-panel-side-controls--visible {
  transform: translateX(0);
}

.bitstudio-tryon-container.bitstudio-overlay-top-left .bitstudio-panel-controls,
.bitstudio-tryon-container.bitstudio-overlay-bottom-left .bitstudio-panel-controls {
  left: calc(var(--bitstudio-panel-anchor-left, 0px) - var(--bitstudio-panel-controls-offset));
  right: auto;
  flex-direction: row-reverse;
}

.bitstudio-panel-close {
  position: static;
  z-index: 5;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #ef4444;
  border-radius: var(--bitstudio-button-radius-compact, 6px);
  background: #ef4444;
  color: #fff;
  cursor: pointer;
}

.bitstudio-panel-close svg {
  display: block;
  width: 18px;
  height: 18px;
}

.bitstudio-full-room-toggle {
  position: static;
  z-index: 5;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #111;
  border-radius: var(--bitstudio-button-radius-compact, 6px);
  background: #fff;
  color: #111;
  cursor: pointer;
}

.bitstudio-full-room-toggle svg {
  display: block;
  width: 17px;
  height: 17px;
  transform: rotate(45deg);
  transition: transform var(--bitstudio-motion-300) var(--bitstudio-motion-ease-snap);
}

.bitstudio-full-room-toggle:focus-visible,
.bitstudio-panel-close:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-full-room-active {
  --bitstudio-full-room-width: min(1280px, calc(100vw - clamp(16px, 4vw, 48px)));
  --bitstudio-full-room-height: min(920px, calc(100dvh - clamp(16px, 4vw, 48px)));
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  box-sizing: border-box;
  display: grid !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: clamp(8px, 2vw, 24px);
  place-items: center !important;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.58);
  opacity: 1;
  pointer-events: auto;
  transform: none !important;
}

.bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-tryon-button,
.bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-panel-side-controls,
.bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-swap-dock {
  display: none !important;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-full-room-active .bitstudio-tryon-dropdown {
  position: relative !important;
  inset: auto !important;
  box-sizing: border-box;
  width: var(--bitstudio-full-room-width);
  max-width: none !important;
  height: var(--bitstudio-full-room-height);
  max-height: none !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0;
  border-radius: 0;
  background: #f8f7f2;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  color: #111;
  opacity: 1;
  transform: none;
}

.bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-dropdown-content {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #f8f7f2;
}

.bitstudio-full-room-shell,
.bitstudio-full-room-mount,
.bitstudio-full-room-mount > .bitstudio-interactive-room {
  width: 100%;
  height: 100%;
  min-height: 0;
}

/*
 * Shadow DOM does not make its host non-empty for :empty selectors. Some
 * storefront themes hide empty elements, so keep the managed room host in
 * layout after its temporary light-DOM loading status is replaced by the
 * renderer's shadow root.
 */
.bitstudio-full-room-mount > .bitstudio-interactive-room {
  display: block !important;
  min-width: 0;
}

.bitstudio-full-room-mount {
  --virtual-fit-room-height: 100%;
  --virtual-fit-room-min-height: 0;
  overflow: hidden;
}

.bitstudio-full-room-mount .bitstudio-interactive-room-status,
.bitstudio-full-room-error {
  box-sizing: border-box;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-content: center;
  gap: 16px;
  padding: 32px;
  background: #f8f7f2;
  color: #111;
  font: 600 11px/1.5 var(--bitstudio-font-family, sans-serif);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.bitstudio-full-room-error button {
  min-width: 120px;
  min-height: 40px;
  border: 1px solid #111;
  border-radius: 0;
  background: #111;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-panel-controls {
  --bitstudio-panel-controls-offset: 12px;
  top: calc((100dvh - var(--bitstudio-full-room-height)) / 2 + var(--bitstudio-panel-controls-offset));
  right: calc((100vw - var(--bitstudio-full-room-width)) / 2 + var(--bitstudio-panel-controls-offset));
  left: auto;
  z-index: 2147483002;
  flex-direction: row;
}

.bitstudio-tryon-container.bitstudio-full-room-active.bitstudio-overlay-top-left .bitstudio-panel-controls,
.bitstudio-tryon-container.bitstudio-full-room-active.bitstudio-overlay-bottom-left .bitstudio-panel-controls {
  right: auto;
  left: calc((100vw - var(--bitstudio-full-room-width)) / 2 + var(--bitstudio-panel-controls-offset));
  flex-direction: row-reverse;
}

.bitstudio-tryon-dropdown.bitstudio-full-room-morphing {
  max-height: none !important;
  overflow: hidden !important;
  transition: none !important;
  will-change: transform, width, height;
  pointer-events: none;
}

@media (max-width: 639px) {
  .bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-full-room-active {
    --bitstudio-full-room-width: 100vw;
    --bitstudio-full-room-height: 100dvh;
    padding: 0;
  }

  .bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-full-room-active .bitstudio-tryon-dropdown {
    width: 100vw;
    height: 100dvh;
  }

  .bitstudio-tryon-container.bitstudio-full-room-active .bitstudio-panel-controls {
    top: 10px;
    right: 10px;
    left: auto;
    flex-direction: row;
  }

  .bitstudio-tryon-container.bitstudio-full-room-active.bitstudio-overlay-top-left .bitstudio-panel-controls,
  .bitstudio-tryon-container.bitstudio-full-room-active.bitstudio-overlay-bottom-left .bitstudio-panel-controls {
    right: auto;
    left: 10px;
    flex-direction: row-reverse;
  }
}

.bitstudio-tryon-container[data-bitstudio-panel-transition="closing"] .bitstudio-panel-controls,
.bitstudio-tryon-container[data-bitstudio-panel-transition="closing"] .bitstudio-panel-side-controls,
.bitstudio-tryon-container[data-bitstudio-panel-transition="closing"] .bitstudio-builder-topbar {
  opacity: 0 !important;
  visibility: hidden;
  transition: none !important;
}

.bitstudio-tryon-container[data-bitstudio-closing-detail="true"] .bitstudio-detail-media {
  opacity: 0;
  visibility: hidden;
  transition: none !important;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-top-left,
.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-left {
  align-items: flex-start;
}

.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-top-left .bitstudio-swap-dock--outside,
.bitstudio-tryon-container.bitstudio-display-overlay.bitstudio-overlay-bottom-left .bitstudio-swap-dock--outside {
  justify-content: flex-start;
}

.bitstudio-dropdown-content {
  padding: 1.1rem 1rem 0.82rem;
  font-family: var(--bitstudio-font-family, inherit);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bitstudio-builder-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #111;
}

.bitstudio-builder-topbar {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bitstudio-builder-title {
  min-width: 0;
  overflow: hidden;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bitstudio-icon-button,
.bitstudio-swap-photo-button,
.bitstudio-hanger-action,
.bitstudio-row-cart-button,
.bitstudio-detail-primary,
.bitstudio-detail-secondary,
.bitstudio-detail-nav-button,
.bitstudio-detail-replace-button {
  border-radius: var(--bitstudio-button-radius-compact, 6px);
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.bitstudio-icon-button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bitstudio-icon-button svg {
  display: block;
  flex: 0 0 auto;
}

.bitstudio-tryon-container.bitstudio-overlay-top-left .bitstudio-back-button svg,
.bitstudio-tryon-container.bitstudio-overlay-bottom-left .bitstudio-back-button svg {
  transform: scaleX(-1);
}

.bitstudio-swap-photo-button {
  width: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    background-color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    visibility 0ms linear 0ms;
}

.bitstudio-swap-photo-button--active {
  background: #111;
  color: #fff;
}

.bitstudio-swap-photo-button--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    visibility 0ms linear var(--bitstudio-motion-220);
}

.bitstudio-outfit-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bitstudio-outfit-row {
  --bitstudio-row-media-width: 48px;
  --bitstudio-row-media-height: 68px;
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) var(--bitstudio-row-media-width);
  align-items: center;
  column-gap: 8px;
  min-height: 80px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid #b9bec6;
  background: #fff;
  color: #111;
  cursor: pointer;
  touch-action: none;
  transition:
    grid-template-columns var(--bitstudio-motion-300) var(--bitstudio-motion-ease-commit),
    border-color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit),
    background-color var(--bitstudio-motion-160) var(--bitstudio-motion-ease-commit);
}

.bitstudio-outfit-row--initial-reveal {
  animation: bitstudio-row-initial-reveal var(--bitstudio-row-reveal-duration, var(--bitstudio-motion-380)) var(--bitstudio-motion-ease-commit) var(--bitstudio-row-reveal-delay, 0ms) both;
  pointer-events: none;
  will-change: opacity, transform;
}

.bitstudio-tryon-container[data-bitstudio-panel-transition="closing"] .bitstudio-outfit-row--initial-reveal {
  animation-name: bitstudio-row-initial-reveal-out;
  animation-timing-function: var(--bitstudio-motion-ease-exit);
}

@keyframes bitstudio-row-initial-reveal {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes bitstudio-row-initial-reveal-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate3d(0, -5px, 0) scale(0.99);
  }
}

.bitstudio-outfit-row--locked {
  grid-template-columns: var(--bitstudio-row-media-width) minmax(0, 1fr) var(--bitstudio-row-media-width);
  border-color: #111;
  overflow: visible;
}

.bitstudio-outfit-row--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 1px dashed #b9bec6;
  color: #5d6470;
  font-size: 12px;
}

.bitstudio-outfit-row--film {
  display: block;
  min-height: 80px;
  padding: 0;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.bitstudio-row-film-viewport {
  width: 100%;
  min-height: 78px;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.bitstudio-row-film-track {
  display: flex;
  width: 100%;
  min-height: 78px;
  transform: translateX(0);
}

.bitstudio-row-film-cell {
  flex: 0 0 100%;
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) var(--bitstudio-row-media-width);
  align-items: center;
  column-gap: 8px;
  padding: 6px;
}

.bitstudio-hanger-action {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #12843d;
  transition:
    transform var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    border-color var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    background-color var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit),
    color var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit);
}

.bitstudio-outfit-row--locked .bitstudio-hanger-action {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 22px;
  height: 22px;
  border-color: #ef4444;
  border: 1px solid #ef4444;
  background: #ef4444;
  color: #fff;
  transform: none;
}

.bitstudio-outfit-row--locked .bitstudio-hanger-action svg {
  width: 15px;
  height: 15px;
  transform: rotate(-8deg);
  transform-origin: center;
}

.bitstudio-row-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 0;
}

.bitstudio-row-title,
.bitstudio-detail-title {
  min-width: 0;
  overflow: hidden;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bitstudio-row-subtitle,
.bitstudio-detail-price {
  margin-top: 3px;
  min-width: 0;
  overflow: hidden;
  color: #69707c;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bitstudio-detail-compare-price {
  margin-left: 6px;
  color: #9aa1ad;
  text-decoration: line-through;
}

.bitstudio-outfit-row--suggestion .bitstudio-row-subtitle {
  color: #8a9099;
}

.bitstudio-row-media {
  grid-column: 3;
  grid-row: 1;
  width: var(--bitstudio-row-media-width);
  height: var(--bitstudio-row-media-height);
  justify-self: end;
  overflow: hidden;
  border: var(--bitstudio-card-outline, 1px solid #d5d8de);
  border-radius: var(--bitstudio-card-radius-compact, 6px);
  background: var(--bitstudio-card-bg, #f5f6f7);
  transform-origin: center;
}

.bitstudio-outfit-row--locked .bitstudio-row-media {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: var(--bitstudio-row-media-width);
  height: var(--bitstudio-row-media-height);
}

.bitstudio-row-media img,
.bitstudio-detail-media img,
.bitstudio-cart-strip-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.bitstudio-row-cart-button {
  grid-column: 3;
  grid-row: 1;
  align-self: stretch;
  justify-self: stretch;
  width: var(--bitstudio-row-media-width);
  min-height: var(--bitstudio-row-media-height);
  padding: 0 5px;
  border: var(--bitstudio-button-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111)));
  border-radius: var(--bitstudio-button-radius-compact, 6px);
  background: var(--bitstudio-button-bg, var(--color-button-primary, #111));
  color: var(--bitstudio-button-text, var(--color-button-primary-text, #fff));
  box-shadow: var(--bitstudio-button-shadow, none);
  font-family: var(--bitstudio-button-font-family, var(--bitstudio-font-family, inherit));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.05;
}

.bitstudio-row-cart-button svg {
  display: block;
  margin: auto;
}

.bitstudio-row-cart-button:disabled,
.bitstudio-detail-primary:disabled {
  border: var(--bitstudio-button-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111)));
  background: var(--bitstudio-button-bg, var(--color-button-primary, #111));
  color: var(--bitstudio-button-text, var(--color-button-primary-text, #fff));
  box-shadow: var(--bitstudio-button-shadow, none);
  cursor: default;
  opacity: 0.62;
}

.bitstudio-cart-area {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.bitstudio-cart-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--bitstudio-surface-text, #5d6470);
  opacity: 0.54;
}

.bitstudio-cart-divider span:not(.bitstudio-cart-divider-icon) {
  height: 1px;
  background: var(--bitstudio-surface-border, rgba(12, 18, 28, 0.18));
}

.bitstudio-cart-divider-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.bitstudio-cart-divider-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.bitstudio-cart-strip {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 2px;
  scrollbar-width: none;
}

.bitstudio-cart-strip::-webkit-scrollbar {
  display: none;
}

.bitstudio-cart-strip-item {
  flex: 0 0 34px;
  width: 34px;
  aspect-ratio: 12 / 17;
  height: auto;
  padding: 0;
  overflow: hidden;
  border: var(--bitstudio-card-outline, 1px solid #b9bec6);
  border-radius: var(--bitstudio-card-radius-compact, 6px);
  background: var(--bitstudio-card-bg, #f5f6f7);
}

.bitstudio-generate-stack--builder {
  gap: 6px;
}

.bitstudio-builder-shell--single-product,
.bitstudio-generate-stack--single-product {
  gap: 6px;
}

.bitstudio-detail-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.bitstudio-detail-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bitstudio-detail-media-frame {
  width: min(100%, 222px);
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: var(--bitstudio-card-outline, 1px solid #d5d8de);
  border-radius: var(--bitstudio-card-radius-detail, var(--bitstudio-card-radius-compact, 8px));
  background: var(--bitstudio-card-bg, #f5f6f7);
  cursor: pointer;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.bitstudio-detail-media-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.bitstudio-detail-media--image-next .bitstudio-detail-media-frame img {
  animation: bitstudio-detail-image-next var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit) both;
}

.bitstudio-detail-media--image-prev .bitstudio-detail-media-frame img {
  animation: bitstudio-detail-image-prev var(--bitstudio-motion-220) var(--bitstudio-motion-ease-commit) both;
}

.bitstudio-detail-view--rec-next > *,
.bitstudio-detail-view--rec-prev > * {
  animation-duration: var(--bitstudio-motion-220);
  animation-timing-function: var(--bitstudio-motion-ease-commit);
  animation-fill-mode: both;
}

.bitstudio-detail-view--rec-next > * {
  animation-name: bitstudio-detail-rec-next;
}

.bitstudio-detail-view--rec-prev > * {
  animation-name: bitstudio-detail-rec-prev;
}

@keyframes bitstudio-detail-image-next {
  from {
    opacity: 0.72;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bitstudio-detail-image-prev {
  from {
    opacity: 0.72;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bitstudio-detail-rec-next {
  from {
    opacity: 0.72;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bitstudio-detail-rec-prev {
  from {
    opacity: 0.72;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bitstudio-detail-media-dots {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 12px;
  min-width: 0;
  padding: 0;
}

.bitstudio-detail-media-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  opacity: 0.44;
  cursor: pointer;
}

.bitstudio-detail-media-dot--active {
  background: #111;
  opacity: 1;
}

.bitstudio-detail-media-dot:only-child {
  cursor: default;
}

.bitstudio-detail-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 12px;
  min-width: 0;
}

.bitstudio-detail-copy-main {
  flex: 1 1 0;
  min-width: min(50%, 200px);
}

.bitstudio-detail-title {
  font-size: 14px;
}

.bitstudio-variant-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #111;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.bitstudio-builder-title--look {
  font-weight: 500;
}

.bitstudio-variant-picker select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: inherit;
}

.bitstudio-option-picker {
  min-width: 0;
}

/* Color picker lives in the detail copy row, right of title/price.
   It wraps below the title on narrow widths (flex-wrap on the copy row). */
.bitstudio-detail-copy .bitstudio-option-picker--color {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
}

.bitstudio-detail-copy .bitstudio-option-picker--color .bitstudio-color-swatches {
  justify-content: flex-end;
}

.bitstudio-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
}

/* Swatch button is the >=32px tap target; the visible chip inside is ~24px. */
.bitstudio-swatch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 4px;
  border: 0;
  background: none;
  color: #111;
  cursor: pointer;
}

.bitstudio-swatch-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--bitstudio-swatch-radius, var(--bitstudio-button-radius-compact, 6px));
  background: #fff;
}

.bitstudio-swatch-chip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bitstudio-swatch-chip--text {
  width: auto;
  min-width: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

/* Selected = ring around the chip: gap then a thin outline. */
.bitstudio-swatch.is-selected .bitstudio-swatch-chip {
  outline: 1px solid #111;
  outline-offset: 2px;
}

.bitstudio-swatch.is-unavailable {
  opacity: 0.4;
}

.bitstudio-size-popover {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 40px;
  right: 56px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  padding: 8px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  cursor: default;
}

.bitstudio-size-popover-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.bitstudio-size-popover-values {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
}

.bitstudio-size-popover button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.bitstudio-size-popover button:disabled {
  border-color: #b9bec6;
  color: #b9bec6;
  opacity: 0.6;
  cursor: default;
}

.bitstudio-row-cart-button.is-loading {
  opacity: 0.6;
  cursor: progress;
}

.bitstudio-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.bitstudio-detail-actions--single {
  grid-template-columns: 1fr;
}

.bitstudio-detail-actions--recommendation {
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: stretch;
}

.bitstudio-detail-primary,
.bitstudio-detail-secondary,
.bitstudio-detail-nav-button,
.bitstudio-detail-replace-button {
  min-height: 36px;
  padding: 0 8px;
  border-radius: var(--bitstudio-button-radius-compact, 6px);
  font-family: var(--bitstudio-button-font-family, var(--bitstudio-font-family, inherit));
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
}

.bitstudio-detail-primary {
  border: var(--bitstudio-button-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111)));
  background: var(--bitstudio-button-bg, var(--color-button-primary, #111));
  color: var(--bitstudio-button-text, var(--color-button-primary-text, #fff));
  box-shadow: var(--bitstudio-button-shadow, none);
}

.bitstudio-detail-secondary,
.bitstudio-detail-nav-button,
.bitstudio-detail-replace-button,
.bitstudio-back-button {
  border: var(--bitstudio-secondary-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111)));
  border-radius: var(--bitstudio-secondary-radius-compact, var(--bitstudio-button-radius-compact, 6px));
  background: var(--bitstudio-secondary-bg, var(--bitstudio-card-bg, #fff));
  color: var(--bitstudio-secondary-text, var(--bitstudio-button-bg, var(--color-button-primary, #111)));
  box-shadow: var(--bitstudio-secondary-shadow, none);
}

.bitstudio-detail-nav-button {
  display: grid;
  place-items: center;
  padding: 0;
}

.bitstudio-detail-nav-button svg {
  display: block;
}

.bitstudio-detail-nav-button:disabled {
  border-color: #b9bec6;
  color: #b9bec6;
  cursor: default;
}

.bitstudio-detail-replace-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.bitstudio-detail-replace-options--single {
  grid-template-columns: 1fr;
}

.bitstudio-detail-replace-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.bitstudio-detail-replace-button img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: var(--bitstudio-secondary-radius-compact, var(--bitstudio-button-radius-compact, 6px));
}

.bitstudio-detail-replace-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bitstudio-media-wipe-image {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
}

.bitstudio-branding--compact {
  display: block;
  margin: 0;
  color: #6b7280 !important;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.bitstudio-branding--compact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit !important;
  text-decoration: none !important;
}

.bitstudio-branding--compact img {
  /* Reserve the wordmark's box before the asset loads so panel-state morph
     measurements never shift when the logo pops in. */
  aspect-ratio: 1091 / 235;
  width: 48px !important;
  max-width: 48px !important;
  height: auto !important;
  display: block;
  opacity: var(--bitstudio-branding-opacity, 0.42);
}

.bitstudio-generated-thumbnail {
  position: relative;
}

.bitstudio-generated-thumbnail [data-bitstudio-generated="true"],
.bitstudio-generated-thumbnail img {
  display: block;
}

.bitstudio-generated-thumbnail--active {
  outline: 2px solid var(--bitstudio-button-bg, #111111);
  outline-offset: 2px;
}

/* Upload Area with CSS variables for customization */
.bitstudio-upload-area {
  margin-bottom: 0.25rem;
  --photo-aspect-ratio: 3/4; /* Default portrait */
  --photo-max-height: 120px;
  --photo-width-portrait: 90px;
  --photo-width-square: 80px;
}

/* Apply aspect ratio styles based on data attribute */
.bitstudio-upload-area[data-photo-aspect="square"] {
  --photo-aspect-ratio: 1/1;
}

.bitstudio-upload-area[data-photo-aspect="portrait"] {
  --photo-aspect-ratio: 3/4;
}

.bitstudio-upload-area[data-photo-aspect="auto"] {
  --photo-aspect-ratio: unset;
}

.bitstudio-photos-container {
  width: 100%;
}

.bitstudio-photos-grid {
  display: block;
  padding: 0;
  min-height: 0;
  border-radius: var(--bitstudio-upload-card-radius, var(--bitstudio-card-radius, 2px));
  transition: all 0.3s ease;
}

.bitstudio-photos-grid--empty {
  display: flex;
  justify-content: center;
}

.bitstudio-photos-grid.drag-over {
  background: rgba(16, 21, 31, 0.04);
  border: 1px dashed rgba(16, 21, 31, 0.22);
  padding: 0.5rem;
}

.bitstudio-photo-stage {
  position: relative;
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem 1.55rem;
  overscroll-behavior: contain;
}

.bitstudio-photo-stage--carousel {
  overflow: visible;
  touch-action: pan-y;
  cursor: ew-resize;
}

.bitstudio-photo-item {
  position: relative;
  width: var(--photo-width-portrait);
  aspect-ratio: var(--photo-aspect-ratio);
  max-height: none;
  padding: 0;
  appearance: none;
  border: none;
  border-radius: var(--bitstudio-upload-card-radius, var(--bitstudio-card-radius, 0));
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bitstudio-card-bg, rgba(255, 255, 255, 0.96));
  background-clip: padding-box;
  box-shadow: 0 18px 34px rgba(12, 18, 28, 0.12);
  isolation: isolate;
}

.bitstudio-photo-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--bitstudio-card-outline, 1px solid rgba(12, 18, 28, 0.12));
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
}

/* Square mode specific sizing */
.bitstudio-upload-area[data-photo-aspect="square"] .bitstudio-photo-item {
  width: var(--photo-width-square);
  height: var(--photo-width-square);
  aspect-ratio: unset;
}

/* Auto mode - preserve original aspect ratio */
.bitstudio-upload-area[data-photo-aspect="auto"] .bitstudio-photo-item {
  width: auto;
  height: auto;
  max-width: var(--photo-max-height);
  max-height: var(--photo-max-height);
  background: var(--bitstudio-card-bg, #f5f5f5);
}

.bitstudio-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* Use contain only for auto mode to preserve aspect ratio */
.bitstudio-upload-area[data-photo-aspect="auto"] .bitstudio-photo-item img {
  object-fit: contain;
  background: var(--bitstudio-card-bg, #f5f5f5);
}

.bitstudio-photo-item.selected {
  transform: translateY(0);
}

.bitstudio-photo-item--spotlight {
  z-index: 2;
}

.bitstudio-photo-item--ghost {
  position: absolute;
  top: 50%;
  bottom: auto;
  width: 72px;
  max-height: none;
  opacity: 0.46;
  transform: translateY(-50%) scale(0.94);
  border-color: rgba(12, 18, 28, 0.08);
  box-shadow: 0 10px 20px rgba(12, 18, 28, 0.08);
  filter: saturate(0.8);
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

.bitstudio-photo-item--ghost::after {
  border-color: rgba(12, 18, 28, 0.08);
}

.bitstudio-photo-ghost--prev {
  left: calc(50% - 74px);
}

.bitstudio-photo-ghost--next {
  left: calc(50% + 18px);
}

.bitstudio-photo-selected-ring {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--bitstudio-card-border-color, rgba(12, 18, 28, 0.18)) 78%, transparent);
  border-radius: inherit;
  pointer-events: none;
}

.bitstudio-photo-remove {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.8rem;
  height: 1.8rem;
  background: rgba(12, 18, 28, 0.68);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.bitstudio-photo-item:hover .bitstudio-photo-remove {
  transform: scale(1.04);
}

/* Uploading state */
.bitstudio-photo-item.uploading {
  background: var(--bitstudio-card-bg, #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Adapt uploading state to aspect ratio */
.bitstudio-upload-area[data-photo-aspect="square"] .bitstudio-photo-item.uploading {
  width: var(--photo-width-square);
  height: var(--photo-width-square);
}

.bitstudio-upload-spinner {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}

.bitstudio-upload-new {
  --bitstudio-upload-outline-color: var(--bitstudio-photo-slot-border-color, var(--bitstudio-card-border-color, #ccc));
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--photo-width-portrait);
  min-height: 0;
  aspect-ratio: var(--photo-aspect-ratio);
  border: 2px solid transparent;
  border-radius: var(--bitstudio-upload-card-radius, var(--bitstudio-card-radius, 0));
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bitstudio-card-bg, rgba(248, 249, 251, 0.95));
  background-clip: padding-box;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: inherit;
  overflow: hidden;
  isolation: isolate;
}

/* Keep copied merchant stylesheets from repainting the native border. */
.bitstudio-upload-area:not([data-border-style="dotted"]) .bitstudio-upload-new,
.bitstudio-upload-area:not([data-border-style="dotted"]) .bitstudio-upload-slot {
  border: 2px solid transparent;
}

/* Paint outlines inside the upload layer so WebKit clipping/compositing cannot drop an edge. */
.bitstudio-upload-area:not([data-border-style="dotted"]) .bitstudio-upload-new::after,
.bitstudio-upload-area:not([data-border-style="dotted"]) .bitstudio-upload-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-sizing: border-box;
  border: 1px dashed var(--bitstudio-upload-outline-color);
  pointer-events: none;
}

.bitstudio-upload-area[data-border-style="solid"] .bitstudio-upload-new::after,
.bitstudio-upload-area[data-border-style="solid"] .bitstudio-upload-slot::after {
  border: 0;
  box-shadow: inset 0 0 0 2px var(--bitstudio-upload-outline-color);
}

.bitstudio-upload-new--empty {
  max-width: none;
}

.bitstudio-upload-new--empty .bitstudio-upload-text {
  max-width: none;
  font-size: 0.95rem;
  line-height: 1.2;
}

.bitstudio-upload-new:hover {
  --bitstudio-upload-outline-color: var(--color-button-primary, #000);
  background: rgba(0, 0, 0, 0.02);
}

.bitstudio-photos-grid.drag-over .bitstudio-upload-new {
  --bitstudio-upload-outline-color: var(--color-button-primary, #000);
  transform: scale(1.05);
}

.bitstudio-upload-slot {
  --bitstudio-upload-outline-color: var(--bitstudio-photo-slot-border-color, var(--bitstudio-card-border-color, rgba(12, 18, 28, 0.22)));
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 50%;
  bottom: auto;
  width: 72px;
  aspect-ratio: var(--photo-aspect-ratio);
  border: 2px solid transparent;
  border-radius: var(--bitstudio-upload-card-radius, var(--bitstudio-card-radius, 0));
  background: var(--bitstudio-card-bg, rgba(245, 247, 250, 0.94));
  box-shadow: 0 10px 20px rgba(12, 18, 28, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transform: translateY(-50%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: inherit;
  overflow: hidden;
}

.bitstudio-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.bitstudio-upload-new:focus-within,
.bitstudio-upload-slot:focus-within {
  outline: 2px solid var(--color-button-primary, #000);
  outline-offset: 2px;
}

.bitstudio-upload-area[data-border-style="dotted"] .bitstudio-upload-new,
.bitstudio-upload-area[data-border-style="dotted"] .bitstudio-upload-slot {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bitstudio-photo-slot-border-color, rgba(12, 18, 28, 0.28)) 10%, transparent);
}

.bitstudio-upload-area[data-border-style="dotted"] .bitstudio-upload-new::after,
.bitstudio-upload-area[data-border-style="dotted"] .bitstudio-upload-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--bitstudio-photo-slot-border-color, rgba(12, 18, 28, 0.28)) 1.05px, transparent 1.35px) top center / 12px 4px repeat-x,
    radial-gradient(circle, var(--bitstudio-photo-slot-border-color, rgba(12, 18, 28, 0.28)) 1.05px, transparent 1.35px) bottom center / 12px 4px repeat-x,
    radial-gradient(circle, var(--bitstudio-photo-slot-border-color, rgba(12, 18, 28, 0.28)) 1.05px, transparent 1.35px) left center / 4px 12px repeat-y,
    radial-gradient(circle, var(--bitstudio-photo-slot-border-color, rgba(12, 18, 28, 0.28)) 1.05px, transparent 1.35px) right center / 4px 12px repeat-y;
  opacity: 0.84;
}

.bitstudio-upload-slot:hover {
  transform: translateY(calc(-50% - 1px));
  box-shadow: 0 14px 24px rgba(12, 18, 28, 0.12);
}

.bitstudio-upload-slot--prev {
  left: calc(50% - 74px);
  opacity: 0.82;
}

.bitstudio-upload-slot--next {
  left: calc(50% + 18px);
  opacity: 0.88;
}

.bitstudio-upload-slot--spotlight {
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  width: var(--photo-width-portrait);
  z-index: 2;
  opacity: 1;
  transform: none;
  box-shadow: 0 18px 34px rgba(12, 18, 28, 0.12);
}

.bitstudio-upload-slot--spotlight:hover {
  transform: translateY(-1px);
}

.bitstudio-upload-slot--spotlight .bitstudio-upload-content {
  gap: 0.2rem;
  padding: 0.45rem 0.3rem;
}

.bitstudio-upload-slot--spotlight .bitstudio-upload-icon {
  width: 24px;
  height: 24px;
}

.bitstudio-upload-slot--spotlight .bitstudio-upload-text {
  max-width: 86px;
  font-size: 0.8rem;
  line-height: 1.15;
  letter-spacing: normal;
  text-transform: none;
}

.bitstudio-upload-slot .bitstudio-upload-content {
  gap: 0.24rem;
  padding: 0.35rem 0.2rem;
}

.bitstudio-upload-slot .bitstudio-upload-icon {
  width: 18px;
  height: 18px;
}

.bitstudio-upload-slot .bitstudio-upload-text {
  max-width: 60px;
  font-size: 0.62rem;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bitstudio-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.bitstudio-upload-icon {
  color: var(--bitstudio-surface-text, #4a5565);
  opacity: 0.78;
}

/* Animated turntable avatar shown in empty upload slots (SVG via <img>).
   Storefront themes commonly apply broad product-image rules such as
   `img { width: 100%; height: auto; }`. Pin both axes with enough specificity
   to keep the avatar from consuming the label space inside the upload card. */
.bitstudio-tryon-container img.bitstudio-upload-avatar {
  box-sizing: border-box;
  height: 72px !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 72px !important;
  aspect-ratio: 75 / 94 !important;
  object-fit: contain;
  filter: var(--bitstudio-branding-filter, none);
  opacity: 0.78;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.bitstudio-tryon-container .bitstudio-upload-new--empty img.bitstudio-upload-avatar {
  height: 64px !important;
  max-height: 64px !important;
}

.bitstudio-tryon-container .bitstudio-upload-slot img.bitstudio-upload-avatar {
  height: 50px !important;
  max-height: 50px !important;
}

.bitstudio-tryon-container .bitstudio-upload-slot--spotlight img.bitstudio-upload-avatar {
  height: 72px !important;
  max-height: 72px !important;
}

.bitstudio-upload-text {
  font-size: 0.72rem;
  color: var(--bitstudio-surface-text, #2d3643);
  opacity: 0.82;
  text-align: center;
  max-width: 78px;
  line-height: 1.25;
  font-weight: 500;
}

.bitstudio-upload-hint {
  display: block;
  margin: 0.25rem 0 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #687282;
  text-align: center;
}

.bitstudio-photo-swap-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #687282;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.bitstudio-photo-retention-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--bitstudio-surface-text, #687282);
  white-space: nowrap;
  opacity: 0.68;
  pointer-events: none;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .bitstudio-photo-stage--carousel:hover .bitstudio-photo-swap-hint,
  .bitstudio-photo-stage--carousel:focus-within .bitstudio-photo-swap-hint,
  .bitstudio-photos-grid.bitstudio-photo-stage-scrolling .bitstudio-photo-swap-hint {
    opacity: 0.92;
  }
}

@media (hover: hover) and (pointer: fine) {
  .bitstudio-tryon-button:hover:not(:disabled) {
    background: var(--bitstudio-button-hover-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000)));
    color: var(--bitstudio-button-hover-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff)));
    border: var(--bitstudio-button-hover-border, var(--bitstudio-button-border, none));
    box-shadow: var(--bitstudio-button-hover-shadow, var(--bitstudio-button-shadow, none));
    opacity: var(--bitstudio-button-hover-opacity, 1);
    filter: var(--bitstudio-button-hover-filter, none);
  }

  .bitstudio-generate-button:hover:not(:disabled) {
    background: var(--bitstudio-generate-hover-bg, var(--bitstudio-generate-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000))));
    color: var(--bitstudio-generate-hover-text, var(--bitstudio-generate-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff))));
    border: var(--bitstudio-generate-hover-border, var(--bitstudio-generate-border, var(--bitstudio-button-border, none)));
    box-shadow: var(--bitstudio-generate-hover-shadow, var(--bitstudio-generate-shadow, var(--bitstudio-button-shadow, none)));
    opacity: var(--bitstudio-generate-hover-opacity, 1);
    filter: var(--bitstudio-generate-hover-filter, none);
  }

  .bitstudio-row-cart-button:hover:not(:disabled),
  .bitstudio-detail-primary:hover:not(:disabled) {
    background: var(--bitstudio-button-hover-bg, var(--bitstudio-button-bg, var(--color-button-primary, #111)));
    color: var(--bitstudio-button-hover-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff)));
    border: var(--bitstudio-button-hover-border, var(--bitstudio-button-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111))));
    box-shadow: var(--bitstudio-button-hover-shadow, var(--bitstudio-button-shadow, none));
    opacity: var(--bitstudio-button-hover-opacity, 1);
    filter: var(--bitstudio-button-hover-filter, none);
  }

  .bitstudio-detail-secondary:hover:not(:disabled),
  .bitstudio-detail-nav-button:hover:not(:disabled),
  .bitstudio-detail-replace-button:hover:not(:disabled),
  .bitstudio-back-button:hover:not(:disabled) {
    background: var(--bitstudio-secondary-hover-bg, var(--bitstudio-secondary-bg, var(--bitstudio-card-bg, #fff)));
    color: var(--bitstudio-secondary-hover-text, var(--bitstudio-secondary-text, var(--bitstudio-button-bg, var(--color-button-primary, #111))));
    border: var(--bitstudio-secondary-hover-border, var(--bitstudio-secondary-border, 1px solid var(--bitstudio-button-bg, var(--color-button-primary, #111))));
    box-shadow: var(--bitstudio-secondary-hover-shadow, var(--bitstudio-secondary-shadow, none));
    opacity: var(--bitstudio-secondary-hover-opacity, 1);
    filter: var(--bitstudio-secondary-hover-filter, none);
  }
}

.bitstudio-photo-stage--animate-next .bitstudio-photo-item--spotlight,
.bitstudio-photo-stage--animate-next .bitstudio-upload-slot--spotlight {
  animation: bitstudio-carousel-center-from-right 0.24s ease;
}

.bitstudio-photo-stage--animate-next .bitstudio-photo-ghost--prev {
  animation: bitstudio-carousel-left-from-center 0.24s ease;
}

.bitstudio-photo-stage--animate-next .bitstudio-upload-slot--prev {
  animation: bitstudio-carousel-upload-left-from-center 0.24s ease;
}

.bitstudio-photo-stage--animate-next .bitstudio-photo-ghost--next {
  animation: bitstudio-carousel-photo-right-settle 0.24s ease;
}

.bitstudio-photo-stage--animate-next .bitstudio-upload-slot--next {
  animation: bitstudio-carousel-upload-right-settle 0.24s ease;
}

.bitstudio-photo-stage--animate-prev .bitstudio-photo-item--spotlight,
.bitstudio-photo-stage--animate-prev .bitstudio-upload-slot--spotlight {
  animation: bitstudio-carousel-center-from-left 0.24s ease;
}

.bitstudio-photo-stage--animate-prev .bitstudio-photo-ghost--next {
  animation: bitstudio-carousel-right-from-center 0.24s ease;
}

.bitstudio-photo-stage--animate-prev .bitstudio-upload-slot--next {
  animation: bitstudio-carousel-upload-right-from-center 0.24s ease;
}

.bitstudio-photo-stage--animate-prev .bitstudio-photo-ghost--prev {
  animation: bitstudio-carousel-photo-left-settle 0.24s ease;
}

.bitstudio-photo-stage--animate-prev .bitstudio-upload-slot--prev {
  animation: bitstudio-carousel-upload-left-settle 0.24s ease;
}

@keyframes bitstudio-carousel-center-from-right {
  from {
    opacity: 0.5;
    transform: translate(38px, 0) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes bitstudio-carousel-center-from-left {
  from {
    opacity: 0.5;
    transform: translate(-38px, 0) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes bitstudio-carousel-left-from-center {
  from {
    opacity: 0.95;
    transform: translateY(-50%) translateX(28px) scale(1);
  }
  to {
    opacity: 0.46;
    transform: translateY(-50%) translateX(0) scale(0.94);
  }
}

@keyframes bitstudio-carousel-upload-left-from-center {
  from {
    opacity: 0.95;
    transform: translateY(-50%) translateX(28px) scale(1);
  }
  to {
    opacity: 0.82;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

@keyframes bitstudio-carousel-photo-left-settle {
  from {
    opacity: 0.18;
    transform: translateY(-50%) translateX(18px) scale(0.88);
  }
  to {
    opacity: 0.46;
    transform: translateY(-50%) translateX(0) scale(0.94);
  }
}

@keyframes bitstudio-carousel-upload-left-settle {
  from {
    opacity: 0.18;
    transform: translateY(-50%) translateX(18px) scale(0.94);
  }
  to {
    opacity: 0.82;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

@keyframes bitstudio-carousel-right-from-center {
  from {
    opacity: 0.95;
    transform: translateY(-50%) translateX(-28px) scale(1);
  }
  to {
    opacity: 0.46;
    transform: translateY(-50%) translateX(0) scale(0.94);
  }
}

@keyframes bitstudio-carousel-upload-right-from-center {
  from {
    opacity: 0.95;
    transform: translateY(-50%) translateX(-28px) scale(1);
  }
  to {
    opacity: 0.88;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

@keyframes bitstudio-carousel-photo-right-settle {
  from {
    opacity: 0.18;
    transform: translateY(-50%) translateX(-18px) scale(0.88);
  }
  to {
    opacity: 0.46;
    transform: translateY(-50%) translateX(0) scale(0.94);
  }
}

@keyframes bitstudio-carousel-upload-right-settle {
  from {
    opacity: 0.18;
    transform: translateY(-50%) translateX(-18px) scale(0.94);
  }
  to {
    opacity: 0.88;
    transform: translateY(-50%) translateX(0) scale(1);
  }
}

/* Generate Button */
.bitstudio-generate-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
}

.bitstudio-generate-stack > * {
  margin: 0 !important;
}

.bitstudio-generate-button {
  width: min(100%, 196px);
  padding: 0.875rem 1.25rem;
  background: var(--bitstudio-generate-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000)));
  color: var(--bitstudio-generate-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff)));
  border: var(--bitstudio-generate-border, var(--bitstudio-button-border, none));
  border-radius: var(--bitstudio-generate-radius, var(--bitstudio-button-radius, var(--button-radius, 0)));
  font-size: var(--bitstudio-generate-font-size, var(--bitstudio-button-font-size, 1rem));
  font-weight: var(--bitstudio-generate-font-weight, var(--bitstudio-button-font-weight, 500));
  line-height: var(--bitstudio-generate-line-height, var(--bitstudio-button-line-height, 1.5));
  text-transform: var(--bitstudio-generate-text-transform, var(--bitstudio-button-text-transform, none));
  letter-spacing: var(--bitstudio-generate-letter-spacing, var(--bitstudio-button-letter-spacing, normal));
  font-family: var(--bitstudio-font-family, inherit);
  box-shadow: var(--bitstudio-generate-shadow, var(--bitstudio-button-shadow, none));
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  align-self: center;
}

.bitstudio-generate-button:disabled {
  background: color-mix(in srgb, var(--bitstudio-generate-bg, var(--bitstudio-button-bg, #111111)) 35%, white);
  color: color-mix(in srgb, var(--bitstudio-generate-text, var(--bitstudio-button-text, #ffffff)) 55%, transparent);
  border-color: transparent;
  cursor: not-allowed;
}

.bitstudio-generate-button:active:not(:disabled) {
  background: var(--bitstudio-generate-hover-bg, var(--bitstudio-generate-bg, var(--bitstudio-button-bg, var(--color-button-primary, #000))));
  color: var(--bitstudio-generate-hover-text, var(--bitstudio-generate-text, var(--bitstudio-button-text, var(--color-button-primary-text, #fff))));
  border: var(--bitstudio-generate-hover-border, var(--bitstudio-generate-border, var(--bitstudio-button-border, none)));
  box-shadow: var(--bitstudio-generate-hover-shadow, var(--bitstudio-generate-shadow, var(--bitstudio-button-shadow, none)));
  opacity: var(--bitstudio-generate-hover-opacity, 1);
  filter: var(--bitstudio-generate-hover-filter, none);
}

/* Disabled state for try-on dropdown trigger */
.bitstudio-generate-button:disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Progress (for try-on button) */
.bitstudio-progress-container {
  padding: 1rem 0.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bitstudio-progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.bitstudio-progress-label {
  margin: 0;
  font-size: 0.88rem;
  color: #3f4652;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bitstudio-progress-percent {
  font-size: 0.86rem;
  color: #0d1a33;
  font-weight: 700;
}

.bitstudio-progress-track {
  width: 100%;
  height: 8px;
  background: #dfe3ea;
  border-radius: 999px;
  overflow: hidden;
}

.bitstudio-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f4cff 0%, #36a6ff 100%);
  transition: width 0.35s ease;
}

.bitstudio-progress-subtext {
  margin: 0;
  font-size: 0.76rem;
  color: #6b7482;
  text-align: right;
}

.bitstudio-main-image--tryon {
  object-fit: cover !important;
  object-position: center center !important;
  background: #f3f5f9;
}

.bitstudio-swap-dock {
  overflow: hidden;
  transition: max-height 0.36s ease, opacity 0.24s ease, transform 0.24s ease, margin 0.36s ease;
}

.bitstudio-swap-dock[hidden] {
  display: none;
}

.bitstudio-swap-dock--outside {
  position: relative;
  margin-top: 0.5rem;
  width: 100%;
  max-height: 140px;
  opacity: 1;
  transform: none;
  display: flex;
  justify-content: flex-end;
  align-self: stretch;
  z-index: 34;
  transition:
    max-height 0s linear 0.28s,
    opacity 0.16s ease 0.28s,
    margin 0s linear 0.28s;
}

.bitstudio-tryon-button[aria-expanded="true"] ~ .bitstudio-swap-dock--outside {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition:
    max-height 0s linear 0s,
    opacity 0.14s ease 0s,
    margin 0s linear 0s;
}

.bitstudio-swap-preview {
  position: relative;
  padding: 0;
  appearance: none;
  border: none;
  border-radius: var(--bitstudio-swap-card-radius, var(--bitstudio-upload-card-radius, var(--bitstudio-card-radius, 0)));
  background: var(--bitstudio-card-bg, rgba(255, 255, 255, 0.96));
  background-clip: padding-box;
  box-shadow: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

.bitstudio-swap-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--bitstudio-card-outline, 1px solid rgba(12, 18, 28, 0.12));
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
}

.bitstudio-swap-preview:hover {
  transform: none;
  box-shadow: none;
}

.bitstudio-swap-preview--outside {
  width: 72px;
}

.bitstudio-swap-preview-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transform: none !important;
  transition: none !important;
}

.bitstudio-swap-preview:hover .bitstudio-swap-preview-image {
  transform: none !important;
}

/* Success Message */
.bitstudio-success {
  padding: 1rem;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 2px;
  text-align: center;
}

.bitstudio-success p {
  color: #155724;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Inline Result Display (when no gallery on page) */
.bitstudio-inline-result {
  padding: 1rem;
  text-align: center;
}

.bitstudio-inline-result .bitstudio-success-text {
  color: #155724;
  font-weight: 500;
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
}

.bitstudio-result-image-container {
  margin-top: 0.75rem;
  border-radius: var(--bitstudio-card-radius, 0);
  overflow: hidden;
  display: inline-block;
}

.bitstudio-result-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--bitstudio-card-radius, 0);
}

/* Error */
.bitstudio-error {
  padding: 1rem;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 2px;
  text-align: center;
}

.bitstudio-error p {
  color: #c00;
  margin: 0 0 0.5rem;
}

.bitstudio-error-close {
  padding: 0.25rem 0.75rem;
  border: 1px solid #c00;
  background: white;
  color: #c00;
  border-radius: var(--button-radius, 0);
  font-size: 0.875rem;
  cursor: pointer;
}

.bitstudio-error-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.bitstudio-retry-button {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--bitstudio-primary-color, #007bff);
  background: var(--bitstudio-primary-color, #007bff);
  color: white;
  border-radius: var(--button-radius, 0);
  font-size: 0.875rem;
  cursor: pointer;
}

.bitstudio-retry-button:hover {
  opacity: 0.9;
}

/* Branding */
.bitstudio-branding {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  align-self: center;
  font-size: 0;
  line-height: 0;
  overflow: visible !important;
  border-radius: 0 !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
}

.bitstudio-branding a {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  min-width: 0;
  font-size: 0;
  line-height: 0;
  overflow: visible !important;
  border-radius: 0 !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
}

.bitstudio-branding img {
  all: unset;
  box-sizing: border-box;
  opacity: var(--bitstudio-branding-opacity, 0.42);
  filter: var(--bitstudio-branding-filter, none);
  transition: opacity 0.2s ease, filter 0.2s ease;
  /* `all: unset` wipes the attribute-derived aspect ratio, so an unloaded
     logo measures 0px tall and then shifts the panel mid-morph once it
     loads. Pin the wordmark's ratio so layout is identical before/after load. */
  aspect-ratio: 1091 / 235;
  width: 42px !important;
  max-width: 42px !important;
  height: auto !important;
  max-height: none !important;
  display: block;
  vertical-align: middle;
  margin: 0 auto;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 0 !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
}

.bitstudio-branding a:hover img {
  opacity: var(--bitstudio-branding-hover-opacity, 0.58);
}

.bitstudio-branding.bitstudio-branding--compact {
  display: block;
  width: 100%;
  margin: 0;
  color: #6b7280 !important;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.bitstudio-branding.bitstudio-branding--compact a {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit !important;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.bitstudio-branding.bitstudio-branding--compact img {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 48px !important;
  max-width: 48px !important;
  height: auto !important;
  opacity: var(--bitstudio-branding-opacity, 0.42);
  filter: var(--bitstudio-branding-filter, none);
}

/* Gallery Badge */
.bitstudio-gallery-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-button-primary, #000);
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

/* Gallery Block */
.bitstudio-gallery-container {
  margin: 2rem 0;
  position: relative;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  color: var(--bitstudio-surface-text, inherit);
}

.bitstudio-gallery-container.bitstudio-visible {
  opacity: 1;
}


/* Masonry Item Wrapper */
.bitstudio-masonry-item {
  grid-column: span 1;
  align-self: start;
}

.bitstudio-gallery-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.bitstudio-gallery-filter {
  margin-bottom: 1rem;
}

.bitstudio-gallery-filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.bitstudio-gallery-loading {
  text-align: center;
  padding: 1.25rem;
  border: var(--bitstudio-card-outline, 1px solid rgba(12, 18, 28, 0.12));
  border-radius: var(--bitstudio-card-radius, 0);
  background: var(--bitstudio-card-bg, rgba(255, 255, 255, 0.96));
}


.bitstudio-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), 1fr);
  gap: 8px;
  align-items: start;
}

.bitstudio-gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--bitstudio-card-bg, #f5f5f5);
  align-self: start;
  border-radius: var(--bitstudio-card-radius, 0);
  border: var(--bitstudio-card-outline, none);
}

/* Fade-in animation for gallery images */
@keyframes bitstudioFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bitstudio-gallery-image {
  width: 100%;
  height: auto;
  opacity: 0;
  animation-duration: 300ms;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.bitstudio-gallery-image.bitstudio-fade-in {
  animation-name: bitstudioFadeIn;
  display: block;
  object-fit: cover;
  /* Optimize rendering for variable quality loading */
  backface-visibility: hidden;
  transform: translateZ(0);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.bitstudio-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bitstudio-gallery-item:hover .bitstudio-gallery-overlay {
  opacity: 1;
}

.bitstudio-gallery-download {
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.bitstudio-gallery-download:hover {
  transform: scale(1.1);
}

.bitstudio-gallery-product {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 2px;
  max-width: calc(100% - 20px);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hero caption style override: standard caption below image */
.bitstudio-hero-container[data-caption-mode="caption"] .bitstudio-gallery-product,
.bitstudio-popup-hero[data-caption-mode="caption"] .bitstudio-gallery-product,
.bitstudio-hero-gallery-container[data-caption-mode="caption"] .bitstudio-gallery-product {
  position: static;
  bottom: auto;
  left: auto;
  transform: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #111;
  padding: 6px 2px 0;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 1rem; /* subheading size */
  font-weight: 600;
  line-height: 1.25;
}

.bitstudio-hero-container[data-caption-mode="caption"][data-caption-align="center"] .bitstudio-gallery-product,
.bitstudio-popup-hero[data-caption-mode="caption"][data-caption-align="center"] .bitstudio-gallery-product,
.bitstudio-hero-gallery-container[data-caption-mode="caption"][data-caption-align="center"] .bitstudio-gallery-product {
  text-align: center;
}

.bitstudio-hero-container[data-caption-mode="caption"][data-caption-align="left"] .bitstudio-gallery-product,
.bitstudio-popup-hero[data-caption-mode="caption"][data-caption-align="left"] .bitstudio-gallery-product,
.bitstudio-hero-gallery-container[data-caption-mode="caption"][data-caption-align="left"] .bitstudio-gallery-product {
  text-align: left;
}

/* Remove card chrome (bg/border) on hero items when using caption mode */
.bitstudio-popup-hero[data-caption-mode="caption"] .bitstudio-gallery-item,
.bitstudio-hero-gallery-container[data-caption-mode="caption"] .bitstudio-gallery-item,
.bitstudio-hero-container[data-caption-mode="caption"] .bitstudio-gallery-item {
  background: transparent;
  border: none;
}

.bitstudio-gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

/* Responsive */
@media (max-width: 767px) {
  .bitstudio-tryon-container--overlay {
    max-width: min(96%, 320px);
  }
}

@media (min-width: 768px) {
  .bitstudio-tryon-dropdown {
    max-width: 400px;
    margin: 0.75rem auto 0;
  }

  .bitstudio-tryon-container.bitstudio-display-overlay .bitstudio-tryon-dropdown {
    margin: 0;
    max-width: none;
  }

  /* Grid columns handled by JavaScript */
}

@media (min-width: 1024px) {
  /* Grid columns handled by JavaScript */
}

/* Processing/Loading States */
.bitstudio-gallery-processing {
  position: relative;
  background: var(--bitstudio-card-bg, #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3/4;
  border-radius: var(--bitstudio-card-radius, 0);
  border: var(--bitstudio-card-outline, 1px solid rgba(12, 18, 28, 0.12));
}

.bitstudio-gallery-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  width: 100%;
  height: 100%;
  min-height: 200px;
}


.bitstudio-gallery-status {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--bitstudio-surface-text, #111111);
  text-align: center;
}



/* Carousel Styles */
.bitstudio-gallery-carousel {
  display: block;
  text-decoration: none;
  color: inherit;
}

.bitstudio-carousel-wrapper {
  position: relative;
  overflow: hidden;
  touch-action: pan-y; /* Allow vertical scroll but handle horizontal swipes */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bitstudio-carousel-wrapper img {
  transition: transform 0.3s ease;
  will-change: transform;
}

/* Processing state for carousel */
.bitstudio-gallery-carousel.processing .bitstudio-carousel-wrapper {
  background: var(--bitstudio-card-bg, #f5f5f5);
  aspect-ratio: 3/4;
}

.bitstudio-gallery-carousel.processing .bitstudio-gallery-skeleton {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bitstudio-carousel-prev,
.bitstudio-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: none;
  border-radius: 2px;
  font-size: 20px;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bitstudio-carousel-prev {
  left: 10px;
}

.bitstudio-carousel-next {
  right: 10px;
}

.bitstudio-gallery-carousel:hover .bitstudio-carousel-prev,
.bitstudio-gallery-carousel:hover .bitstudio-carousel-next {
  opacity: 1;
}

.bitstudio-carousel-prev:hover,
.bitstudio-carousel-next:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.bitstudio-carousel-indicators {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.bitstudio-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bitstudio-carousel-dot.active {
  background: rgba(255, 255, 255, 0.9);
}

/* Processing dots with pulsing animation */
.bitstudio-carousel-dot.processing {
  background: rgba(255, 255, 255, 0.4);
  animation: bitstudio-pulse 1.5s ease-in-out infinite;
}

.bitstudio-carousel-dot.processing.active {
  background: rgba(255, 255, 255, 0.9);
  animation: bitstudio-pulse-active 1.5s ease-in-out infinite;
}

@keyframes bitstudio-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes bitstudio-pulse-active {
  0%, 100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.5;
  }
}

/* Gallery Card Sizing - Only applies in stacked mode */
.bitstudio-gallery-size-small .bitstudio-masonry-item {
  grid-column: span 1;
}

.bitstudio-gallery-size-medium .bitstudio-masonry-item {
  grid-column: span 2;
}

.bitstudio-gallery-size-large .bitstudio-masonry-item {
  grid-column: span var(--columns, 4);
}

/* Ensure masonry items always span 1 column when not using size classes */
.bitstudio-masonry-item {
  grid-column: span 1;
}

/* Responsive adjustments for gallery sizing */
@media (max-width: 640px) {
  /* On small screens, medium and large both become full width */
  .bitstudio-gallery-size-medium .bitstudio-masonry-item,
  .bitstudio-gallery-size-large .bitstudio-masonry-item {
    grid-column: span var(--columns, 2);
  }
}

/* Mobile-specific carousel styles */
@media (max-width: 767px) {
  /* Hide navigation buttons on mobile */
  .bitstudio-carousel-prev,
  .bitstudio-carousel-next {
    display: none !important;
  }

  /* Keep dots small but add invisible touch targets */
  .bitstudio-carousel-dot {
    position: relative;
  }

  .bitstudio-carousel-dot::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
  }

  /* Visual feedback during swipe */
  .bitstudio-carousel-wrapper {
    cursor: grab;
  }

  .bitstudio-carousel-wrapper:active {
    cursor: grabbing;
  }
}

/* Clickable Gallery Items */
.bitstudio-gallery-clickable {
  cursor: pointer;
}

.bitstudio-gallery-view {
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.bitstudio-gallery-view:hover {
  transform: scale(1.1);
}

/* Modal Styles */
.bitstudio-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000001;
  display: none;
}

.bitstudio-modal.bitstudio-modal-open {
  display: block;
}

.bitstudio-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.bitstudio-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: black;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.bitstudio-modal-image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
  flex: 1;
  min-height: 0; /* Allow shrinking */
}

.bitstudio-modal-image {
  max-width: 100%;
  max-height: calc(90vh - 80px);
  object-fit: contain;
}

.bitstudio-modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  pointer-events: none;
}

.bitstudio-modal-header button {
  pointer-events: auto;
}

.bitstudio-modal-header > div {
  display: flex;
  gap: 10px;
}

.bitstudio-modal-close,
.bitstudio-modal-download,
.bitstudio-modal-download-float,
.bitstudio-modal-delete-float {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bitstudio-modal-close {
  font-size: 24px;
}

.bitstudio-modal-close:hover,
.bitstudio-modal-download:hover,
.bitstudio-modal-download-float:hover,
.bitstudio-modal-delete-float:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.1);
}

.bitstudio-modal-delete-float:hover {
  background: rgba(220, 53, 69, 0.8);
}


.bitstudio-modal-footer {
  padding: 0.75rem 1rem;
  background: white;
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Don't shrink */
}

.bitstudio-modal-product-link {
  color: var(--color-button-primary, #000);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.bitstudio-modal-product-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.bitstudio-modal-product-name {
  display: inline-block;
}

/* Remove product banner from individual gallery items in product mode */
.bitstudio-gallery-container[data-gallery-mode="product"] .bitstudio-gallery-product,
.bitstudio-gallery-container[data-should-filter="true"] .bitstudio-gallery-product {
  display: none;
}

/* Modal Navigation Buttons */
.bitstudio-modal-prev,
.bitstudio-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bitstudio-modal-prev {
  left: 20px;
}

.bitstudio-modal-next {
  right: 20px;
}

/* Show on hover for desktop */
@media (hover: hover) {
  .bitstudio-modal-image-wrapper:hover .bitstudio-modal-prev,
  .bitstudio-modal-image-wrapper:hover .bitstudio-modal-next {
    opacity: 1;
  }
}

.bitstudio-modal-prev:hover,
.bitstudio-modal-next:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(1.1);
}

/* Always visible on mobile */
@media (max-width: 767px) {
  .bitstudio-modal-prev,
  .bitstudio-modal-next {
    opacity: 0.8;
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .bitstudio-modal-prev {
    left: 10px;
  }

  .bitstudio-modal-next {
    right: 10px;
  }
}

/* Mobile modal adjustments */
@media (max-width: 767px) {
  .bitstudio-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .bitstudio-modal-image-wrapper {
    flex: 0 0 auto; /* Don't stretch, size to content */
  }

  .bitstudio-modal-image {
    max-width: 95vw;
    max-height: 75vh; /* Leave room for footer and buttons */
    width: auto;
    height: auto;
  }

  .bitstudio-modal-header {
    position: fixed; /* Keep buttons accessible when zoomed */
    top: 10px;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 0 10px;
  }

  .bitstudio-modal-footer {
    min-height: 40px;
    padding: 0.5rem;
  }

  .bitstudio-modal-product-link {
    font-size: 0.875rem; /* Slightly smaller text */
  }

  .bitstudio-modal-close,
  .bitstudio-modal-download,
  .bitstudio-modal-download-float,
  .bitstudio-modal-delete-float {
    width: 44px;
    height: 44px; /* Better touch targets */
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Better visibility */
  }
}

/* Login Overlay */
.bitstudio-login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  min-width: 0;
  padding: 1rem;
}

.bitstudio-login-content {
  box-sizing: border-box;
  flex: 0 1 300px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--bitstudio-button-radius, 0px);
  padding: 1.5rem 0.75rem;
  text-align: center;
  max-width: 300px;
  min-width: 0;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bitstudio-login-content p {
  margin: 0 0 1.5rem;
  color: #333;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: normal;
  overflow-wrap: normal !important;
  word-break: normal !important;
  white-space: normal;
}

.bitstudio-login-button {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--bitstudio-button-bg, rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: white;
  text-decoration: none;
  border: var(--bitstudio-button-border, none);
  border-radius: var(--bitstudio-button-radius, var(--button-radius, 0));
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bitstudio-login-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: white;
}

/* Popup Widget Styles */
.bitstudio-popup-widget {
  position: relative;
  z-index: 999999;
}

/* Floating trigger button */
.bitstudio-popup-trigger {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--bitstudio-popup-bg, #111111);
  color: var(--bitstudio-popup-icon, #ffffff);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 999999;
}

.bitstudio-popup-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Position classes */
.bitstudio-popup-bottom-right {
  bottom: 20px;
  right: 20px;
}

.bitstudio-popup-bottom-left {
  bottom: 20px;
  left: 20px;
}

.bitstudio-popup-top-right {
  top: 20px;
  right: 20px;
}

.bitstudio-popup-top-left {
  top: 20px;
  left: 20px;
}

/* Popup overlay */
.bitstudio-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bitstudio-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Disable animation when auto-opening from saved state */
.bitstudio-popup-overlay.no-animate {
  transition: none !important;
}

/* Popup content - Slide-out tray */
.bitstudio-popup-content {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 520px; /* widen tray slightly for larger hero */
  max-width: 90vw;
  background-color: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.bitstudio-popup-content.no-animate {
  transition: none !important;
}

.bitstudio-popup-overlay.active .bitstudio-popup-content {
  transform: translateX(0);
}

/* Popup header */
.bitstudio-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
}

/* Product Selector: Available Products Row */
.bitstudio-product-selector {
  width: 100%;
  margin: 1rem 0;
}

.bitstudio-product-selector.bitstudio-product-selector-ready {
  display: block !important;
}

.bitstudio-product-selector-header {
  margin-bottom: 0.5rem;
}

.bitstudio-product-selector-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.bitstudio-product-selector-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

.bitstudio-product-selector-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  /* hide scrollbars cross-browser */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.bitstudio-product-selector-row::-webkit-scrollbar { /* WebKit */
  display: none;
}

.bitstudio-product-selector-item {
  flex: 0 0 auto;
  width: 90px; /* portrait thumb width */
  cursor: pointer;
}

.bitstudio-product-selector-item .bitstudio-product-selector-image {
  position: relative;
  width: 90px;
  aspect-ratio: 3/4; /* portrait */
  height: auto;
  border-radius: var(--bitstudio-card-radius, 6px);
  border: none;
  overflow: hidden;
  background: var(--bitstudio-card-bg, #f6f6f6);
  background-clip: padding-box;
  isolation: isolate;
}

.bitstudio-product-selector-item .bitstudio-product-selector-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--bitstudio-card-outline, 1px solid #e5e5e5);
  border-radius: inherit;
  pointer-events: none;
  box-sizing: border-box;
}

.bitstudio-product-selector-item .bitstudio-product-selector-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.bitstudio-product-selector-caption {
  font-size: 12px;
  color: #444;
  margin-top: 6px;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bitstudio-product-selector-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bitstudio-product-selector-clickable:hover {
  transform: translateY(-2px);
}

/* Scroll Sentinel for Infinite Scroll */
.bitstudio-scroll-sentinel {
  flex: 0 0 auto;
  width: 40px;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bitstudio-scroll-sentinel.loading {
  width: 60px;
}

.bitstudio-spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e5e5;
  border-top-color: #666;
  border-radius: 50%;
  animation: bitstudio-spin 0.8s linear infinite;
}

/* Popup Products Section */
.bitstudio-popup-products-section {
  padding: 0 20px;
  margin-bottom: 16px;
}

.bitstudio-popup-products-section .bitstudio-product-selector {
  margin: 0;
}

.bitstudio-popup-products-section .bitstudio-product-selector-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #333;
}

.bitstudio-popup-header-text {
  flex: 1;
}

.bitstudio-popup-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #111111;
}

.bitstudio-popup-subtitle {
  font-size: 14px;
  color: #666666;
  margin: 6px 0 0 0;
  line-height: 1.4;
}

/* Removed stack toggle styles - no longer needed */

/* Close button */
.bitstudio-popup-close {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: none;
  background-color: transparent;
  color: #666666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bitstudio-popup-close:hover {
  background-color: #f5f5f5;
  color: #111111;
}

/* Popup body */
.bitstudio-popup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Try-on section */
.bitstudio-popup-tryon {
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
  position: relative;
}

/* Hero section */
.bitstudio-popup-hero {
  padding: 20px;
  border-bottom: none;
  background: #ffffff;
}

/* Popup product selector section */
.bitstudio-popup-product-selector {
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
}

/* Collapsible header */
.bitstudio-product-selector-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.bitstudio-product-selector-toggle-text {
  font-size: 14px;
  font-weight: 600;
}

.bitstudio-product-selector-toggle-icon {
  transition: transform 0.2s ease;
}

.bitstudio-product-selector-toggle[aria-expanded="true"] .bitstudio-product-selector-toggle-icon {
  transform: rotate(180deg);
}

.bitstudio-product-selector-collapsible {
  margin-top: 6px; /* tighter gap under heading */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.bitstudio-product-selector-collapsible[aria-hidden="false"] {
  max-height: 520px; /* enough to show a few rows if wrapping */
  opacity: 1;
}

/* Slightly tighter section padding for collapsible variant */
.bitstudio-product-selector-collapsible-section {
  padding-top: 10px;
  padding-bottom: 4px;
}

.bitstudio-hero-gallery-container {
  width: 100%;
  max-width: 560px; /* allow hero to grow within wider tray */
  margin: 0 auto;
}

.bitstudio-popup-hero .bitstudio-gallery-grid {
  width: 100%;
}

.bitstudio-popup-hero .bitstudio-gallery-item {
  /* Inherits border-radius from base .bitstudio-gallery-item which uses CSS variables */
  overflow: hidden;
  position: relative;
}

.bitstudio-popup-hero .bitstudio-gallery-image {
  width: 100%;
  height: auto;
  display: block;
}

.bitstudio-popup-hero .bitstudio-hero-fallback .bitstudio-gallery-hero {
  position: relative;
}

.bitstudio-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bitstudio-hero-caption {
  color: white;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Hero loading state */
.bitstudio-popup-hero .bitstudio-gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #666;
  text-align: center;
}

/* Gallery section */
.bitstudio-popup-gallery {
  padding: 20px;
  flex: 1;
  min-height: 200px;
  background-color: #fafafa;
  overflow-y: auto;
}

.bitstudio-popup-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #111111;
}

.bitstudio-popup-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bitstudio-stack-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: transparent;
  color: #666666;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.bitstudio-stack-toggle:hover {
  border-color: #cccccc;
  color: #333333;
  background-color: #f5f5f5;
}

.bitstudio-stack-toggle:focus {
  border-color: #999999;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.bitstudio-stack-toggle svg {
  width: 16px;
  height: 16px;
}

/* Footer */
.bitstudio-popup-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}

/* Adjust existing styles in popup context */
.bitstudio-popup-widget .bitstudio-upload-area {
  margin-bottom: 16px;
}

/* Login overlay for popup */
.bitstudio-popup-widget .bitstudio-popup-login-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 4px;
}

.bitstudio-popup-widget .bitstudio-popup-login-content {
  text-align: center;
  padding: 20px;
}

.bitstudio-popup-widget .bitstudio-popup-login-content p {
  margin-bottom: 16px;
  color: #666;
  font-size: 14px;
}

.bitstudio-popup-widget .bitstudio-popup-login-button {
  background-color: #111111;
  color: white;
  border: 1px solid #111111;
  padding: 10px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.bitstudio-popup-widget .bitstudio-popup-login-button:hover {
  background-color: #333;
  border-color: #333;
}

.bitstudio-popup-widget .bitstudio-generate-button {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--bitstudio-generate-bg, #111111);
  color: var(--bitstudio-generate-text, #ffffff);
}

.bitstudio-popup-widget .bitstudio-gallery-grid {
  position: relative;
  min-height: 150px;
  width: 100%;
  margin: 0;
}

/* Ensure proper alignment in popup gallery */
.bitstudio-popup-gallery .bitstudio-gallery-grid {
  width: 100%;
  margin: 0;
}

/* Full gallery mode on non-product pages */
.bitstudio-popup-gallery-full {
  background-color: transparent;
  padding-top: 24px;
}

/* Prevent gallery flickering during updates */
.bitstudio-popup-widget .bitstudio-gallery-item {
  transition: none !important; /* Disable animations during state updates */
}

.bitstudio-popup-widget .bitstudio-gallery-grid.updating {
  opacity: 0.8;
  pointer-events: none;
}

.bitstudio-popup-widget .bitstudio-gallery-loading {
  text-align: center;
  padding: 40px 20px;
}

/* Row Gallery (horizontal, scrollable, no visible scrollbar) */
.bitstudio-row-gallery {
  width: 100%;
  margin: 1rem 0;
}

.bitstudio-row-gallery.bitstudio-row-gallery-ready {
  display: block !important;
}

.bitstudio-row-gallery-viewport {
  position: relative;
}

.bitstudio-row-gallery-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* hide scrollbars */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.bitstudio-row-gallery-scroller::-webkit-scrollbar { /* WebKit */
  display: none;
}

.bitstudio-row-gallery-item {
  flex: 0 0 auto;
  width: var(--bitstudio-row-card-width, 120px);
  cursor: default;
  border-radius: var(--bitstudio-card-radius, 0);
  border: var(--bitstudio-card-outline, none);
  background: var(--bitstudio-card-bg, #f5f5f5);
  overflow: hidden;
}

.bitstudio-row-image-wrapper {
  width: 100%;
  aspect-ratio: 3/4; /* portrait */
  height: auto;
  position: relative;
}

.bitstudio-row-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Row: show only dots on hover when present */
.bitstudio-row-gallery-item .bitstudio-carousel-indicators {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.bitstudio-row-gallery-item:hover .bitstudio-carousel-indicators {
  opacity: 1;
}

/* Touch devices: no hover → keep dots visible */
@media (hover: none) and (pointer: coarse) {
  .bitstudio-row-gallery-item .bitstudio-carousel-indicators {
    opacity: 1;
  }
}

/* Scroll buttons (desktop only) */
.bitstudio-row-scroll-prev,
.bitstudio-row-scroll-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--bitstudio-row-scroll-bg, rgba(0, 0, 0, 0.3));
  backdrop-filter: var(--bitstudio-row-scroll-backdrop, blur(24px));
  -webkit-backdrop-filter: var(--bitstudio-row-scroll-backdrop, blur(24px));
  border: none;
  border-radius: var(--bitstudio-row-scroll-radius, 2px);
  font-size: 20px;
  color: var(--bitstudio-row-scroll-color, #ffffff);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--bitstudio-row-scroll-shadow, 0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Hover behavior handled later with not(:disabled) to avoid edge highlighting */

.bitstudio-row-scroll-prev {
  left: 8px;
}

.bitstudio-row-scroll-next {
  right: 8px;
}

.bitstudio-row-scroll-prev:hover,
.bitstudio-row-scroll-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.bitstudio-row-scroll-prev:disabled,
.bitstudio-row-scroll-next:disabled {
  opacity: 0; /* do not show disabled as hint */
  cursor: default;
}

/* Affordance hints: when not at an edge, hint toward available scroll */
.bitstudio-row-gallery-viewport.hint-left .bitstudio-row-scroll-prev { opacity: 0.35; }
.bitstudio-row-gallery-viewport.hint-right .bitstudio-row-scroll-next { opacity: 0.35; }

/* On hover: show only available direction(s) at full opacity */
.bitstudio-row-gallery-viewport:hover .bitstudio-row-scroll-prev:not(:disabled),
.bitstudio-row-gallery-viewport:hover .bitstudio-row-scroll-next:not(:disabled) {
  opacity: 1;
}

@media (max-width: 767px) {
  .bitstudio-row-scroll-prev,
  .bitstudio-row-scroll-next {
    display: none !important;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .bitstudio-popup-trigger {
    width: 48px;
    height: 48px;
  }

  .bitstudio-popup-hero {
    padding: 15px;
  }

  .bitstudio-hero-caption {
    font-size: 14px;
    padding: 15px;
  }

  .bitstudio-popup-content {
    width: 100%;
    max-width: 100%;
  }

  .bitstudio-popup-body {
    flex-direction: column;
  }

  .bitstudio-popup-tryon {
    border-bottom: 1px solid #e5e5e5;
  }
}

/* Disclaimer Modal - light theme with CSS variable support for store customization */
.bitstudio-disclaimer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000001; /* Above popup drawer (1000000) */
  padding: 1rem;
  animation: bitstudio-disclaimer-fade-in 0.2s ease;
}

@keyframes bitstudio-disclaimer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bitstudio-disclaimer-content {
  background: var(--bitstudio-disclaimer-bg, #fff);
  border-radius: var(--bitstudio-disclaimer-radius, 8px);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.25);
  animation: bitstudio-disclaimer-slide-up 0.2s ease;
  color: var(--bitstudio-disclaimer-text, #1a1a1a);
  font-family: var(--bitstudio-disclaimer-font-family, inherit);
  border: 1px solid var(--bitstudio-disclaimer-border, rgba(0, 0, 0, 0.12));
}

@keyframes bitstudio-disclaimer-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.bitstudio-disclaimer-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
}

.bitstudio-disclaimer-body {
  margin-bottom: 1.5rem;
}

.bitstudio-disclaimer-summary {
  font-size: 1rem;
  line-height: 1.6;
  color: inherit;
  opacity: 0.9;
  margin: 0 0 0.75rem;
}

/* Expand/collapse toggle button */
.bitstudio-disclaimer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.bitstudio-disclaimer-toggle:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.bitstudio-disclaimer-toggle .toggle-icon {
  transition: transform 0.2s ease;
}

.bitstudio-disclaimer-toggle[data-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* Expandable full terms section */
.bitstudio-disclaimer-full {
  display: none;
  padding-top: 1rem;
  border-top: 1px solid var(--bitstudio-disclaimer-border, rgba(0, 0, 0, 0.12));
  margin-top: 0.75rem;
}

.bitstudio-disclaimer-full[aria-hidden="false"] {
  display: block;
  animation: bitstudio-disclaimer-expand 0.2s ease;
}

@keyframes bitstudio-disclaimer-expand {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Typography within full terms (styled for Shopify richtext HTML output) */
.bitstudio-disclaimer-full p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: inherit;
  opacity: 0.8;
  margin: 0 0 0.75rem;
}

.bitstudio-disclaimer-full p:last-child {
  margin-bottom: 0;
}

.bitstudio-disclaimer-full strong {
  color: inherit;
  opacity: 1;
  font-weight: 600;
}

.bitstudio-disclaimer-full a {
  color: var(--bitstudio-disclaimer-button-bg, #000);
  text-decoration: underline;
}

.bitstudio-disclaimer-full ul,
.bitstudio-disclaimer-full ol {
  font-size: 0.9rem;
  line-height: 1.6;
  color: inherit;
  opacity: 0.8;
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

/* Email input section */
.bitstudio-disclaimer-email {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bitstudio-disclaimer-border, rgba(0, 0, 0, 0.12));
}

.bitstudio-disclaimer-email label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--bitstudio-disclaimer-text, #1a1a1a);
}

.bitstudio-disclaimer-email input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bitstudio-disclaimer-border, rgba(0, 0, 0, 0.12));
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--bitstudio-disclaimer-text, #1a1a1a);
  background: transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.bitstudio-disclaimer-email input[type="email"]:focus {
  outline: none;
  border-color: var(--bitstudio-disclaimer-button-bg, #000);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.bitstudio-disclaimer-email input[type="email"]::placeholder {
  color: var(--bitstudio-disclaimer-text, #1a1a1a);
  opacity: 0.45;
}

.bitstudio-disclaimer-email-note {
  font-size: 0.8rem;
  color: var(--bitstudio-disclaimer-text, #666);
  margin: 0.5rem 0 0;
  opacity: 0.8;
  line-height: 1.4;
}

.bitstudio-disclaimer-email-error {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #dc2626;
}

/* Remove actions border when email section is present */
.bitstudio-disclaimer-email + .bitstudio-disclaimer-actions {
  border-top: none;
}

/* Actions */
.bitstudio-disclaimer-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--bitstudio-disclaimer-border, rgba(0, 0, 0, 0.12));
}

/* Accept button */
.bitstudio-disclaimer-accept {
  background: var(--bitstudio-disclaimer-button-bg, #000);
  color: var(--bitstudio-disclaimer-button-text, #fff);
  border: var(--bitstudio-disclaimer-button-border, none);
  padding: 0.75rem 1.5rem;
  border-radius: var(--bitstudio-disclaimer-radius, 8px);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bitstudio-disclaimer-accept:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.bitstudio-disclaimer-accept:active {
  transform: scale(0.98);
}

/* Mobile adjustments for disclaimer */
@media (max-width: 480px) {
  .bitstudio-disclaimer-content {
    padding: 1.5rem;
    border-radius: var(--bitstudio-disclaimer-radius, 8px) var(--bitstudio-disclaimer-radius, 8px) 0 0;
    max-height: 90vh;
  }

  .bitstudio-disclaimer-modal {
    align-items: flex-end;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bitstudio-tryon-container {
    --bitstudio-motion-160: 1ms;
    --bitstudio-motion-220: 1ms;
    --bitstudio-motion-300: 1ms;
    --bitstudio-motion-380: 1ms;
    --bitstudio-motion-520: 1ms;
  }

  .bitstudio-tryon-container *,
  .bitstudio-tryon-container *::before,
  .bitstudio-tryon-container *::after,
  .bitstudio-media-wipe-image {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
