/*
 * EllaConfigurator - Theme 1
 * Copyright (c) Tanner Tattini
 *
 * This stylesheet is intentionally self-contained and namespaced.
 */

.ella-configurator {
  --ella-bg: #f4f5f7;
  --ella-surface: #ffffff;
  --ella-border: #e6e8ec;
  --ella-text: #0b0f14;
  --ella-muted: #6b7280;
  --ella-dark: #232a31;
  --ella-dark-2: #1b2229;
  --ella-dashed: rgba(255, 255, 255, 0.20);
  --ella-green: #147a52;
  --ella-green-dark: #0f6343;
  --ella-green-soft: #dbf4e6;
  /* CTA color (defaults to the primary green). This is used for "completed" UI
     states across mobile and desktop. */
  --ella-cta: var(--ella-green);
  --ella-cta-text: #ffffff;
  --ella-blue: #4ea5df;
  --ella-orange: #f97316;
  --ella-orange-soft: rgba(249, 115, 22, 0.55);

  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ella-text);
  width: 100%;
}

.ella-configurator * {
  box-sizing: border-box;
}

.ella-configurator__root {
  position: relative;
  width: 100%;
  background: var(--ella-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);

  /* Ensure the bottom nav never overlaps the preview image */
  display: flex;
  flex-direction: column;
}


/* v1.1.18: busy state overlay (used during checkout) */
.ella-configurator__root--busy {
  cursor: progress;
}

.ella-configurator__root--busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.55);
  z-index: 120;
}

.ella-configurator__root--busy .ella-modal,
.ella-configurator__root--busy .ella-kit {
  z-index: 130;
}

/* v1.1.30: Checkout loading overlay (shown after clicking Checkout) */
.ella-checkout-overlay{
  position: absolute;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.ella-checkout-overlay.is-active{
  opacity: 1;
  pointer-events: auto;
}

.ella-checkout-overlay__card{
  width: min(520px, 100%);
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 26px 28px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.ella-checkout-overlay__spinner{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(0,0,0,0.14);
  border-top-color: var(--ella-orange);
  animation: ellaSpin 900ms linear infinite;
}

@keyframes ellaSpin{
  to { transform: rotate(360deg); }
}

.ella-checkout-overlay__text{
  font-weight: 900;
  font-size: 18px;
  line-height: 1.25;
  color: #0b0f14;
}

.ella-checkout-overlay__sub{
  font-weight: 700;
  color: var(--ella-muted);
  line-height: 1.35;
}

/* Loading */
.ella-configurator__loading {
  padding: 24px;
  text-align: center;
  color: var(--ella-muted);
}

/* Buttons */
.ella-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.ella-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* v1.1.55: some controls are "soft-disabled" (clickable for toast messages)
   but styled as disabled via a class. */
.ella-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ella-btn--pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* v1.1.6: unify header control heights for better vertical alignment */
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--ella-border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}



/* v1.1.18: subtle hover for View Kit (matches Est. Price hover behavior) */
.ella-header .ella-btn--pill:not(.ella-btn--green):hover {
  background: rgba(243, 244, 246, 0.96);
}
.ella-btn--green {
  background: var(--ella-green);
  color: var(--ella-cta-text, #fff);
  border: 1px solid rgba(0,0,0,0.05);
}

/* v1.2: Header CTA icon (dashed when disabled, solid when enabled) */
.ella-btn--green .ella-header__cta-icon {
  border-color: rgba(255,255,255,0.45);
}

.ella-btn--green:not(.ella-btn--disabled) .ella-header__cta-icon {
  border-style: solid;
  border-color: rgba(255,255,255,0.50);
}

/* v1.1.67: Keep Checkout / Submit Purchase Order CTAs consistently bold. */
.ella-btn--green,
.ella-btn--green span {
  font-weight: 700;
}

.ella-btn--green:hover {
  background: var(--ella-green-dark);
}

.ella-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ella-green);
  color: var(--ella-cta-text, #fff);
  font-size: 12px;
  font-weight: 700;
}

/* Header (desktop) */
.ella-header {
  position: relative;
  z-index: 20;
  /* v1.1.6: keep header controls on one line and vertically centered */
  min-height: 64px;
  height: 64px;
  /* v1.1.9: enforce equal vertical spacing above/below controls */
  padding: 10px 12px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--ella-border);
}

.ella-header__spacer {
  flex: 1;
}

.ella-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--ella-green);
  color: var(--ella-cta-text, #fff);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(20, 122, 82, 0.35);
  white-space: nowrap;
  line-height: 1;
}

.ella-price-pill:hover {
  background: var(--ella-green-dark);
}

.ella-price-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.ella-price-pill__label {
  opacity: 0.95;
  font-weight: 700;
}

.ella-price-pill__value {
  font-weight: 900;
}

/* Body layout */
.ella-body {
  position: relative;
  height: 640px;
  display: flex;
}

.ella-preview {
  position: relative;
  flex: 0 0 48%;
  background: #eaecef;
  overflow: hidden;
}

.ella-panel {
  position: relative;
  flex: 1;
  background: var(--ella-bg);
  overflow: hidden;
}

