/*
 * Med | Uden — custom UI (not restyled EPO radios).
 * Brand accent: #459577 (Smart Stickers green)
 */

/* Halve EPO section gap (theme default 2×15px → 15px). */
#tm-extra-product-options > .tm-extra-product-options-fields {
  row-gap: 7px !important;
}

/*
 * Shared spacing for icon-card EPO sections (.aip-koen / .aip-stil / .aip-icon-picker).
 * EPO title→fields often live in .tc-section-inner-wrap > .tc-row with gap: var(--tcgap).
 */
.cpf-section.aip-icon-picker,
.aip-icon-picker,
.cpf-section.aip-koen,
.aip-koen,
.cpf-section.aip-stil,
.aip-stil {
  --aip-accent: #459577;
  --aip-icon-size: 72px;
  margin-bottom: 0 !important;
}

/* Køn: pre-Stil icon size (90px) + no title→icons gap */
.cpf-section.aip-koen,
.aip-koen {
  --aip-icon-size: 90px;
  --aip-koen-size: 90px;
}

.cpf-section.aip-icon-picker > .tc-row,
.aip-icon-picker > .tc-row,
.cpf-section.aip-icon-picker > .tc-section-inner-wrap > .tc-row,
.aip-icon-picker > .tc-section-inner-wrap > .tc-row,
.cpf-section.aip-stil > .tc-row,
.aip-stil > .tc-row,
.cpf-section.aip-stil > .tc-section-inner-wrap > .tc-row,
.aip-stil > .tc-section-inner-wrap > .tc-row {
  gap: 10px !important;
  row-gap: 10px !important;
  column-gap: 0 !important;
  margin: 0 !important;
}

.cpf-section.aip-koen > .tc-row,
.aip-koen > .tc-row,
.cpf-section.aip-koen > .tc-section-inner-wrap > .tc-row,
.aip-koen > .tc-section-inner-wrap > .tc-row {
  gap: 0 !important;
  row-gap: 0 !important;
  column-gap: 0 !important;
  margin: 0 !important;
}

.cpf-section.aip-icon-picker h2.tm-section-label,
.cpf-section.aip-icon-picker .tm-section-label,
.aip-icon-picker h2.tm-section-label,
.aip-icon-picker .tm-section-label,
.cpf-section.aip-koen h2.tm-section-label,
.cpf-section.aip-koen .tm-section-label,
.aip-koen h2.tm-section-label,
.aip-koen .tm-section-label,
.cpf-section.aip-stil h2.tm-section-label,
.cpf-section.aip-stil .tm-section-label,
.aip-stil h2.tm-section-label,
.aip-stil .tm-section-label {
  margin: 0 !important;
  padding: 0 !important;
}

/* Extra air AFTER an icon section — parent <li> owns the gap */
#tm-extra-product-options
  .tm-extra-product-options-field:has(> .cpf-section.aip-icon-picker),
#tm-extra-product-options
  .tm-extra-product-options-field:has(> .aip-icon-picker),
#tm-extra-product-options
  .tm-extra-product-options-field:has(> .cpf-section.aip-koen),
#tm-extra-product-options
  .tm-extra-product-options-field:has(> .cpf-section.aip-stil) {
  padding-bottom: 1.65rem !important;
  margin-bottom: 0 !important;
}

.cpf-section.aip-jersey-mode,
.cpf-section.aip-photo,
.aip-actions {
  --aip-accent: #459577;
  --aip-accent-dark: #3a7d63;
  --aip-accent-soft: #eef6f2;
}

.cpf-section.aip-jersey-mode .aip-epo-radios-hidden,
.aip-jersey-mode .aip-epo-radios-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.aip-segment-ui {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  width: 100%;
  max-width: 280px;
  margin: 0 0 0.35rem;
  padding: 0;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  overflow: hidden; /* clips active fill to the outer radius — no white gap */
  background: #f3f3f3;
  box-sizing: border-box;
}

.aip-segment-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 50%;
  margin: 0;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0; /* radius comes from parent overflow:hidden */
  background: transparent;
  color: #222;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.aip-segment-btn:hover:not(.is-active) {
  background: var(--aip-accent-soft, #eef6f2);
  color: #1a1a1a;
}

.aip-segment-btn.is-active {
  background: var(--aip-accent, #459577);
  color: #fff;
}

.aip-segment-btn.is-active:hover {
  background: var(--aip-accent-dark, #3a7d63);
  color: #fff;
}

.aip-segment-ui.is-busy .aip-segment-btn {
  cursor: wait;
}

.aip-segment-btn:focus-visible {
  outline: 2px solid var(--aip-accent, #459577);
  outline-offset: -2px;
  z-index: 1;
}

/* Nr. field under Med — must fully leave the EPO flex flow when Uden */
.cpf-section.aip-jersey {
  margin-top: 0.35rem;
}

.cpf-section.aip-jersey.aip-hide,
.cpf-section.aip-jersey[aria-hidden='true'],
.cpf-section.aip-koen.aip-hide,
.cpf-section.aip-koen[aria-hidden='true'] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

/* Product form <li class="tc-row">: stay content-sized (no leftover bottom gap). */
#tm-extra-product-options .tm-extra-product-options-field.tc-row {
  height: auto !important;
  min-height: 0 !important;
  align-content: flex-start !important;
}

.cpf-section.aip-jersey .tm-epo-element-label,
.cpf-section.aip-jersey .tc-epo-element-label {
  margin-bottom: 0.25rem;
}

.cpf-section.aip-jersey .tmcp-textfield,
.aip-jersey .tmcp-textfield {
  max-width: 6.5rem;
  margin-left: 10px !important;
  border-radius: 8px !important;
  padding: 0.55rem 0.65rem !important;
}

/* Upload dropzone */
.cpf-section.aip-photo.aip-photo-ready .cpf-upload-wrap,
.cpf-section.aip-photo.aip-photo-ready input.tmcp-upload,
.cpf-section.aip-photo.aip-photo-ready .tc-max-file-size,
.cpf-section.aip-photo.aip-photo-ready .tm-epo-element-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

/* Photo gallery (variant 1 — multi upload) */
.aip-photo-gallery {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.aip-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 140px;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--aip-accent, #459577);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.aip-photo-empty:hover,
.aip-photo-empty:focus-visible {
  border-color: var(--aip-accent-dark, #3a7d63);
  background: var(--aip-accent-soft, #eef6f2);
  outline: none;
}

.aip-photo-empty-text {
  font-size: 0.98rem;
  font-weight: 500;
  color: #222;
}

.aip-photo-gallery.is-dragover .aip-photo-empty,
.aip-photo-gallery.is-dragover .aip-photo-filled {
  border-color: var(--aip-accent, #459577);
  background: var(--aip-accent-soft, #eef6f2);
}

.aip-photo-gallery.is-busy {
  /* Thumbs stay clickable so customers can browse finished photos. */
}

.aip-photo-gallery.is-busy .aip-photo-change-btn.is-working {
  pointer-events: none;
}

.aip-photo-gallery.is-blocked {
  pointer-events: none;
  opacity: 0.72;
}

.aip-photo-gallery.is-blocked .aip-photo-empty {
  border-style: solid;
  border-color: #e0b4b4;
  background: #fdf6f6;
}

.aip-photo-filled {
  display: grid;
  gap: 0.75rem;
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.aip-photo-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  overflow-x: auto;
  /* overflow-x:auto forces overflow-y to auto — room for × shadow must be padding, not “visible” */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  /* top/right: × sits outside corner (−10/−12px) + ~10px blur; keep shadow inside clip edge */
  padding: 22px 18px 8px 4px;
  box-sizing: border-box;
}

.aip-photo-thumb {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 calc((100% - 1.5rem) / 3);
  width: calc((100% - 1.5rem) / 3);
  max-width: 88px;
  min-width: 68px;
  /* Match poster 7:10 — wider 3:4 thumbs showed shop-preview white side margins */
  aspect-ratio: 7 / 10;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: visible;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
}

.aip-photo-thumb-frame {
  position: absolute;
  inset: 0;
  /* Same as køn: ring via box-shadow so image fills flush (no border “gap”) */
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: 0 0 0 2px #e4e4e4;
  transition: box-shadow 0.15s ease;
  box-sizing: border-box;
}

.aip-photo-thumb-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/*
 * Shop preview JPEG = art + white margin + shadow.
 * object-view-box crops to art rect only (891×1250 → 783×1108 hole).
 */
.aip-photo-thumb-frame img.aip-thumb-crop-margin {
  object-view-box: var(--aip-thumb-view-box, 57px 71px 777px 1102px);
  object-fit: cover;
  object-position: center center;
}

/*
 * Fallback when object-view-box is unsupported.
 * Must zoom ≥ canvas/hole (~114%) or white shop-preview margins leak in.
 */
@supports not (object-view-box: 57px 71px 777px 1102px) {
  .aip-photo-thumb-frame img.aip-thumb-crop-margin {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--aip-thumb-crop-scale, 118%);
    height: var(--aip-thumb-crop-scale, 118%);
    min-width: var(--aip-thumb-crop-scale, 118%);
    min-height: var(--aip-thumb-crop-scale, 118%);
    transform: translate(-50%, -50%);
    object-view-box: unset;
    object-fit: cover;
    object-position: center center;
  }
}

.aip-photo-thumb-frame img.aip-thumb-img-dim {
  opacity: 0.35;
}

.aip-photo-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.45rem;
  box-sizing: border-box;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  color: #777;
}

.aip-photo-thumb.is-pending .aip-photo-thumb-frame,
.aip-photo-thumb.is-active.is-busy .aip-photo-thumb-frame {
  border: 0;
  box-shadow: 0 0 0 1.5px var(--aip-accent, #459577);
  border-radius: 10px;
  background: var(--aip-accent-soft, #eef6f2);
}

.aip-photo-thumb.is-active:not(.is-pending):not(.is-busy) .aip-photo-thumb-frame {
  box-shadow: 0 0 0 2px var(--aip-accent, #459577);
}

/* Active mark: green corner wedge on thumb cell; covers frame ring flush */
.aip-photo-thumb-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  left: auto;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 100% 0 10px 0;
  background: var(--aip-accent, #459577);
  color: #fff;
  pointer-events: none;
  box-sizing: border-box;
  box-shadow: none;
}

.aip-photo-thumb-badge svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.38rem 0 0 0.52rem;
}

/* F — close half outside corner, large touch target */
.aip-photo-thumb-remove {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  background: #fff;
  color: #222;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.aip-photo-thumb-remove svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
  pointer-events: none;
}

.aip-photo-add:hover,
.aip-photo-add:focus-visible,
.aip-photo-thumb:hover .aip-photo-thumb-frame,
.aip-photo-thumb:focus-visible .aip-photo-thumb-frame {
  border-color: var(--aip-accent-dark, #3a7d63);
  outline: none;
}

.aip-photo-thumb-remove:hover,
.aip-photo-thumb-remove:focus-visible {
  background: #fff;
  color: #b32d2e;
  border-color: rgba(179, 45, 46, 0.35);
  box-shadow:
    0 3px 10px rgba(179, 45, 46, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.9);
  outline: none;
}

.aip-thumb-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.65rem;
  box-sizing: border-box;
  background: var(--aip-accent-soft, #eef6f2);
}

.aip-thumb-progress-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0.55rem;
  background: rgba(238, 246, 242, 0.92);
}

.aip-thumb-img-dim {
  opacity: 0.28;
  filter: saturate(0.85);
}

.aip-progress {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.aip-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(69, 149, 119, 0.22);
  overflow: hidden;
}

.aip-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--aip-accent, #459577);
  transition: width 0.55s ease-out;
}

.aip-progress-pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--aip-accent-dark, #3a7d63);
  line-height: 1;
}

.aip-photo-change-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 100%;
  margin: 0.15rem 0 0.35rem;
  padding: 0.7rem 1rem;
  box-sizing: border-box;
  border: 2px solid var(--aip-accent, #459577);
  border-radius: 8px;
  background: #fff;
  color: var(--aip-accent, #459577);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.aip-photo-change-btn:hover,
.aip-photo-change-btn:focus-visible {
  background: var(--aip-accent-soft, #eef6f2);
  border-color: var(--aip-accent-dark, #3a7d63);
  color: var(--aip-accent-dark, #3a7d63);
  outline: none;
}

.aip-photo-change-btn.is-working,
.aip-photo-change-btn.is-working:hover,
.aip-photo-change-btn.is-working:focus-visible {
  border-color: #c8c8c8;
  background: #f3f3f3;
  color: #666;
  cursor: wait;
  opacity: 1;
}

.aip-photo-change-btn:disabled {
  pointer-events: none;
}

.aip-btn-spinner {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  border: 2.5px solid rgba(102, 102, 102, 0.28);
  border-top-color: #666;
  border-radius: 50%;
  animation: aip-spin 0.75s linear infinite;
}

.aip-btn-spinner--on-dark {
  border-color: rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
}

.aip-btn-spinner--on-light {
  border-color: rgba(34, 34, 34, 0.2);
  border-top-color: #1a1a1a;
}

.aip-photo-change-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .aip-photo-strip {
    gap: 0.75rem;
    padding-top: 24px;
    padding-right: 18px;
  }

  .aip-photo-thumb {
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    max-width: 82px;
  }

  .aip-photo-thumb-remove {
    width: 44px;
    height: 44px;
    top: -12px;
    right: -12px;
  }

  .aip-photo-thumb-remove svg {
    width: 18px;
    height: 18px;
  }

  .aip-photo-thumb-badge {
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border-radius: 100% 0 10px 0;
  }

  .aip-photo-thumb-badge svg {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0.32rem 0 0 0.5rem;
  }
}

/* Narrow phones: keep close buttons from overlapping adjacent thumbs */
@media (max-width: 330px) {
  .aip-photo-strip {
    gap: 1.125rem;
    padding-top: 18px;
    padding-right: 16px;
  }

  .aip-photo-thumb {
    flex: 0 0 72px;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }

  .aip-photo-thumb-remove {
    width: 34px;
    height: 34px;
    top: -7px;
    right: -6px;
  }

  .aip-photo-thumb-remove svg {
    width: 15px;
    height: 15px;
  }

  .aip-photo-thumb-badge {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border-radius: 100% 0 10px 0;
  }

  .aip-photo-thumb-badge svg {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0.3rem 0 0 0.45rem;
  }
}

.aip-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 140px;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--aip-accent, #459577);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.aip-dropzone:hover,
.aip-dropzone:focus-visible {
  border-color: var(--aip-accent-dark, #3a7d63);
  background: var(--aip-accent-soft, #eef6f2);
  outline: none;
}

.aip-dropzone.is-dragover {
  border-color: var(--aip-accent, #459577);
  background: var(--aip-accent-soft, #eef6f2);
}

.aip-dropzone.is-busy {
  pointer-events: none;
  cursor: default;
}

.aip-dropzone.is-blocked {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.72;
  border-style: solid;
  border-color: #e0b4b4;
  background: #fdf6f6;
}

/* Loading overlay on photo gallery */
.aip-photo-gallery .aip-dropzone-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  box-sizing: border-box;
}

.aip-dropzone-loading-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  text-align: center;
}

.aip-dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #222;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 182, 193, 0.55), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(186, 230, 170, 0.45), transparent 55%),
    #f4f4f4;
}

.aip-dropzone-text {
  font-size: 0.98rem;
  font-weight: 500;
  color: #222;
}

.aip-dropzone-file {
  font-size: 0.85rem;
  color: #666;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aip-dropzone.has-file {
  border-style: solid;
  border-color: #cfcfcf;
}

.aip-dropzone-remove {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #666;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.aip-dropzone-remove:hover,
.aip-dropzone-remove:focus-visible {
  color: #b32d2e;
  outline: none;
}

.aip-dropzone-remove[hidden] {
  display: none !important;
}

/* Actions: update only when dirty, polished loading */
.aip-hide {
  display: none !important;
}

.aip-actions {
  display: grid;
  gap: 0.75rem;
  margin: 0.55rem 0 0.85rem;
}

/* When update panel is hidden, drop the whole actions wrapper (no empty margin). */
.aip-actions.aip-hide {
  display: none !important;
  margin: 0 !important;
  gap: 0 !important;
}

.aip-update-panel {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e8c4b8;
  border-radius: 10px;
  background: #fdf4f1;
}

.aip-stale {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: #3a2a26;
}

.aip-update-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--aip-accent, #459577);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.aip-update-btn:hover,
.aip-update-btn:focus-visible {
  background: var(--aip-accent-dark, #3a7d63);
  color: #fff;
  outline: none;
}

.aip-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #d8d8d8;
  border-top-color: var(--aip-accent, #459577);
  border-radius: 50%;
  animation: aip-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

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

.aip-upload-notice {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.45;
  color: #5c5c5c;
}

.aip-upload-notice a {
  color: var(--aip-accent, #459577);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.aip-upload-notice a:hover,
.aip-upload-notice a:focus-visible {
  color: var(--aip-accent-dark, #3a7d63);
}

.aip-status {
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
  border-radius: 10px;
  box-sizing: border-box;
}

.aip-status.is-error {
  color: #8a1f1f;
  background: #fdf6f6;
  border: 1px solid #e8b4b4;
}

/* Gallery loading overlay */
.aip-gallery-host {
  position: relative;
}

/*
 * Flatsome child theme: `.product-thumbnails a { border: 1px solid #aaa !important; }`
 * looks heavy on AI poster thumbs — remove border for AIP gallery only.
 */
.single-product .product-gallery.aip-gallery-host .product-thumbnails a {
  border: none !important;
}
/*
 * Hide WC thumbs ASAP on AIP PDPs (before JS) to avoid thumb-strip flash.
 * Opt-in later with .aip-gallery--thumbs-on (room/lifestyle shots).
 */
body.aip-product-page .product-gallery .product-thumbnails,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .product-thumbnails,
.single-product .product-gallery.aip-gallery-host .product-thumbnails.aip-hide {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/*
 * Catalog = one plakat — no Flickity swipe to phone / other WC slides.
 * CRITICAL: hide extras + clip overflow on body.aip-product-page BEFORE JS
 * adds .aip-gallery-host / .aip-gallery--single. Otherwise multi-slide width
 * overflows the viewport → mobile shrink-to-fit flash, then snap to full width.
 * Opt out with .aip-gallery--thumbs-on (room/lifestyle). pan-y: vertical scroll OK.
 */
body.aip-product-page .product-gallery .product-gallery-slider,
body.aip-product-page .product-gallery .flickity-viewport {
  overflow: hidden !important;
  max-width: 100% !important;
}
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .product-gallery-slider > .slide:not(.first),
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .product-gallery-slider > .woocommerce-product-gallery__image:not(.first),
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .flickity-slider > .slide:not(.first),
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .flickity-slider > .woocommerce-product-gallery__image:not(.first),
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-slider > .slide:not(.first),
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-slider > .woocommerce-product-gallery__image:not(.first) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .product-gallery-slider,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-viewport,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-slider,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .slide,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .woocommerce-product-gallery__image,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single a,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single img:not(.frame-image) {
  touch-action: pan-y !important;
}
/* Main poster looks clickable (opens lightbox). */
body.aip-product-page.aip-lb-ready .product-gallery .product-gallery-slider .slide.first a,
body.aip-product-page.aip-lb-ready .product-gallery .product-gallery-slider .slide.first img:not(.frame-image),
body.aip-product-page.aip-lb-ready .product-gallery .product-gallery-slider .woocommerce-product-gallery__image a,
body.aip-product-page.aip-lb-ready .product-gallery .product-gallery-slider .woocommerce-product-gallery__image img:not(.frame-image),
body.aip-product-page.aip-lb-ready a.woocommerce-main-image,
body.aip-product-page.aip-lb-ready a.woocommerce-main-image img:not(.frame-image),
.single-product .product-gallery.aip-gallery-host.aip-gallery--single a,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single img:not(.frame-image) {
  cursor: pointer !important;
}
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .flickity-button,
body.aip-product-page .product-gallery:not(.aip-gallery--thumbs-on) .flickity-page-dots,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-button,
.single-product .product-gallery.aip-gallery-host.aip-gallery--single .flickity-page-dots {
  display: none !important;
}
body.aip-product-page .product-gallery.aip-gallery--thumbs-on .product-thumbnails {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

/*
 * Poster vs phone-composite can differ a few px in intrinsic size. Flickity
 * adaptiveHeight then resizes .flickity-viewport on select → page jump.
 * Lock layout boxes to the shop-preview canvas ratio (891×1250).
 *
 * IMPORTANT: gate on body.aip-product-page (PHP first paint), NOT .aip-gallery-host
 * (added by JS later). Host-only rules caused the mobile main-image size flash.
 */
body.aip-product-page .product-gallery .product-gallery-slider img:not(.frame-image),
body.aip-product-page .product-gallery .product-thumbnails img,
.single-product .product-gallery.aip-gallery-host .product-gallery-slider img:not(.frame-image),
.single-product .product-gallery.aip-gallery-host .product-thumbnails img {
  aspect-ratio: 891 / 1250;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain;
  vertical-align: top;
}

body.aip-product-page .product-gallery .product-thumbnails .col,
body.aip-product-page .product-gallery .product-thumbnails a,
.single-product .product-gallery.aip-gallery-host .product-thumbnails .col,
.single-product .product-gallery.aip-gallery-host .product-thumbnails a {
  line-height: 0;
}

.aip-gallery-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  border-radius: inherit;
}

.aip-gallery-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  min-width: 180px;
}

.aip-gallery-loading-inner .aip-progress {
  min-width: 160px;
}

.aip-gallery-loading-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #333;
}

.single-product .product-gallery.aip-gallery-host .product-gallery-slider,
.single-product .product-gallery.aip-gallery-host .product-gallery-slider a,
.single-product .product-gallery.aip-gallery-host .product-gallery-slider img:not(.frame-image),
.single-product .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery__image a,
.single-product .woocommerce-product-gallery__image img:not(.frame-image),
.single-product .aip-gallery-text-host,
.single-product .aip-gallery-text-host > img:not(.frame-image) {
  cursor: pointer;
}

.product-gallery .woocommerce-product-gallery img {
  transition: opacity 0.2s ease;
}

.aip-cart-gate {
  margin: 0 0 0.65rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: #8a1f1f;
  background: #fdf6f6;
  border: 1px solid #e8b4b4;
  border-radius: 10px;
  box-sizing: border-box;
}

button.single_add_to_cart_button.aip-cart-blocked,
button.aip-cart-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.aip-preview-disclaimer {
  box-sizing: border-box;
}

/* Class display rules must not override the hidden attribute. */
.aip-preview-disclaimer[hidden] {
  display: none !important;
}

.aip-preview-disclaimer--above-banner {
  margin: 0 0 12px;
  padding: 0;
  box-sizing: border-box;
}

/* Outside inner .row (on .col.large-9) — aligns with gallery, stays under header menus. */
.aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount {
  display: block;
  flex: none;
  width: auto;
  max-width: none;
  margin: 0 0 12px;
  padding: 0;
  box-sizing: border-box;
}

/*
 * No-frame uses negative margin on the gallery — without a stacking context the
 * later sibling (gallery) paints over the disclaimer. relative + low z-index
 * keeps the banner above the poster, still far below sticky header / nav (~30–999).
 */
.aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount:not([hidden]) {
  position: relative;
  z-index: 2;
}

.col > .aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount {
  margin-bottom: 12px;
}

/* Desktop/tablet (≥768). */
@media (min-width: 768px) {
  .col > .aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount {
    margin-bottom: 0;
  }

  /* Without frame: pull gallery under the disclaimer. */
  .single-product
    .col.large-9:has(> .aip-preview-disclaimer--above-banner:not([hidden]))
    .product-gallery.col.large-6.aip-gallery--no-frame {
    margin-top: -15px !important;
  }
}

/* 768–870: slight top offset on the watermark banner. */
@media (min-width: 768px) and (max-width: 870px) {
  .col > .aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount {
    margin-top: 6px;
  }
}

/* Mobile / narrow tablet (≤767). */
@media (max-width: 767px) {
  .col > .aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount {
    margin-bottom: 0;
  }

  .aip-preview-disclaimer--above-banner.aip-preview-disclaimer--row-mount:not([hidden]) {
    margin-top: 35px;
    margin-bottom: 12px;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  /*
   * Anchor @767 (good): no-frame -35px, framed -17px.
   * Soften toward 320 so banner↔image gap does not collapse.
   * Tweak the end values in clamp() if spacing needs a nudge later.
   */
  .single-product
    .col.large-9:has(> .aip-preview-disclaimer--above-banner:not([hidden]))
    .product-gallery.col.large-6.aip-gallery--no-frame {
    /* -35px @767 → ~-8px @320 */
    margin-top: clamp(-35px, calc(-35px + (767px - 100vw) * 0.0604), -8px) !important;
  }

  .single-product
    .col.large-9:has(> .aip-preview-disclaimer--above-banner:not([hidden]))
    .product-gallery.col.large-6:not(.aip-gallery--no-frame) {
    /* -17px @767 → ~8px @320 */
    margin-top: clamp(-17px, calc(-17px + (767px - 100vw) * 0.056), 8px);
  }

  /*
   * Theme/custom CSS often keeps .large-6 at ~80% on mobile.
   * Full-width on first paint via body.aip-product-page (not host — host is JS-late).
   */
  body.aip-product-page .product-gallery.col.large-6,
  .single-product .product-gallery.col.large-6.aip-gallery-host,
  .single-product .product-gallery.col.large-6:has(.aip-gallery-host),
  .single-product .product-gallery.col.large-6:has(.aip-text-toolbar),
  .single-product .product-gallery.col.large-6:has(+ .aip-text-toolbar) {
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Shrink-wrap host left a gap after preview swap until refresh. */
  .single-product .product-gallery .aip-gallery-text-host {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    cursor: pointer;
  }

  .single-product .product-gallery .aip-gallery-text-host > img:not(.frame-image) {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    cursor: pointer;
  }
}

/* ≤400px: full-width banner text on very narrow screens. */
@media (max-width: 400px) {
  .aip-preview-disclaimer--above-banner .aip-preview-disclaimer__inner {
    width: 100%;
    max-width: 100%;
  }
}

.aip-preview-disclaimer--above-banner .aip-preview-disclaimer__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(69, 149, 119, 0.32);
  background: linear-gradient(135deg, rgba(69, 149, 119, 0.1), rgba(69, 149, 119, 0.04));
  color: #3a5a4a;
}

.aip-preview-disclaimer--above-banner.aip-preview-disclaimer--tone-warm .aip-preview-disclaimer__inner {
  border-color: rgba(247, 92, 76, 0.34);
  background: linear-gradient(135deg, rgba(247, 92, 76, 0.11), rgba(247, 92, 76, 0.04));
  color: #5a3a34;
}

.aip-preview-disclaimer--above-banner.aip-preview-disclaimer--tone-neutral .aip-preview-disclaimer__inner {
  border-color: rgba(46, 111, 168, 0.3);
  background: linear-gradient(135deg, rgba(46, 111, 168, 0.1), rgba(46, 111, 168, 0.04));
  color: #2c4a66;
}

/* Solid badge + white i (14px glyph in 20px circle). */
.aip-preview-disclaimer__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 50%;
  background: #459577;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.aip-preview-disclaimer--tone-warm .aip-preview-disclaimer__icon {
  background: #f75c4c;
  color: #fff;
}

.aip-preview-disclaimer--tone-neutral .aip-preview-disclaimer__icon {
  background: #2e6fa8;
  color: #fff;
}

.aip-preview-disclaimer__icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.aip-preview-disclaimer__text {
  flex: 1 1 auto;
  min-width: 0;
}

.aip-preview-disclaimer__body {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: inherit;
}

.aip-preview-disclaimer--tone-warm .aip-preview-disclaimer__body {
  color: #6b3f38;
}

.aip-preview-disclaimer--tone-neutral .aip-preview-disclaimer__body {
  color: #2c4a66;
}

@media (max-width: 360px) {
  .aip-preview-disclaimer--above-banner .aip-preview-disclaimer__inner {
    padding: 8px 10px;
    gap: 8px;
  }

  .aip-preview-disclaimer__body {
    font-size: 12px;
    line-height: 1.3;
  }
}

.aip-preview-disclaimer--above-compact {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: #4a6358;
  background: #f4f8f6;
  border: 1px solid #d8e8e0;
  border-radius: 6px;
}

.aip-preview-disclaimer--below-subtle {
  margin: 0.65rem 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #777;
  text-align: center;
}

.aip-preview-disclaimer--below-emphasis {
  margin: 0.65rem 0 0;
  font-size: 13px;
  color: #555;
  padding: 0.45rem 0.75rem;
  background: #f6f6f6;
  border-radius: 4px;
  text-align: center;
}

/* Multi-person subject crop (before OpenAI) */
html.aip-crop-open,
html.aip-crop-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.aip-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(18, 22, 20, 0.72);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
}

.aip-crop-sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

.aip-crop-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.aip-crop-controls {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 0;
  background: #fff;
}

/* Desktop card — require height so landscape phones keep full-bleed layout */
@media (min-width: 720px) and (min-height: 640px) {
  .aip-crop-overlay {
    align-items: center;
    padding: 1.25rem;
  }

  .aip-crop-sheet {
    width: min(560px, 100%);
    max-width: 560px;
    height: auto;
    max-height: min(92dvh, 860px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  }
}

/* Landscape phone/tablet: image left, controls right — no overlap */
@media (orientation: landscape) and (max-height: 560px) {
  .aip-crop-overlay {
    align-items: stretch;
    padding: 0;
  }

  .aip-crop-sheet {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .aip-crop-header {
    padding: 0.4rem 0.75rem 0.25rem;
  }

  .aip-crop-title {
    font-size: 0.95rem;
  }

  .aip-crop-hint {
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .aip-crop-main {
    flex-direction: row;
    min-height: 0;
  }

  .aip-crop-stage {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 0.35rem 0.45rem 0.45rem;
  }

  .aip-crop-controls {
    flex: 0 0 min(280px, 40%);
    max-width: 40%;
    justify-content: center;
    border-left: 1px solid #ececec;
  }

  .aip-crop-person-bar {
    padding: 0.35rem 0.65rem;
    border-top: none;
  }

  .aip-crop-person-prev,
  .aip-crop-person-next {
    width: 40px;
    height: 40px;
  }

  .aip-crop-actions {
    flex-direction: column;
    padding: 0.45rem 0.65rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }

  .aip-crop-cancel,
  .aip-crop-confirm {
    min-height: 42px;
    width: 100%;
  }
}

.aip-crop-header {
  padding: 0.85rem 1rem 0.5rem;
  flex: 0 0 auto;
}

.aip-crop-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: #1a1a1a;
  line-height: 1.3;
}

.aip-crop-hint {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #5c5c5c;
}

.aip-crop-stage {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.aip-crop-frame {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.aip-crop-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  vertical-align: middle;
}

.aip-crop-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  pointer-events: none;
}

.aip-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(69, 149, 119, 0.9);
  cursor: move;
  touch-action: none;
  outline: none;
  z-index: 3;
}

.aip-crop-box:focus-visible {
  box-shadow: 0 0 0 2px var(--aip-accent, #459577);
}

.aip-crop-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--aip-accent, #459577);
  box-sizing: border-box;
  touch-action: none;
}

.aip-crop-handle--nw {
  left: -14px;
  top: -14px;
  cursor: nwse-resize;
}

.aip-crop-handle--ne {
  right: -14px;
  top: -14px;
  cursor: nesw-resize;
}

.aip-crop-handle--sw {
  left: -14px;
  bottom: -14px;
  cursor: nesw-resize;
}

.aip-crop-handle--se {
  right: -14px;
  bottom: -14px;
  cursor: nwse-resize;
}

.aip-crop-person-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.aip-crop-person-prev,
.aip-crop-person-next {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid var(--aip-accent, #459577);
  background: var(--aip-accent-soft, #eef6f2);
  color: var(--aip-accent-dark, #3a7d63);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aip-crop-person-prev:hover,
.aip-crop-person-next:hover,
.aip-crop-person-prev:focus-visible,
.aip-crop-person-next:focus-visible {
  background: var(--aip-accent, #459577);
  border-color: var(--aip-accent, #459577);
  color: #fff;
  outline: none;
}

.aip-crop-person-label {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

.aip-crop-actions {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #ececec;
  flex: 0 0 auto;
  background: #fff;
}

.aip-crop-cancel,
.aip-crop-confirm {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 0.65rem 0.55rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.aip-crop-cancel {
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #222;
}

.aip-crop-confirm {
  border: 1px solid var(--aip-accent, #459577);
  background: var(--aip-accent, #459577);
  color: #fff;
}

.aip-crop-confirm:hover,
.aip-crop-confirm:focus-visible {
  background: var(--aip-accent-dark, #3a7d63);
  border-color: var(--aip-accent-dark, #3a7d63);
  outline: none;
}

.aip-crop-cancel:hover,
.aip-crop-cancel:focus-visible {
  background: #f6f6f6;
  outline: none;
}

/* Admin midlertidigt � sticky dock (h�jre side, kun WP-admin) */
.aip-admin-dock {
  position: fixed;
  top: 96px;
  right: 12px;
  z-index: 99990;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border: 1.5px dashed #b32d2e;
  border-radius: 10px;
  background: rgba(255, 248, 248, 0.97);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.aip-admin-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #fff0f0;
  border-bottom: 1px solid #f0c4c4;
  color: #b32d2e;
  font-size: 12px;
}
.aip-admin-dock__toggle {
  appearance: none;
  border: 1px solid #d99;
  background: #fff;
  color: #b32d2e;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 11px;
  cursor: pointer;
}
.aip-admin-dock__body {
  overflow-y: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.aip-admin-dock.is-collapsed {
  max-height: none;
}
.aip-admin-card {
  margin: 0;
  padding: 0.55rem;
  border: 1px solid #f0c4c4;
  border-radius: 8px;
  background: #fff;
}
.aip-admin-card__toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.aip-admin-card__toggle .aip-admin-card__title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}
.aip-admin-card__summary {
  grid-column: 1;
  grid-row: 2;
  font-size: 11px;
  color: #666;
  line-height: 1.3;
  word-break: break-word;
}
.aip-admin-card__chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #b32d2e;
  border-bottom: 2px solid #b32d2e;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.aip-admin-card--collapsible:not(.is-collapsed) .aip-admin-card__chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}
.aip-admin-card__body {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid #f0c4c4;
}
.aip-admin-card__title {
  margin: 0 0 0.35rem;
  font-size: 12px;
  font-weight: 700;
  color: #b32d2e;
}
.aip-admin-card__meta,
.aip-admin-hint {
  margin: 0 0 0.45rem;
  font-size: 11px;
  color: #666;
  line-height: 1.35;
}
.aip-admin-card__meta-line {
  display: block;
}
.aip-admin-hint { margin: 0.35rem 0 0; }
.aip-admin-check--enabled {
  display: block;
  margin: 0 0 0.45rem;
}
.aip-temp-text-template {
  --aip-admin-control-h: 2.35rem;
}
.aip-admin-preset-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 0.45rem;
}
.aip-admin-preset-row__label {
  font-size: 11px;
  line-height: 1.2;
  color: inherit;
}
.aip-admin-preset-row__controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.aip-admin-preset-row__select {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  height: var(--aip-admin-control-h);
  min-height: var(--aip-admin-control-h);
  line-height: 1.2;
  padding: 0 0.45rem;
  margin: 0;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #fff;
  color: #1d2327;
  font-size: 12px;
}
.aip-admin-preset-row__controls .button {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
  height: var(--aip-admin-control-h);
  min-height: var(--aip-admin-control-h);
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aip-admin-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.5rem;
  box-sizing: border-box;
  border: 1px dashed rgba(120, 40, 40, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: #6a3030;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.aip-admin-details-toggle:hover,
.aip-admin-details-toggle:focus {
  background: rgba(255, 255, 255, 0.85);
}
.aip-admin-details-toggle__chev {
  font-size: 11px;
  opacity: 0.8;
}
.aip-temp-text-details[hidden],
.aip-temp-text-body[hidden] {
  display: none !important;
}
.aip-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.5rem;
  margin-bottom: 0.45rem;
}
.aip-admin-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  min-width: 0;
}
.aip-admin-field input,
.aip-admin-field select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font-size: 12px;
  height: var(--aip-admin-control-h);
  min-height: var(--aip-admin-control-h);
  line-height: 1.2;
  padding: 0 0.45rem;
  margin: 0;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  background: #fff;
  color: #1d2327;
}
.aip-admin-field input[type='color'] {
  padding: 0.2rem;
  cursor: pointer;
}

/* Same standard palette as customer Farve — pick default without browser color UI. */
.aip-admin-field--color {
  grid-column: 1 / -1;
}
.aip-admin-color-palette {
  --aip-admin-swatch: 1.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  margin: 0.2rem 0 0.45rem;
  box-sizing: border-box;
}
.aip-admin-color-swatch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 var(--aip-admin-swatch);
  width: var(--aip-admin-swatch);
  height: var(--aip-admin-swatch);
  min-width: var(--aip-admin-swatch);
  min-height: var(--aip-admin-swatch);
  max-width: var(--aip-admin-swatch);
  max-height: var(--aip-admin-swatch);
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  font-size: 0;
  box-sizing: border-box;
  aspect-ratio: auto;
}
.aip-admin-color-swatch.is-active {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px #1f6b52 !important;
}
.aip-admin-color-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 11px;
  color: #646970;
}
.aip-admin-color-custom span {
  flex: 0 0 auto;
}
.aip-admin-color-custom input[type='color'] {
  width: 2.4rem;
  height: 1.7rem;
  padding: 0.15rem;
  margin: 0;
  cursor: pointer;
}
.aip-admin-field input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.aip-admin-field input[type='number']::-webkit-outer-spin-button,
.aip-admin-field input[type='number']::-webkit-inner-spin-button {
  margin: 0;
}
.aip-admin-check,
.aip-admin-checks {
  font-size: 12px;
}
.aip-admin-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.45rem;
}
.aip-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
/*
 * Beat Flatsome-child style.css:
 *   .button:not(…):not(#cn-accept-cookie):not(#cn-more-info), button:not(…) { font-size:16px!important }
 * That rule has 2× :not(#id) → need ≥3 IDs here. Also kill theme uppercase.
 */
#aip-admin-dock #aip-admin-dock-body button.button:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.button-primary:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn:not(#aip-tf0):not(#aip-tf1),
#aip-admin-portrait-pick.button:not(#aip-tf0):not(#aip-tf1):not(#aip-tf2) {
  background: #b32d2e !important;
  border-color: #9a2627 !important;
  color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  text-transform: inherit !important;
  letter-spacing: normal !important;
}
/* Green dot: recommended Køn is selected → set featured now */
#aip-admin-dock #aip-admin-dock-body #aip-set-featured-btn.button.aip-admin-btn.is-preferred-gender:not(#aip-tf0):not(#aip-tf1) {
  position: relative;
}
#aip-admin-dock #aip-admin-dock-body #aip-set-featured-btn.button.aip-admin-btn.is-preferred-gender:not(#aip-tf0):not(#aip-tf1)::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #459577;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
#aip-admin-dock #aip-admin-dock-body button.button:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button:not(#aip-tf0):not(#aip-tf1):focus,
#aip-admin-dock #aip-admin-dock-body button.button.button-primary:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.button-primary:not(#aip-tf0):not(#aip-tf1):focus,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn:not(#aip-tf0):not(#aip-tf1):focus,
#aip-admin-portrait-pick.button:not(#aip-tf0):not(#aip-tf1):not(#aip-tf2):hover,
#aip-admin-portrait-pick.button:not(#aip-tf0):not(#aip-tf1):not(#aip-tf2):focus {
  background: #9a2627 !important;
  border-color: #7f1f20 !important;
  color: #fff !important;
}
/* Download / soft — brand green */
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--download:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--download:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--download:not(#aip-tf0):not(#aip-tf1):focus,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--soft:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--soft:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--soft:not(#aip-tf0):not(#aip-tf1):focus {
  background: #459577 !important;
  border-color: #459577 !important;
  color: #fff !important;
  font-size: 14px !important;
  text-transform: capitalize !important;
  letter-spacing: normal !important;
}
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--download:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--download:not(#aip-tf0):not(#aip-tf1):focus,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--soft:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--soft:not(#aip-tf0):not(#aip-tf1):focus {
  background: #3a7d64 !important;
  border-color: #3a7d64 !important;
}
#aip-admin-dock #aip-admin-dock-body button.button:disabled,
#aip-admin-dock #aip-admin-dock-body button.button.button-primary:disabled,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn:disabled,
#aip-admin-portrait-pick.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#aip-admin-dock #aip-admin-dock-body button.button.is-loading,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn.is-loading {
  position: relative;
  color: transparent !important;
  text-shadow: none !important;
  min-height: 2.6rem;
  pointer-events: none;
  opacity: 1 !important;
  cursor: wait;
}
#aip-admin-dock #aip-admin-dock-body button.button.is-loading::after,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1rem;
  height: 1.1rem;
  margin: -0.55rem 0 0 -0.55rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  box-sizing: border-box;
  animation: aip-admin-spin 0.65s linear infinite;
}
@keyframes aip-admin-spin {
  to {
    transform: rotate(360deg);
  }
}
.aip-admin-status {
  display: block;
  margin-top: 0.35rem;
  font-size: 12px;
}
.aip-admin-ref-status {
  margin: 0.45rem 0 0;
  font-size: 12px;
  line-height: 1.35;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  border: 1px dashed rgba(120, 40, 40, 0.35);
  background: rgba(255, 255, 255, 0.55);
}
.aip-admin-ref-status.is-on {
  border-color: rgba(45, 120, 70, 0.45);
  color: #1d5c35;
  background: rgba(210, 240, 220, 0.65);
}
.aip-admin-ref-status.is-off {
  border-color: rgba(140, 100, 40, 0.4);
  color: #6a4a12;
  background: rgba(255, 245, 220, 0.7);
}
.aip-admin-ref-status.is-unknown {
  color: #6a3030;
}
.aip-admin-ref-paste {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(70, 110, 90, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.35;
  color: #2a4a3a;
  cursor: pointer;
  outline: none;
  user-select: none;
}
.aip-admin-ref-paste:focus-visible,
.aip-admin-ref-paste.is-drag {
  border-color: #459577;
  background: rgba(210, 240, 220, 0.75);
  box-shadow: 0 0 0 2px rgba(69, 149, 119, 0.25);
}
.aip-admin-ref-paste.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--danger:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--danger:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--danger:not(#aip-tf0):not(#aip-tf1):focus {
  background: #fff !important;
  border-color: #2271b1 !important;
  color: #2271b1 !important;
  text-transform: none !important;
  font-size: 14px !important;
}
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--danger:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--danger:not(#aip-tf0):not(#aip-tf1):focus {
  background: #f0f6fb !important;
  border-color: #135e96 !important;
  color: #135e96 !important;
}
@media (max-width: 900px) {
  .aip-admin-dock {
    top: auto;
    bottom: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 42vh;
  }
}

/*
 * Gender picker (.aip-koen): A1 flat kid icons (square cards).
 * EPO often sets "circle" on image radios — we override to square + contain
 * so hair is not clipped. Choice values: pige/Pige_* / dreng/Dreng_*.
 * Icons only (no Dreng/Pige text) + same active border/check as photo thumbs.
 */
.cpf-section.aip-koen,
.aip-koen {
  --aip-koen-size: var(--aip-icon-size, 90px);
}

/*
 * Pre-JS (FlyingPress delay): keep Køn icons at card size even before
 * .aip-koen-frame is injected — otherwise full-res avatars flash giant.
 */
body.aip-product-page .cpf-section.aip-koen .tmhexcolorimage,
body.aip-product-page .cpf-section.aip-koen .tc-image,
body.aip-product-page .cpf-section.aip-koen img.tc-image,
body.aip-product-page .cpf-section.aip-koen img.radio-image,
body.aip-product-page .cpf-section.aip-koen li img {
  display: block !important;
  width: var(--aip-koen-size) !important;
  height: var(--aip-koen-size) !important;
  max-width: var(--aip-koen-size) !important;
  max-height: var(--aip-koen-size) !important;
  object-fit: contain !important;
  object-position: center center !important;
  box-sizing: border-box !important;
}

body.aip-product-page .cpf-section.aip-koen li,
body.aip-product-page .cpf-section.aip-koen .tmcp-field-wrap {
  max-width: var(--aip-koen-size) !important;
}

/* Collapse empty EPO element label (&nbsp;) that sat between title and icons */
.aip-koen .tm-epo-element-label,
.aip-koen h3.tc-epo-label,
.aip-koen .tc-epo-label.tm-epo-element-label,
.cpf-section.aip-koen .tm-epo-element-label,
.cpf-section.aip-koen h3.tc-epo-label,
.cpf-section.aip-koen .tc-epo-label.tm-epo-element-label {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

.aip-koen .tmcp-ul-wrap,
.cpf-section.aip-koen .tmcp-ul-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0;
}

.aip-koen li,
.aip-koen .aip-koen-choice,
.cpf-section.aip-koen li,
.cpf-section.aip-koen .aip-koen-choice {
  position: relative;
  display: inline-block;
  vertical-align: top;
  line-height: 0;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

/* Kill EPO chrome so we only have one frame */
.aip-koen label,
.aip-koen .tmcp-field-wrap,
.aip-koen .tm-epo-style,
.aip-koen .tc-epo-style-wrapper,
.aip-koen .tm-epo-style-wrapper,
.cpf-section.aip-koen label,
.cpf-section.aip-koen .tm-epo-style,
.cpf-section.aip-koen .tc-epo-style-wrapper,
.cpf-section.aip-koen .tm-epo-style-wrapper {
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.aip-koen .tm-epo-style,
.aip-koen .tc-epo-style-wrapper,
.aip-koen .tm-epo-style-wrapper,
.cpf-section.aip-koen .tm-epo-style,
.cpf-section.aip-koen .tc-epo-style-wrapper,
.cpf-section.aip-koen .tm-epo-style-wrapper {
  display: none !important;
}

/* One frame — fixed card size; slight icon inset (not edge-flush) */
.aip-koen .aip-koen-frame,
.cpf-section.aip-koen .aip-koen-frame {
  position: relative !important;
  display: block !important;
  width: var(--aip-koen-size) !important;
  height: var(--aip-koen-size) !important;
  max-width: var(--aip-koen-size) !important;
  max-height: var(--aip-koen-size) !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  background-color: #fff !important;
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  /* Size icon inside padding; keep fill color on full card (no nested grey box) */
  background-origin: content-box !important;
  padding: 5px 4px !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: 0 0 0 2px #e4e4e4 !important;
  overflow: hidden !important;
  transition: box-shadow 0.15s ease;
}

.aip-koen .aip-koen-frame img,
.aip-koen .aip-koen-frame .tc-image,
.cpf-section.aip-koen .aip-koen-frame img,
.cpf-section.aip-koen .aip-koen-frame .tc-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.aip-koen .tc-mode-images.circle,
.aip-koen li.circle,
.cpf-section.aip-koen .tc-mode-images.circle,
.cpf-section.aip-koen li.circle {
  border-radius: 0 !important;
}

.aip-koen .aip-koen-choice.is-active .aip-koen-frame,
.aip-koen .aip-koen-frame.is-active,
.aip-koen li.tc-active .aip-koen-frame,
.cpf-section.aip-koen .aip-koen-choice.is-active .aip-koen-frame,
.cpf-section.aip-koen .aip-koen-frame.is-active,
.cpf-section.aip-koen li.tc-active .aip-koen-frame {
  border: 0 !important;
  background-color: #e8f3ee !important;
  box-shadow: 0 0 0 2px var(--aip-accent, #459577) !important;
}

/* Hide choice text under icons only — never .tc-label-wrap / bare .tm-label */
.aip-koen .tmcp-ul-wrap .tc-label-text,
.aip-koen .tmcp-ul-wrap .tc-label,
.aip-koen .tmcp-ul-wrap .tm-label,
.aip-koen ul.tmcp-ul-wrap .tc-epo-label,
.cpf-section.aip-koen .tmcp-ul-wrap .tc-label-text,
.cpf-section.aip-koen .tmcp-ul-wrap .tc-label,
.cpf-section.aip-koen .tmcp-ul-wrap .tm-label,
.cpf-section.aip-koen .tmcp-ul-wrap .tc-epo-label {
  display: none !important;
}

/* Corner check on choice host — covers frame corner + ring */
.aip-koen .aip-koen-badge,
.cpf-section.aip-koen .aip-koen-badge {
  display: none;
  right: -2px !important;
  bottom: -2px !important;
  width: 1.9rem !important;
  height: 1.9rem !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 6 !important;
  border: 0 !important;
  border-radius: 100% 0 10px 0 !important;
  background: var(--aip-accent, #459577) !important;
  box-shadow: none !important;
}

.aip-koen .aip-koen-badge svg,
.cpf-section.aip-koen .aip-koen-badge svg {
  width: 1.05rem !important;
  height: 1.05rem !important;
  margin: 0.38rem 0 0 0.52rem !important;
}

.aip-koen .aip-koen-choice.is-active .aip-koen-badge,
.aip-koen li.tc-active .aip-koen-badge,
.cpf-section.aip-koen .aip-koen-choice.is-active .aip-koen-badge,
.cpf-section.aip-koen li.tc-active .aip-koen-badge {
  display: grid !important;
}

/* Køn required notice — sits above upload; amber (not brand-green) so it is hard to miss. */
.aip-gender-upload-notice {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #e0b44a;
  background: #fff8e8;
  color: #5c4508;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  box-sizing: border-box;
}

.aip-gender-upload-notice.aip-hide {
  display: none !important;
}

/*
 * Style picker (.aip-stil): same card/check UX as Køn (icons only, no labels).
 * Choice values: Tegnet*_ / Livagtig*_ → skatepark / skatepark_v2.
 * Display size 72px CSS → export icons ~288×288 px (4×). DPI meta ignored on web.
 */
.cpf-section.aip-stil,
.aip-stil {
  --aip-stil-size: var(--aip-icon-size, 72px);
}

/* Pre-JS: same size lock for Stil icons (FlyingPress delay). */
body.aip-product-page .cpf-section.aip-stil .tmhexcolorimage,
body.aip-product-page .cpf-section.aip-stil .tc-image,
body.aip-product-page .cpf-section.aip-stil img.tc-image,
body.aip-product-page .cpf-section.aip-stil img.radio-image,
body.aip-product-page .cpf-section.aip-stil li img {
  display: block !important;
  width: var(--aip-stil-size) !important;
  height: var(--aip-stil-size) !important;
  max-width: var(--aip-stil-size) !important;
  max-height: var(--aip-stil-size) !important;
  object-fit: contain !important;
  object-position: center center !important;
  box-sizing: border-box !important;
}

body.aip-product-page .cpf-section.aip-stil li,
body.aip-product-page .cpf-section.aip-stil .tmcp-field-wrap {
  max-width: var(--aip-stil-size) !important;
}

.aip-stil .tm-epo-element-label,
.aip-stil h3.tc-epo-label,
.aip-stil .tc-epo-label.tm-epo-element-label,
.cpf-section.aip-stil .tm-epo-element-label,
.cpf-section.aip-stil h3.tc-epo-label,
.cpf-section.aip-stil .tc-epo-label.tm-epo-element-label {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

.aip-stil .tmcp-ul-wrap,
.cpf-section.aip-stil .tmcp-ul-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  margin: 0;
}

.aip-stil li,
.aip-stil .aip-stil-choice,
.cpf-section.aip-stil li,
.cpf-section.aip-stil .aip-stil-choice {
  position: relative;
  display: inline-block;
  vertical-align: top;
  line-height: 0;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.aip-stil label,
.aip-stil .tmcp-field-wrap,
.aip-stil .tm-epo-style,
.aip-stil .tc-epo-style-wrapper,
.aip-stil .tm-epo-style-wrapper,
.cpf-section.aip-stil label,
.cpf-section.aip-stil .tm-epo-style,
.cpf-section.aip-stil .tc-epo-style-wrapper,
.cpf-section.aip-stil .tm-epo-style-wrapper {
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.aip-stil .tm-epo-style,
.aip-stil .tc-epo-style-wrapper,
.aip-stil .tm-epo-style-wrapper,
.cpf-section.aip-stil .tm-epo-style,
.cpf-section.aip-stil .tc-epo-style-wrapper,
.cpf-section.aip-stil .tm-epo-style-wrapper {
  display: none !important;
}

.aip-stil .aip-stil-frame,
.cpf-section.aip-stil .aip-stil-frame {
  position: relative !important;
  display: block !important;
  width: var(--aip-stil-size) !important;
  height: var(--aip-stil-size) !important;
  max-width: var(--aip-stil-size) !important;
  max-height: var(--aip-stil-size) !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  background-color: #fff !important;
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: 0 0 0 2px #e4e4e4 !important;
  overflow: hidden !important;
  transition: box-shadow 0.15s ease;
}

.aip-stil .aip-stil-frame img,
.aip-stil .aip-stil-frame .tc-image,
.cpf-section.aip-stil .aip-stil-frame img,
.cpf-section.aip-stil .aip-stil-frame .tc-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.aip-stil .tc-mode-images.circle,
.aip-stil li.circle,
.cpf-section.aip-stil .tc-mode-images.circle,
.cpf-section.aip-stil li.circle {
  border-radius: 0 !important;
}

.aip-stil .aip-stil-choice.is-active .aip-stil-frame,
.aip-stil .aip-stil-frame.is-active,
.aip-stil li.tc-active .aip-stil-frame,
.cpf-section.aip-stil .aip-stil-choice.is-active .aip-stil-frame,
.cpf-section.aip-stil .aip-stil-frame.is-active,
.cpf-section.aip-stil li.tc-active .aip-stil-frame {
  border: 0 !important;
  background-color: #e8f3ee !important;
  box-shadow: 0 0 0 2px var(--aip-accent, #459577) !important;
}

/* Hide choice text under icons — same as Køn */
.aip-stil .tmcp-ul-wrap .tc-label-text,
.aip-stil .tmcp-ul-wrap .tc-label,
.aip-stil .tmcp-ul-wrap .tm-label,
.aip-stil ul.tmcp-ul-wrap .tc-epo-label,
.aip-stil .tmcp-ul-wrap .radio-image-label,
.cpf-section.aip-stil .tmcp-ul-wrap .tc-label-text,
.cpf-section.aip-stil .tmcp-ul-wrap .tc-label,
.cpf-section.aip-stil .tmcp-ul-wrap .tm-label,
.cpf-section.aip-stil .tmcp-ul-wrap .tc-epo-label,
.cpf-section.aip-stil .tmcp-ul-wrap .radio-image-label {
  display: none !important;
}

/* Corner check — identical to Køn (host bottom-right over frame + ring) */
.aip-stil .aip-stil-badge,
.cpf-section.aip-stil .aip-stil-badge {
  display: none;
  right: -2px !important;
  bottom: -2px !important;
  top: auto !important;
  width: 1.9rem !important;
  height: 1.9rem !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 6 !important;
  border: 0 !important;
  border-radius: 100% 0 10px 0 !important;
  background: var(--aip-accent, #459577) !important;
  box-shadow: none !important;
}

.aip-stil .aip-stil-badge svg,
.cpf-section.aip-stil .aip-stil-badge svg {
  width: 1.05rem !important;
  height: 1.05rem !important;
  margin: 0.38rem 0 0 0.52rem !important;
}

.aip-stil .aip-stil-choice.is-active .aip-stil-badge,
.aip-stil li.tc-active .aip-stil-badge,
.cpf-section.aip-stil .aip-stil-choice.is-active .aip-stil-badge,
.cpf-section.aip-stil li.tc-active .aip-stil-badge {
  display: grid !important;
}

/*
 * Dinosaur picker (.aip-dino): transparent silhouette PNGs + CSS sage circle.
 * Upload icons from assets/epo-dino-icons/ — do not bake circle into the image.
 */
.cpf-section.aip-dino,
.aip-dino {
  --aip-dino-circle: #c5d0b8;
  --aip-dino-circle-selected: #b3c4a3;
  --aip-dino-size: 72px;
}

.aip-dino .tmcp-ul-wrap,
.cpf-section.aip-dino .tmcp-ul-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
}

.aip-dino .tmhexcolorimage,
.aip-dino .tc-image,
.cpf-section.aip-dino .tmhexcolorimage,
.cpf-section.aip-dino .tc-image {
  width: var(--aip-dino-size) !important;
  height: var(--aip-dino-size) !important;
  border-radius: 50% !important;
  background-color: var(--aip-dino-circle) !important;
  background-size: 72% 72% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  box-shadow: none !important;
  border: 2px solid transparent !important;
  overflow: hidden;
}

.aip-dino li.tc-active .tmhexcolorimage,
.aip-dino li.tc-active .tc-image,
.aip-dino input.tmcp-radio:checked + .tmhexcolorimage,
.aip-dino input.tmcp-radio:checked + label .tmhexcolorimage,
.aip-dino input.tmcp-radio:checked + label .tc-image,
.cpf-section.aip-dino li.tc-active .tmhexcolorimage,
.cpf-section.aip-dino li.tc-active .tc-image {
  background-color: var(--aip-dino-circle-selected) !important;
  border-color: #459577 !important;
}

.aip-dino .tc-label,
.aip-dino .tc-epo-label,
.aip-dino .tm-label,
.cpf-section.aip-dino .tc-label,
.cpf-section.aip-dino .tm-label {
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  color: #2a2a2a;
}

/* Admin-only: customer portrait picker on product photo upload */
.aip-admin-portrait-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  margin: 0.45rem 0 0.75rem;
  line-height: 0;
}
.aip-admin-portrait-row > .aip-admin-portrait-btn,
#aip-admin-portrait-pick.button:not(#aip-tf0):not(#aip-tf1):not(#aip-tf2) {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  white-space: nowrap;
  margin: 0 !important;
  vertical-align: middle;
}
.aip-admin-portrait-btn {
  font-size: 14px !important;
}
.aip-admin-portrait-quick {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
  gap: 0.22rem;
  margin: 0;
  padding: 0;
  line-height: 0;
  vertical-align: middle;
}
.aip-admin-portrait-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 !important;
  border: 2px solid #dcdcde;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  box-shadow: none;
  flex: 0 0 auto;
  align-self: center;
  vertical-align: middle;
}
.aip-admin-portrait-quick-btn:hover,
.aip-admin-portrait-quick-btn:focus {
  border-color: #459577;
  outline: none;
}
.aip-admin-portrait-quick-btn.is-preferred {
  position: relative;
}
.aip-admin-portrait-quick-btn.is-preferred::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #459577;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.aip-admin-portrait-quick-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
}
.aip-admin-portrait-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.aip-admin-portrait-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.aip-admin-portrait-modal__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(85vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  padding: 14px 16px 18px;
}
.aip-admin-portrait-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.aip-admin-portrait-modal__x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #50575e;
}
.aip-admin-portrait-modal__hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #646970;
}
.aip-admin-portrait-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.aip-admin-portrait-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  margin: 0;
  border: 2px solid #dcdcde;
  border-radius: 8px;
  background: #f6f7f7;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}
.aip-admin-portrait-card:hover {
  border-color: #459577;
}
.aip-admin-portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1080 / 2340;
  object-fit: cover;
  background: #e2e4e7;
}
.aip-admin-portrait-card__label {
  display: block;
  padding: 6px 7px 2px;
  font-size: 12px;
  font-weight: 600;
  color: #1d2327;
}
.aip-admin-portrait-card__role {
  display: block;
  padding: 0 7px 7px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #646970;
}
.aip-admin-actions--stack {
  flex-direction: column;
  align-items: stretch;
}
.aip-admin-actions--stack .button {
  width: 100%;
  text-align: center;
}
.aip-admin-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: 100%;
  align-items: stretch;
  box-sizing: border-box;
}
.aip-admin-actions-row .button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}
.aip-admin-style-ref-panel {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(120, 40, 40, 0.22);
}
.aip-admin-style-ref-panel[hidden] {
  display: none !important;
}
/* Stil-ref pick + clipboard: flush to container edges (kill theme button margin ~14px) */
.aip-admin-style-ref-row {
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
#aip-admin-dock #aip-admin-dock-body .aip-admin-style-ref-row .button,
#aip-admin-dock #aip-admin-dock-body .aip-admin-style-ref-row #aip-pick-style-ref-btn,
#aip-admin-dock #aip-admin-dock-body .aip-admin-style-ref-row #aip-clipboard-style-ref-btn {
  margin: 0 !important;
}
.aip-admin-style-ref-row #aip-pick-style-ref-btn {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  white-space: nowrap;
}
.aip-admin-style-ref-row #aip-clipboard-style-ref-btn {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  white-space: nowrap;
}
/* Blue ref actions (Gem / Vælg / Clipboard) */
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--ref:not(#aip-tf0):not(#aip-tf1),
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--ref:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--ref:not(#aip-tf0):not(#aip-tf1):focus {
  background: #2271b1 !important;
  border-color: #2271b1 !important;
  color: #fff !important;
  text-transform: none !important;
  font-size: 14px !important;
}
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--ref:not(#aip-tf0):not(#aip-tf1):hover,
#aip-admin-dock #aip-admin-dock-body button.button.aip-admin-btn--ref:not(#aip-tf0):not(#aip-tf1):focus {
  background: #135e96 !important;
  border-color: #135e96 !important;
}
aside.aip-admin-dock .aip-admin-actions button.button.is-aip-hidden,
aside.aip-admin-dock button.button.aip-admin-btn.is-aip-hidden {
  display: none !important;
}

/* TEMP TEST1 sidebar CSS moved to assets/public/temp-sidebar-nav-menu.css
 * (enqueued on all product pages — storefront.css only loads on AI poster map) */