/* Preview */
.ella-preview__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ella-preview__canvas {
  position: relative;
  width: 100%;
  height: 100%;
    touch-action: none;
  /* v1.1.45: reduce iOS/Safari touch highlight/selection artifacts that can
     appear as a brief "flash" when the user begins a two-finger pan gesture. */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* v1.3.1: preview swap fade (JS toggles this class briefly during image swaps) */
.ella-preview__canvas--swapping {
  /* v1.3.2: canvas no longer fades; only overlay layers cross-fade. */
  opacity: 1;
}

/* v1.1.54: per-layer dragging (only when not zoomed) */
.ella-preview__canvas--layer-draggable {
  cursor: grab;
}

.ella-preview__canvas--layer-dragging {
  cursor: grabbing;
}


.ella-preview__layers{
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* v1.3.2: Cross-fade only the overlay layers (base stays visible) */
.ella-preview__layers-group{
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 160ms ease;
  will-change: opacity;
}

.ella-preview__layers-group.is-entering{
  opacity: 0;
}

.ella-preview__layers-group.is-exiting{
  opacity: 0;
}

.ella-preview__img {
  /* v1.1.45: prevent the base image from being treated as draggable/selectable
     content on mobile Safari (can cause a brief visual flicker on first touch). */
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* v1.1.23: preview auto-reset animation (only applied when we intentionally reset) */
.ella-preview__canvas--resetting {
  transition: transform 360ms ease, opacity 160ms ease;
}

/* v1.1.23: desktop hover hint */
.ella-preview__hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 6px);
  padding: 8px 12px;
  /* v1.2.7: match the selection green instead of the dark gray tooltip */
  background: var(--ella-green-soft);
  color: var(--ella-text);
  border: 1px solid rgba(20, 122, 82, 0.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 11;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ella-preview__hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* v1.2.7: Quick rotate button (bottom-right of the preview area) */
.ella-rotate-btn{
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 12;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.2px;
  /* v1.2.8: lighter/whiter button styling (distinct from green notification) */
  background: rgba(255,255,255,0.94);
  color: #111;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  cursor: pointer;
  opacity: 0;
  /* v1.2.9: support stashing/dragging with CSS variables */
  --ella-rot-y: 6px;
  --ella-rot-stash-x: 0px;
  --ella-rot-drag-x: 0px;
  transform: translateX(calc(var(--ella-rot-stash-x) + var(--ella-rot-drag-x))) translateY(var(--ella-rot-y));
  pointer-events: none;
  transition: opacity 180ms ease, transform 260ms ease, box-shadow 180ms ease;
  overflow: hidden;
  touch-action: pan-y;
}

/* v1.2.10: Stashed rotate control uses an icon (text fades out) */
.ella-rotate-btn__icon{
  position: absolute;
  left: 10px;
  top: 40%;
  transform: translateY(-50%);
  font-size: 30px;
  line-height: 1;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.ella-rotate-btn__text{
  display: inline-block;
  opacity: 1;
  transition: opacity 180ms ease;
}

.ella-rotate-btn.is-stashed .ella-rotate-btn__text{
  opacity: 0;
}

.ella-rotate-btn.is-stashed .ella-rotate-btn__icon{
  opacity: 0.95;
}

.ella-rotate-btn.is-visible{
  opacity: 1;
  --ella-rot-y: 0px;
  pointer-events: auto;
}

/* v1.2.9: stashed state (slides off-screen to the right, leaving a small tab) */
.ella-rotate-btn.is-stashed{
  --ella-rot-stash-x: calc(100% - 28px);
}


/* v1.2.9: during drag, remove transitions for a "throw" feel */
.ella-rotate-btn.is-dragging{
  transition: none;
  cursor: grabbing;
}

.ella-rotate-btn.is-hidden{
  display: none;
}

.ella-preview__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.ella-preview__controls {
  position: absolute;
  top: 66px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.ella-zoom-btn {
  width: 66px;
  height: 66px;
  border-radius: 21px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ella-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
}

/* v1.1.12: if zoom is at its limit, visually disable the control (no "dead" clicks) */
.ella-zoom-btn:disabled {
  opacity: 0.30;
  box-shadow: none;
  filter: grayscale(0.15);
}

/* v1.1.9: make the magnify control slightly smaller so it doesn't blend with +/- */
.ella-zoom-btn--magnify {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  font-size: 16px;
}

/* Panel header */
.ella-panel__header {
  padding: 18px 18px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ella-panel__title {
  font-size: 38px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.5px;
}

.ella-panel__header-right {
  margin-left: auto;
}

.ella-skip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ella-border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  color: #111;
  font-weight: 700;
  /* v1.1.44: keep "Skip & Checkout" on a single line */
  white-space: nowrap;
}

.ella-panel__content {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  /*
    v1.1.40: The bottom nav is now part of the normal layout (not overlaying
    the right panel). A fixed 90px bottom offset created an unnecessary strip
    above the bottom bar and could make it look like content was being covered.
  */
  bottom: 0;
  padding: 0 18px 18px;
  overflow: auto;
}

/* Accordion group */
.ella-group {
  background: transparent;
  margin-bottom: 14px;
}

.ella-group__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ella-border);
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

/* v1.2.7: subtle hover lift + parallax (desktop only) */
.ella-option,
.ella-group__btn,
.ella-skip-btn{
  --ella-parallax-x: 0px;
  --ella-parallax-y: 0px;
  will-change: transform;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) and (pointer: fine){
  .ella-option:hover,
  .ella-group__btn:hover,
  .ella-skip-btn:hover{
    /* v1.2.8: reduce lift/parallax intensity by ~50% */
    transform: translate3d(var(--ella-parallax-x), calc(-1px + var(--ella-parallax-y)), 0);
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
  }
  .ella-option:active,
  .ella-group__btn:active,
  .ella-skip-btn:active{
    transform: translate3d(var(--ella-parallax-x), calc(-0.5px + var(--ella-parallax-y)), 0);
  }
}

.ella-group__label {
  font-size: 20px;
  font-weight: 800;
  color: #111;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.ella-group__chev {
  width: 18px;
  height: 18px;
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 150ms ease;
}

.ella-group--open .ella-group__chev {
  transform: rotate(180deg);
}

.ella-group__content {
  margin-top: 12px;
}

/* Subcategory description (admin: Subcategory "More Info") */
.ella-groupinfo {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ella-border);
}

.ella-groupinfo__title {
  font-weight: 800;
  text-align: center;
  margin: 0 0 6px;
}

.ella-groupinfo__desc {
  text-align: center;
  color: #2c3338;
  line-height: 1.45;
}

/* Tip bar */
.ella-tipbar {
  width: 100%;
  background: var(--ella-blue);
  border-radius: 14px;
  /* v1.1.31: lock the tip bar height so the label is perfectly vertically centered */
  min-height: 48px;
  padding: 0 14px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  text-transform: none;
  margin: 0;
  /* Ensure the "ticket" content slides out from underneath this bar */
  position: relative;
  z-index: 2;
  transition: background-color 180ms ease;
}

.ella-tipbar.is-open {
  background: #4694c8;
  /* v1.1.42: when the tip is open, collapse the icon spacing so the
     "Tap/Click to Close" label can sit perfectly centered. */
  gap: 0;
}

/* v1.1.26/1.1.28: hide the info icon when the tip is open (button shows close text)
   WITHOUT shifting the label left. Keep the icon space reserved, fade it out. */
.ella-tipbar__icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  transition: opacity 200ms ease, width 200ms ease;

  /* v1.1.41: keep the icon in the normal flex flow so it sits directly
     to the left of the title (ex: "Need Help?") while remaining centered
     as a group. Opacity is used to hide the icon without shifting text. */
  flex: 0 0 auto;
}

.ella-tipbar.is-open .ella-tipbar__icon {
  opacity: 0;
  width: 0;
  overflow: hidden;
}





.ella-tipwrap {
  margin: 6px 0 14px;
  position: relative;
}

/* v1.1.27: transition button text without overlap.
   Fade OUT first, then fade IN (sequential) */
.ella-tipbar__label {
  display: inline-grid;
  align-items: center;
}

.ella-tipbar__labelText {
  grid-area: 1 / 1;
  transition: opacity 180ms ease, transform 180ms ease, margin-left 180ms ease;
}

/* Base states */
.ella-tipbar__labelText--show {
  opacity: 1;
  transform: translateY(0);
}

.ella-tipbar__labelText--close {
  opacity: 0;
  transform: translateY(-2px);
  /* v1.1.42: start slightly left before fading in (prevents the close label
     from looking off-center when the info icon is hidden). */
  margin-left: -20%;
}

/* When OPEN: hide title immediately, then show close label after */
.ella-tipbar.is-open .ella-tipbar__labelText--show {
  opacity: 0;
  transform: translateY(2px);
  transition-delay: 0ms;
}

.ella-tipbar.is-open .ella-tipbar__labelText--close {
  opacity: 1;
  /* v1.1.31: keep close text truly centered (no extra Y shift) */
  transform: translateY(0);
  transition-delay: 180ms;
  margin-left: 0;
}

/* When CLOSED: hide close label immediately, then show title after */
.ella-tipbar:not(.is-open) .ella-tipbar__labelText--close {
  opacity: 0;
  transform: translateY(-2px);
  transition-delay: 0ms;
}

.ella-tipbar:not(.is-open) .ella-tipbar__labelText--show {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 180ms;
}

.ella-tipcontent {
  max-height: 0;
  overflow: hidden;
  /* Ticket-style slide: content is tucked slightly under the tip bar */
  transform: translateY(-18px);
  transition: max-height 280ms ease, transform 280ms ease, margin-top 280ms ease;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0 0 14px 14px;
  margin-top: 0;
}

.ella-tipwrap.is-open .ella-tipcontent {
  max-height: 380px;
  transform: translateY(0);
  /* Pull up slightly so it appears to slide out from under the bar */
  margin-top: -8px;
}

.ella-tipcontent__inner {
  /* v1.1.31: add a bit more breathing room so the revealed text is visually centered */
  /* v1.1.32: tighten bottom padding slightly so the revealed text sits better */
  padding: 18px 14px 16px;
  color: #111;
  font-weight: 600;
  white-space: pre-line;
  line-height: 1.45;
}

/* Option card */
.ella-option {
  background: #fff;
  border: 1px solid var(--ella-border);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  position: relative;
}

.ella-option--selected {
  background: var(--ella-green-soft);
  border: 2px solid var(--ella-green);
}

.ella-option__thumbwrap {
  width: 82px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ella-option__thumb {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  background: #f3f4f6;
  border: 1px solid var(--ella-border);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.ella-option__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* v1.3.2: Thumbnail loading spinner (shown while the left overlay image is loading) */
.ella-thumb-loader{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.45);
  pointer-events: none;
}

.ella-option__thumb.is-loading .ella-thumb-loader{
  display: flex;
}

.ella-thumb-loader__spinner{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,0.18);
  border-top-color: rgba(0,0,0,0.62);
  animation: ella-spin 0.85s linear infinite;
}

@keyframes ella-spin{
  to { transform: rotate(360deg); }
}

/* v1.1.18: thumbnails can be clicked to preview (no overlay icon) */
.ella-option__thumb[data-ella-action="preview-image"] {
  cursor: pointer;
}

.ella-option__thumb[data-ella-action="preview-image"]:hover {
  filter: brightness(0.96);
}

.ella-option__thumb-btn {
  display: none !important;
}



.ella-option__thumb-btn svg,
.ella-option__thumb-btn svg * {
  fill: currentColor !important;
}

.ella-option__moreinfo {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--ella-border);
  background: rgba(255,255,255,0.92);
  color: #111;
  font-size: 12px;
  font-weight: 900;
}

.ella-option__moreinfo:hover {
  background: #fff;
}


.ella-option__info-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(35,42,49,0.92);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 900;
}


.ella-option__main {
  flex: 1;
  min-width: 0;
}

/* v1.2.3: Title/Price/Size + Quantity in a single header row (prevents overlap with variations) */
.ella-option__header{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
}

.ella-option__header-left{
  flex: 1;
  min-width: 0;
}

.ella-option__header .ella-qty{
  margin-left: auto;
  align-self: flex-start;
  margin-top: 30px;
}

.ella-option__title {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  line-height: 1.2;
  /* v1.1.69: leave space for the selected checkmark on the right */
  padding-right: 44px;
}

.ella-option__subtitle {
  margin: 4px 0 0;
  color: #374151;
  font-weight: 700;
}

.ella-option__price {
  color: var(--ella-green);
  font-weight: 900;
  font-size: 20px;
  margin-top: 4px;
}

.ella-option__meta {
  margin-top: 4px;
  color: var(--ella-muted);
  font-weight: 700;
}

.ella-option__fields {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  /* v1.1.6: give variation fields room and avoid the "scrunched" look */
  gap: 14px;
  align-items: flex-start;
  position: relative;
}

/* v1.1.22: Variation reset link (right aligned above dropdowns) */
.ella-option__fields-head {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  margin: 0;
  padding: 0;
}

.ella-option__fields-reset {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--ella-muted);
  text-decoration: none;
  cursor: pointer;
}

.ella-option__fields-reset:hover {
  color: #111827;
}

.ella-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 1 1 260px;
  min-width: 220px;
  color: #374151;
  font-weight: 800;
}

.ella-field select {
  /* v1.1.6: show a visible dropdown arrow while keeping custom styling */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 50px;
  line-height: 50px;
  padding: 0 34px 0 12px;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--ella-border);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17, 24, 39, 0.8) 50%),
    linear-gradient(135deg, rgba(17, 24, 39, 0.8) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  font-weight: 800;
}

.ella-field input[type="number"],
.ella-field input[type="text"] {
  height: 50px;
  padding: 0 12px;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--ella-border);
  background-color: #fff;
  font-weight: 800;
}

.ella-acf-dims {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 0;
  border-top: 0;
}

.ella-acf-dims__title {
  /* v1.1.71: The "Dimensions" title is redundant for EllaACF inputs */
  display: none;
  width: 100%;
  font-weight: 800;
  font-size: 13px;
  color: rgba(17, 24, 39, 0.85);
}

.ella-field--acfdim {
  flex: 1 1 180px;
  min-width: 180px;
  gap: 2px;
}

/* v1.1.67: EllaACF min/max helper and adjustment warning */
.ella-acf-dims__hint {
  margin-top: -6%;
  margin-left: 1%;
  font-size: 12px;
  color: rgba(55, 65, 81, 0.85);
  font-weight: 700;
  line-height: 1.2;
}

.ella-acf-warning {
  width: 100%;
  margin-top: 12px;
  background: rgba(254, 226, 226, 0.9);
  color: #dc2626;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: center;
  font-weight: 800;
}

/* Qty control */
.ella-qty {
  position: static;
  background: rgba(255,255,255,0.90);
  border: 1px solid var(--ella-border);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.ella-qty button {
  width: 38px;
  height: 34px;
  border: 0;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
}

.ella-qty button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ella-qty span {
  width: 46px;
  text-align: center;
  font-weight: 900;
}

/* Selected check */
.ella-check {
  position: absolute;
  right: 14px;
  top: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ella-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  /* v1.3.13: ensure checkmark floats above qty bar */
  z-index: 2;
  pointer-events: none;
}

/* v1.3.23: qty always in its final position — no shift when selected */


/* v1.2.10: Rotatable beam bar on the option thumbnail */
.ella-option__rotatablebar{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ella-green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 0 0 14px 14px;
}

@media (max-width: 520px) {
  .ella-option__rotatablebar{
    height: 18px;
    font-size: 10px;
  }
}

/* Bottom nav (desktop) */
.ella-bottom-nav {
  position: relative;
  height: 90px;
  background: linear-gradient(180deg, var(--ella-dark) 0%, var(--ella-dark-2) 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  /* v1.1.9: enforce equal vertical spacing above/below arrows + step buttons */
  padding: 15px 12px;
  z-index: 20;
  flex: none;
}

.ella-nav-arrow {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ella-nav-arrow--primary {
  background: rgba(255,255,255,0.90);
  color: #111;
}

.ella-steps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  padding: 0 4px;
  /* v1.1.68: enable click-and-drag scrolling (JS) while preserving vertical page scroll */
  touch-action: pan-y;
}

@media (hover: hover) and (pointer: fine) {
  .ella-steps {
    cursor: grab;
    user-select: none;
  }
  .ella-steps.ella-steps--dragging {
    cursor: grabbing;
  }
}

.ella-step {
  width: auto;
  min-width: 240px;
  height: 60px;
  border-radius: 16px;
  border: 2px dashed var(--ella-dashed);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  position: relative;
  flex: 0 0 auto;
}

.ella-step__icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  border-radius: 999px;
  border: 2px dashed rgba(255,255,255,0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.ella-step__label {
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  min-width: 0;
}

/* v1.1.26: optional marker on steps */
.ella-step__optional {
  position: absolute;
  top: 4px;
  right: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.01em;
  opacity: 0.85;
  pointer-events: none;
  /* Some themes apply text-transform to all buttons; ensure this stays "Optional" */
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}

.ella-step--active .ella-step__optional,
.ella-step--complete .ella-step__optional {
  background: rgba(17,24,39,0.08);
}


.ella-step--active {
  background: #fff;
  color: #111;
  /* v1.1.26: revert to subtle indicator instead of full outline */
  border: 2px dashed rgba(0,0,0,0.18);
  box-shadow: none;
}

.ella-step--active .ella-step__icon {
  border-color: rgba(0,0,0,0.20);
}

/* v1.1.37: completed steps should use the CTA (green) color so it is clear
   the step is done. */
.ella-step--complete .ella-step__icon {
  background: var(--ella-green);
  border-color: var(--ella-green);
  color: #fff;
}

.ella-step--complete {
  background: #ffffff;
  border-color: rgba(0,0,0,0.18);
  box-shadow: 0 10px 18px rgba(0,0,0,0.10);
}

.ella-step--complete .ella-step__label {
  color: var(--ella-green-dark);
}

/* v1.1.26: subtle orange mini bar for active + hover (draws from center out) */
.ella-step::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--ella-orange);
  transform: translateX(-50%) scaleX(0);
  transform-origin: 50% 50%;
  opacity: 0;
  pointer-events: none;
  transition: transform 240ms ease, opacity 240ms ease;
}

.ella-step--active::after {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

.ella-step:hover::after {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

.ella-step--disabled:hover::after {
  transform: translateX(-50%) scaleX(0);
  opacity: 0;
}

/* Don't show the mini-bar on the Checkout button */
.ella-step--checkout::after {
  display: none;
}

/* v1.1.24: hover darken for Checkout step/button */

.ella-step--checkout {
  transition: filter 180ms ease;
}

/* v1.1.27: make bottom-bar Checkout step clearly enabled when ready */
.ella-step--checkout:not(.ella-step--disabled) {
  background: var(--ella-green);
  color: var(--ella-cta-text, #fff);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.ella-step--checkout:not(.ella-step--disabled) .ella-step__icon {
  border-color: rgba(255,255,255,0.50);
  color: var(--ella-cta-text, #fff);
  /* v1.1.56: solid outline when enabled */
  border-style: solid;
}

/* v1.1.56: help SVG icons visually center within the dashed/solid circle */
.ella-step__icon .ella-icon {
  display: block;
}

.ella-step__icon .ella-icon--submit {
  /* Slight nudge so it feels optically centered */
  margin-left: 1px;
}

.ella-step--checkout.ella-step--disabled {
  /* v1.1.55: keep CTA styling even when disabled, but make it clearly inactive */
  background: var(--ella-green);
  color: var(--ella-cta-text, #fff);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: none;
  opacity: 0.42;
  cursor: not-allowed;
}

.ella-step--checkout.ella-step--disabled .ella-step__icon {
  border-color: rgba(255,255,255,0.45);
  color: var(--ella-cta-text, #fff);
}

.ella-step--checkout:hover:not(.ella-step--disabled) {
  filter: brightness(0.92);
}

/* Drawer / modal overlay */
.ella-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.ella-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.ella-kit {
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 12px;
  width: 420px;
  max-width: calc(100% - 24px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 61;
  /* v1.1.9: slide-in drawer */
  transform: translateX(115%);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 220ms ease;
  overflow: hidden;
}

.ella-kit--open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.ella-kit__header {
  padding: 18px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ella-kit__title {
  font-weight: 900;
  font-size: 28px;
  margin: 0;
}

.ella-kit__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid var(--ella-border);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  transition: filter 180ms ease, background-color 180ms ease;
}

/* v1.1.31: match Checkout-style hover (slightly darker) */
.ella-kit__close:hover {
  filter: brightness(0.92);
}

.ella-kit__body {
  padding: 0 18px 18px;
  overflow: auto;
  position: absolute;
  top: 70px;
  bottom: 120px;
  left: 0;
  right: 0;
}

.ella-kit__section {
  margin-bottom: 18px;
}

.ella-kit__section-title {
  font-weight: 900;
  font-size: 18px;
  margin: 12px 0 10px;
}

.ella-kit__line {
  border: 1px solid var(--ella-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* v1.1.24: allow absolute-positioned Edit link */
  position: relative;
  /* v1.1.28: keep enough vertical room so top-right Edit never overlaps price
     even when there are no variation lines. */
  min-height: 74px;
}

.ella-kit__line img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
}

.ella-kit__line-main {
  flex: 1;
  min-width: 0;
  /* v1.1.24: keep text from sitting under the top-right Edit link */
  padding-right: 56px;
}

.ella-kit__line-title {
  font-weight: 900;
  margin: 0;
}

.ella-kit__line-sub {
  margin: 4px 0 0;
  color: var(--ella-muted);
  font-weight: 800;
  font-size: 13px;
  /* v1.1.24: show variations one-per-line */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ella-kit__line-subrow {
  line-height: 1.25;
}

.ella-kit__line-price {
  font-weight: 900;
  color: var(--ella-green);
}

/* v1.1.12: "Edit" in the slide-out kit drawer */
.ella-kit__edit {
  /* v1.1.26: tuck Edit into the top-right (no pill button) */
  position: absolute;
  /* v1.1.30: tuck a bit tighter into the corner and lift it so it never
     overlaps the price on shorter cards */
  /* v1.1.31: push closer to the real card corner (account for the 14px card padding) */
  /* v1.1.32: nudge down slightly (was a bit too high) */
  top: -3px;
  right: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  height: auto;
  color: #111;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  opacity: 0.65;
  white-space: nowrap;
  text-transform: none;
}

.ella-kit__edit:hover {
  opacity: 1;
}

/* v1.1.12: quick visual cue when returning to edit an option */
.ella-option--focus {
  outline: 3px solid var(--ella-orange-soft);
  outline-offset: 2px;
}

.ella-kit__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--ella-border);
  padding: 16px 18px;
  background: #fff;
}

.ella-kit__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 12px;
}

.ella-kit__checkout {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 999px;
  background: var(--ella-green);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  /* v1.1.24: hover darken */
  transition: filter 180ms ease;
}

.ella-kit__checkout:hover {
  filter: brightness(0.92);
}

/* Image modal */
.ella-modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: none;
}

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

.ella-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.ella-modal__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
}

/* Modal body can scroll if content is tall (large images) */
.ella-modal__content [data-ella-el="modalBody"]{
  padding: 16px;
  overflow: auto;
  max-height: calc(100% - 0px);
}

/*
  v1.1.40: Image lightbox should not require scrolling.
  We disable the internal scrollbar and size the stage to the viewport.
*/
.ella-modal--image .ella-modal__content [data-ella-el="modalBody"]{
  overflow: hidden;
}

.ella-modal--image .ella-modal-stage{
  /* keep within viewport height */
  height: 65vh;
  max-height: 520px;
}

/* v1.1.24: More Info popup title styling */
.ella-modal__title {
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  margin: 4px 0 12px;
}

.ella-modal__text {
  color: #1f2937;
  line-height: 1.55;
  font-weight: 700;
  text-align: center;
}

.ella-modal__content img {
  max-width: 100%;
  height: auto;
  display: block;
}

.ella-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--ella-border);
  font-weight: 900;
  z-index: 10;
  line-height: 1;
}

/* ==========================================================
 * Purchase Order modal (v1.1.54)
 * ========================================================== */

.ella-po {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ella-po__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.ella-po__btn {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--ella-border);
  font-weight: 700;
  background: rgba(243,244,246,0.8);
  color: #0b0f14;
}

.ella-po__btn--primary {
  background: var(--ella-green);
  color: var(--ella-cta-text);
  border: 1px solid rgba(0,0,0,0.06);
}

.ella-po__btn--primary:hover {
  filter: brightness(0.95);
}

.ella-po__note {
  text-align: center;
  color: var(--ella-muted);
  font-weight: 700;
  line-height: 1.45;
}

.ella-po__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ella-po__form label {
  font-weight: 800;
  color: #111827;
  font-size: 13px;
}

.ella-po__form input {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--ella-border);
  border-radius: 12px;
  font-weight: 700;
  min-height: 48px;
  box-sizing: border-box;
}

.ella-po__form textarea {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid var(--ella-border);
  border-radius: 12px;
  font-weight: 700;
  font: inherit;
  resize: vertical;
  min-height: 110px;
}

/* v1.1.57: make the "(Optional)" part of labels lighter (not bold) */
.ella-po__optional {
  font-weight: 500;
  color: var(--ella-muted);
}

.ella-po__progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  text-align: center;
}

.ella-po__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(0,0,0,0.14);
  border-top-color: var(--ella-orange);
  animation: ellaSpin 900ms linear infinite;
}

/* v1.1.56: subtle 3-dot progress indicator (matches the PO download UX) */
.ella-po__dots{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.ella-po__dots span{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(17,24,39,0.25);
  animation: ellaDotPulse 900ms ease-in-out infinite;
}

.ella-po__dots span:nth-child(2){
  animation-delay: 120ms;
}

.ella-po__dots span:nth-child(3){
  animation-delay: 240ms;
}

@keyframes ellaDotPulse{
  0%, 100%{ transform: translateY(0); opacity: 0.35; }
  50%{ transform: translateY(-2px); opacity: 1; }
}

.ella-po__status {
  font-weight: 900;
  font-size: 18px;
  color: #0b0f14;
}

.ella-po__sub {
  font-weight: 700;
  color: var(--ella-muted);
}

.ella-po__successIcon {
  font-size: 32px;
}

@media (max-width: 640px) {
  .ella-po__form { grid-template-columns: 1fr; }
  .ella-po__btn { width: 100%; }
}

/* Image preview + magnifier */
.ella-modal-image{
  display: flex;
  justify-content: center;
  align-items: center;
}

.ella-modal-image__stage{
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.ella-modal-image__img{
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  cursor: zoom-in;
  transform: none !important;
  transition: opacity 220ms ease;
}

/* v1.1.28: avoid a brief flash of an intermediate/partially-loaded image when opening
   the magnified preview. Fade in only once the image is loaded. */
.ella-modal-image__stage.is-loading .ella-modal-image__img{
  opacity: 0;
}

.ella-modal-image__stage.is-loaded .ella-modal-image__img{
  opacity: 1;
}

.ella-magnifier-lens{
  position: absolute;
  top: 0;
  left: 0;
  width: 255px;
  height: 255px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  background-repeat: no-repeat;
  pointer-events: none;
  display: none;
}

.ella-modal-image__stage.is-magnifying .ella-magnifier-lens{
  display: block;
}

/* ============================================
   Mobile layout
   ============================================ */

.ella-mobile {
  display: none;
}

@media (max-width: 959px) {
  /* v1.3.19: prevent Chrome pull-to-refresh on the configurator page */
  html, body {
    overscroll-behavior-y: contain;
  }

  .ella-header, .ella-bottom-nav {
    display: none;
  }

  .ella-body {
    /* v1.1.33: avoid iOS address-bar "extra scroll" by using a JS-synced unit */
    /* v1.1.37: allow natural document flow so the preview can size to the
       base image aspect ratio (removes the large empty gaps above the image). */
    height: auto;
    /* v1.1.42: let the configurator height shrink to its content on mobile.
       This removes the extra gray "dead space" under the Back/Next area.
       (Modals are fixed-position, so they do not rely on this min-height.) */
    min-height: 0;
    background: #ffffff;
    /* v1.3.13: prevent pull-to-refresh on mobile */
    overscroll-behavior: none;
    flex-direction: column;
  }

  .ella-preview {
    flex: none;
    width: 100%;
    /* v1.1.37: match the preview box to the base image aspect ratio so the
       image (object-fit: contain) doesn't float with large blank space above. */
    aspect-ratio: var(--ella-preview-ar, 1 / 1);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  /* v1.1.33: allow 1-finger scrolling over the preview (no "stuck" feeling).
     Image panning is handled via a 2-finger gesture in JS when zoomed. */
  .ella-preview__canvas {
    touch-action: pan-y;
  }

  /* v1.1.33: show the full image on mobile (avoid cropping) */
  .ella-preview__img {
    object-fit: contain;
    /* Keep the image fully visible (no crop) while preventing a large visual
       "gap" between the image and the fixed bottom sheet. */
    object-position: center;
  }

  /* Ensure the base image is not permanently covered by the bottom mobile
     sheet (we compute --ella-sheet-h in JS). */
  .ella-preview__stage {
    bottom: 0;
  }

  .ella-panel {
    display: none;
  }

  .ella-mobile {
    display: block;
    position: static;
    z-index: 30;
    pointer-events: auto;
  }

  .ella-mobile__top {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    pointer-events: auto;
  }

  .ella-mobile__cart {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-weight: 900;
    min-width: 90px;
  }

  .ella-mobile__cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 12px;
    line-height: 1;
    opacity: 0.98;
  }

  .ella-mobile__cart-price {
    font-weight: 900;
    letter-spacing: 0.2px;
  }

  .ella-mobile__close {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--ella-border);
    font-weight: 900;
    pointer-events: auto;
  }

  .ella-preview__controls {
    /* v1.1.45: move zoom controls higher into the top-right corner on mobile */
    top: 32px;
    right: 10px;
  }

  /* v1.1.41: make +/- buttons ~20% smaller on mobile */
  .ella-zoom-btn {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 18px;
  }

  /* Hide magnify on mobile (use zoom buttons + two-finger gesture instead) */
  .ella-preview__btn[data-ella-action="magnify"] {
    display: none;
  }

  /* Bottom sheet */
  .ella-sheet {
    /* v1.1.37: make this a normal section under the image.
       This eliminates the "gap" between the preview and the controls and
       prevents the controls area from drifting/overlapping during scroll. */
    position: static;
    height: auto;
    max-height: none;
    background: #fff;
    border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
    box-shadow: none;
    padding: 14px 18px 18px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
  }

  .ella-sheet__handle {
    display: none;
  }


  .ella-sheet__optionbtn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-weight: 900;
    margin-bottom: 14px;
  }

  .ella-sheet__title {
    text-align: center;
    font-weight: 900;
    font-size: 34px;
    margin: 0 0 16px;
  }

  .ella-sheet__selectrow {
    border: 1px solid var(--ella-border);
    border-radius: 18px;
    padding: 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.06);
  }

  .ella-sheet__selectmain{
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
  }
  .ella-sheet__selectlabel{
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .ella-sheet__selectsub{
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: rgba(17, 24, 39, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /*
    v1.1.40: when there are no variations/subtitle, hide the empty element so
    the main label sits vertically centered.
  */
  .ella-sheet__selectsub:empty{
    display:none;
  }
  .ella-sheet__selectrow--done .ella-sheet__selectsub{
    color: rgba(20, 122, 82, 0.85);
  }
  .ella-sheet__selectchev{
    font-size: 26px;
    line-height: 1;
    margin-left: 8px;
  }


  /* v1.1.37: show the CTA color when the current step has been completed */
  .ella-sheet__selectrow--done {
    border-color: var(--ella-cta);
    background: var(--ella-cta);
  }

  /* v1.1.45: completed steps should not show a separate check overlay.
     Instead we replace the chevron with a circular checkmark so the
     Optional pill is never covered. */
  .ella-sheet__selectrow--done::after {
    content: none;
  }

  .ella-sheet__selectchev--done {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ella-cta);
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    flex: 0 0 auto;
  }

  .ella-sheet__selectrow--done .ella-sheet__selectlabel {
    color: #ffffff;
  }

  .ella-sheet__selectrow--done .ella-sheet__selectsub{
    color: rgba(255,255,255,0.88);
  }

  .ella-sheet__selectrow--done .ella-sheet__selectchev{
    color: #ffffff;
  }

  /* v1.1.45: when the chevron is replaced with the completion checkmark,
     ensure it uses CTA color (not the done-row white chevron color). */
  .ella-sheet__selectrow--done .ella-sheet__selectchev--done{
    color: var(--ella-cta);
  }

  .ella-sheet__selectoptional {
    position: absolute;
    top: 4px;
    right: 52px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: none;
    background: #0f172a;
    color: #fff;
    padding: 3px 8px;
    border-radius: 999px;
    pointer-events: none;
  }

  /* v1.1.45: keep Optional anchored in its normal position since we no
     longer render a separate check overlay. */
  .ella-sheet__selectrow--done .ella-sheet__selectoptional{
    right: 52px;
  }

  .ella-sheet__selectoptional:empty {
    display: none;
  }

  .ella-sheet__footer{
    margin-top: auto;
    width: 100%;
    padding-top: 18px;
  }

  .ella-sheet__nav {
    margin-top: 0;
    display: flex;
    gap: 14px;
    width: 100%;
  }

  .ella-sheet__dots{
    display: flex;
    justify-content: center;
    /* v1.1.41: vertically align dot centers (active dot is larger) */
    align-items: center;
    gap: 10px;
    padding-top: 12px;
  }

  .ella-sheet__dot{
    width: 8px;
    height: 8px;
    /* v1.1.41: keep borders from changing overall dot box size */
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(17,24,39,0.20);
  }

  .ella-sheet__dot--active{
    width: 10px;
    height: 10px;
    background: rgba(17,24,39,0.75);
  }

  .ella-sheet__dot--done{
    /* v1.1.42: completed steps use an OUTLINE dot so it is not visually
       identical to the Checkout dot when Checkout is "ready" (solid). */
    background: transparent;
    border: 2px solid var(--ella-cta);
  }

  .ella-sheet__dot--checkout{
    width: 10px;
    height: 10px;
    background: transparent;
    border: 2px solid var(--ella-cta);
  }

  .ella-sheet__dot--checkout.ella-sheet__dot--ready{
    background: var(--ella-cta);
  }

  .ella-sheet__nav .ella-btn {
    flex: 1;
    padding: 16px;
    border-radius: 999px;
    border: 1px solid var(--ella-border);
    background: #fff;
    font-weight: 700;
    font-size: 18px;
  }

  .ella-sheet__nav .ella-btn--primary {
    border: 2px solid rgba(0,0,0,0.06);
  }

  /* Mobile modals */
  .ella-mobile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 70;
    display: none;
    pointer-events: auto;
  }

  .ella-mobile-modal--open {
    display: block;
  }

  .ella-mobile-modal__panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: 120px;
    background: #fff;
    border-radius: 24px;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  }

  .ella-mobile-modal__header {
    padding: 18px 18px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid var(--ella-border);
  }

  .ella-mobile-modal__title {
    font-weight: 900;
    font-size: 26px;
    margin: 0;
  }

  .ella-mobile-modal__close {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid var(--ella-border);
    font-weight: 900;
    position: relative;
    z-index: 11;
  }

  .ella-mobile-modal__body {
    padding: 18px;
  }

  /* Categories list */
  .ella-catlist .ella-catitem {
    width: 100%;
    text-align: left;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--ella-border);
    background: #f8fafc;
    position: relative;
    font-weight: 900;
    font-size: 20px;
    margin-bottom: 12px;
  }

  .ella-catlist .ella-catitem--active {
    background: #111827;
    color: #fff;
    border: 1px solid #111827;
  }

  /* Highlight completed steps in the All Categories viewer */
  .ella-catlist .ella-catitem--done:not(.ella-catitem--active):not(.ella-catitem--checkout) {
    /* v1.1.42: completed steps should look like the default blocks, but with
       a CTA outline + a green check indicator (so they are not confused with
       the active step or the Checkout CTA). */
    border: 2px solid var(--ella-cta);
    background: #f8fafc;
    color: #111827;
    /* Leave room for the completion checkmark on the right */
    padding-right: 56px;
  }

  /* v1.1.41: completion checkmark for done steps (mobile "All Categories" list) */
  .ella-catlist .ella-catitem--done:not(.ella-catitem--active):not(.ella-catitem--checkout)::after {
    content: "✓";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    /* v1.1.44: smaller so it doesn't collide with the Optional pill */
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--ella-cta);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
  }

  .ella-catlist .ella-catitem--done:not(.ella-catitem--active):not(.ella-catitem--checkout) .ella-catitem__optional{
    background: rgba(20, 122, 82, 0.14);
    color: var(--ella-cta);
    /* v1.1.44: keep the Optional pill clear of the completion check */
    right: 52px;
  }

  /* Optional tag inside the All Categories viewer */
  .ella-catlist .ella-catitem__optional {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.08);
    color: inherit;
    opacity: 0.85;
  }

  .ella-catlist .ella-catitem--active .ella-catitem__optional {
    background: rgba(255,255,255,0.16);
  }

  /* Make the Checkout row look like a primary CTA on mobile */
  .ella-catlist .ella-catitem--checkout {
    background: var(--ella-green);
    border: 1px solid var(--ella-green);
    color: var(--ella-cta-text, #fff);
    text-align: center;
    box-shadow: 0 12px 24px rgba(0,0,0,0.14);
    font-weight: 700;
  }

  .ella-catlist .ella-catitem--checkout:active {
    filter: brightness(0.96);
  }

  /* Mobile kit drawer */
  .ella-kit {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 85%;
    max-height: calc(var(--ella-vh, 1vh) * 100);
    border-radius: 22px 22px 0 0;
    transform: translateY(110%);
  }

  .ella-kit--open {
    transform: translateY(0);
  }

  /* v1.3.13: let title expand over price/qty area on mobile */
  .ella-option__header {
    flex-direction: column;
    gap: 6px;
  }

  .ella-option__header-left {
    min-width: unset;
    width: 100%;
  }

  .ella-option__title {
    padding-right: 32px;
  }

  .ella-option__header .ella-qty {
    margin-left: 0;
    align-self: flex-start;
  }
}


/* Toast / inline notifications */
.ella-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 999999;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.ella-toast.ella-toast--open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ella-toast.ella-toast--warn {
  background: rgba(194, 65, 12, 0.95);
}

/* Mobile: make notifications span ~90% width (requested) */
@media (max-width: 959px) {
  .ella-toast {
    width: calc(100vw - 32px);
  }

  /* Mobile: hide the magnification glass (unused on touch) */
  .ella-zoom-btn--magnify{
    display: none !important;
  }

  /* v1.3.25: right-align subtitle on mobile only */
  .ella-option__subtitle {
    text-align: right;
  }
}

/* Tablet (iPad): scale up the mobile sheet UI so it doesn't feel tiny on
   larger screens. */
@media (min-width: 768px) and (max-width: 959px) {
  .ella-sheet {
    padding: 28px 30px 26px;
  }
  .ella-sheet__title {
    font-size: 52px;
    margin: 12px 0 18px;
  }
  .ella-sheet__selectrow {
    padding: 20px 22px;
    font-size: 20px;
    border-radius: 20px;
  }
  .ella-sheet__selectoptional {
    top: 10px;
    right: 60px;
  }
  .ella-sheet__navbtn {
    padding: 22px 20px;
    font-size: 22px;
  }
  .ella-sheet__stepbtn {
    padding: 14px 22px;
    font-size: 18px;
  }
}



/* v1.3.8: compact the desktop configurator by ~10% while preserving a square preview. */
@media (min-width: 960px) {
  .ella-configurator {
    --ella-desktop-body-h: 576px;
    --ella-desktop-preview-size: 576px;
  }

  .ella-header {
    min-height: 58px;
    height: 58px;
    padding: 8px 12px;
    gap: 10px;
  }

  .ella-btn--pill,
  .ella-price-pill {
    height: 40px;
  }

  .ella-body {
    height: var(--ella-desktop-body-h);
  }

  .ella-preview {
    flex: 0 0 var(--ella-desktop-preview-size);
    width: var(--ella-desktop-preview-size);
  }

  .ella-preview__controls {
    top: 60px;
    right: 16px;
    gap: 7px;
  }

  .ella-zoom-btn {
    width: 60px;
    height: 60px;
    border-radius: 19px;
    font-size: 20px;
  }

  .ella-zoom-btn--magnify {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 15px;
  }

  .ella-panel__header {
    min-height: 84px;
    padding: 16px 18px 10px;
    gap: 10px;
  }

  .ella-panel__title {
    font-size: 34px;
  }

  .ella-panel__content {
    top: 84px;
    padding: 0 18px 16px;
  }

  .ella-group {
    margin-bottom: 12px;
  }

  .ella-group__btn {
    padding: 14px 16px;
    border-radius: 15px;
  }

  .ella-group__label {
    font-size: 18px;
  }

  .ella-tipwrap {
    margin: 6px 0 12px;
  }

  .ella-tipbar {
    min-height: 44px;
    padding: 0 13px;
  }

  .ella-tipcontent__inner {
    padding: 16px 13px 14px;
  }

  .ella-option {
    padding: 12px;
    gap: 12px;
    margin-bottom: 10px;
  }

  .ella-option__thumbwrap {
    width: 74px;
    gap: 5px;
  }

  .ella-option__thumb {
    width: 74px;
    height: 74px;
  }

  .ella-option__title {
    font-size: 20px;
  }

  .ella-bottom-nav {
    height: 82px;
    gap: 10px;
    padding: 12px;
  }

  .ella-nav-arrow {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .ella-steps {
    gap: 12px;
  }

  .ella-step {
    min-width: 218px;
    height: 54px;
    border-radius: 15px;
    gap: 9px;
    padding: 0 16px;
  }

  .ella-step__icon {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .ella-step__label {
    font-size: 15px;
  }

  .ella-step__optional {
    right: 6px;
    font-size: 9px;
    padding: 2px 7px;
  }

  .ella-step::after {
    bottom: 5px;
    width: 38px;
  }
}

/* --- Mobile niches quantity layout fix (migrated from EllaScript 787795 on 2026-04-17) --- */
@media (max-width: 959px) {
  .ella-option__header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 0 8px !important;
  }
  .ella-option__header-left { display: contents !important; }
  .ella-option__title {
    grid-column: 1 / -1 !important;
    padding-right: 0 !important;
  }
  .ella-option__price {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
  .ella-option__header .ella-qty {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
  }
}
