@import './components/ResultComparison.css';

/* Aisthetix Virtual Try-On Widget Styles */

/* CSS Variables for theming */
:root {
  --aisthetix-primary: #000000;
  --aisthetix-primary-hover: #333333;
  --aisthetix-secondary: #f5f5f5;
  --aisthetix-secondary-hover: #e5e5e5;
  --aisthetix-text: #1a1a1a;
  --aisthetix-text-muted: #666666;
  --aisthetix-border: #e0e0e0;
  --aisthetix-error: #dc2626;
  --aisthetix-success: #16a34a;
  --aisthetix-overlay: rgba(0, 0, 0, 0.5);
  --aisthetix-radius: 8px;
  --aisthetix-radius-lg: 16px;
  --aisthetix-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --aisthetix-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modal Overlay */
.aisthetix-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--aisthetix-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
  animation: aisthetix-fade-in 0.2s ease;
  isolation: isolate;
}

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

/* Modal Content */
.aisthetix-modal-content {
  background: white;
  border-radius: var(--aisthetix-radius-lg);
  box-shadow: var(--aisthetix-shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: aisthetix-slide-up 0.3s ease;
}

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

.aisthetix-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--aisthetix-border);
  flex-shrink: 0;
}

.aisthetix-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0;
}

.aisthetix-modal-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--aisthetix-text-muted);
  border-radius: var(--aisthetix-radius);
  transition: all 0.2s;
}

.aisthetix-modal-close:hover {
  background: var(--aisthetix-secondary);
  color: var(--aisthetix-text);
}

.aisthetix-modal-close svg {
  width: 20px;
  height: 20px;
}

.aisthetix-modal-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Buttons */
.aisthetix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--aisthetix-radius);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.aisthetix-btn svg {
  width: 18px;
  height: 18px;
}

.aisthetix-btn-primary {
  background: var(--aisthetix-primary);
  color: white;
}

.aisthetix-btn-primary:hover {
  background: var(--aisthetix-primary-hover);
}

.aisthetix-btn-secondary {
  background: var(--aisthetix-secondary);
  color: var(--aisthetix-text);
}

.aisthetix-btn-secondary:hover {
  background: var(--aisthetix-secondary-hover);
}

.aisthetix-btn-text {
  background: transparent;
  color: var(--aisthetix-text-muted);
}

.aisthetix-btn-text:hover {
  color: var(--aisthetix-text);
  background: var(--aisthetix-secondary);
}

/* Avatar Upload */
.aisthetix-avatar-upload {
  text-align: center;
}

.aisthetix-avatar-upload-header {
  margin-bottom: 16px;
}

.aisthetix-avatar-upload-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-avatar-upload-header p {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0;
  line-height: 1.5;
}

.aisthetix-upload-area {
  margin-bottom: 16px;
}

.aisthetix-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.aisthetix-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  border: 2px dashed var(--aisthetix-border);
  border-radius: var(--aisthetix-radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--aisthetix-text-muted);
}

.aisthetix-upload-label:hover {
  border-color: var(--aisthetix-primary);
  background: var(--aisthetix-secondary);
}

.aisthetix-upload-icon {
  width: 48px;
  height: 48px;
  color: var(--aisthetix-text-muted);
}

.aisthetix-upload-hint {
  font-size: 12px;
  color: var(--aisthetix-text-muted);
}

.aisthetix-camera-launch {
  display: flex;
  justify-content: center;
  margin: -4px 0 16px;
}

.aisthetix-camera-fallback,
.aisthetix-camera-status {
  margin: 10px 0;
  color: var(--aisthetix-text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.aisthetix-camera {
  margin-bottom: 16px;
}

.aisthetix-camera h4 {
  margin: 0 0 12px;
  color: var(--aisthetix-text);
  font-size: 15px;
}

.aisthetix-camera-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border-radius: var(--aisthetix-radius-lg);
  background: #111;
}

.aisthetix-camera-video {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  transform: scaleX(-1);
}

.aisthetix-camera-frame .aisthetix-spinner {
  position: absolute;
}

.aisthetix-camera-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .aisthetix-camera-frame {
    min-height: 180px;
  }

  .aisthetix-camera-actions .aisthetix-btn {
    width: 100%;
  }
}

.aisthetix-preview-area {
  margin-bottom: 12px;
}

.aisthetix-preview-image {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
  margin: 0 auto 16px;
  display: block;
}

.aisthetix-preview-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.aisthetix-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--aisthetix-text);
  text-align: left;
  margin: 0 0 12px;
  cursor: pointer;
}

.aisthetix-consent input {
  margin-top: 2px;
  flex-shrink: 0;
}

.aisthetix-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  font-size: 12px;
  color: var(--aisthetix-text-muted);
  text-align: left;
  margin-top: 16px;
}

.aisthetix-privacy-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Processing View */
.aisthetix-processing {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-processing-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border-radius: var(--aisthetix-radius);
  overflow: hidden;
}

.aisthetix-processing-avatar {
  width: 100%;
  max-width: 320px;
  /* Same reasoning as the result image: keep the whole view on one screen. */
  max-height: min(420px, 46vh);
  object-fit: cover;
  border-radius: var(--aisthetix-radius);
  opacity: 0.35;
}

.aisthetix-processing-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
}

.aisthetix-elapsed {
  font-size: 15px;
  font-weight: 500;
  color: var(--aisthetix-text);
  font-variant-numeric: tabular-nums;
}

.aisthetix-processing-hud .aisthetix-progress-bar {
  width: 100%;
  max-width: 220px;
  height: 6px;
  background: var(--aisthetix-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.aisthetix-processing-hud .aisthetix-progress-fill {
  height: 100%;
  background: var(--aisthetix-primary);
  border-radius: 3px;
  /* linear and short: the bar is re-rendered every 100ms */
  transition: width 0.15s linear;
}

.aisthetix-status {
  margin: 0;
  font-size: 15px;
  color: var(--aisthetix-text);
  animation: aisthetix-status-in 0.4s ease;
}

@keyframes aisthetix-status-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.aisthetix-spinner {
  border: 2px solid var(--aisthetix-border);
  border-top-color: var(--aisthetix-primary);
  border-radius: 50%;
  animation: aisthetix-spin 0.8s linear infinite;
  width: 24px;
  height: 24px;
}

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

/* Result View */
.aisthetix-result {
  text-align: center;
}

.aisthetix-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.aisthetix-result-actions > .aisthetix-btn-primary {
  flex: 1 1 180px;
}

.aisthetix-result-action-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--aisthetix-border);
  border-radius: var(--aisthetix-radius);
  background: #ffffff;
  color: var(--aisthetix-text);
  cursor: pointer;
}

.aisthetix-result-action-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.aisthetix-result-product {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--aisthetix-border);
  font-size: 13px;
  color: var(--aisthetix-text-muted);
}
/* Always-on, non-configurable viral sharing.
 * Keep theme button resets scoped to these controls. Vela/Storefront use
 * !important fills/borders globally, so only those properties need priority. */
.aisthetix-share {
  display: contents;
}

.aisthetix-modal-overlay .aisthetix-share__trigger {
  display: flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--aisthetix-border) !important;
  border-radius: var(--aisthetix-radius) !important;
  background: #ffffff !important;
  color: var(--aisthetix-primary) !important;
  box-shadow: none;
  cursor: pointer;
}

.aisthetix-share__trigger svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.aisthetix-share__menu {
  order: 2;
  width: 100%;
  flex: 1 0 100%;
  margin-top: 9px;
  padding: 12px 10px 10px;
  border: 1px solid var(--aisthetix-border);
  border-radius: 14px;
  background: #ffffff;
}

.aisthetix-share__channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}

.aisthetix-modal-overlay .aisthetix-share__channel {
  display: flex;
  min-width: 0;
  min-height: 80px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 4px;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--aisthetix-text) !important;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  text-align: center;
  cursor: pointer;
}

.aisthetix-share__icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 50%;
  background: #f7f7f8;
  color: #18181b;
}

.aisthetix-share__icon svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.aisthetix-share__icon--instagram svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.aisthetix-share__icon--instagram .aisthetix-share__icon-dot {
  fill: currentColor;
  stroke: none;
}

.aisthetix-share__icon--whatsapp svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.aisthetix-share__icon--whatsapp svg path:last-child {
  fill: currentColor;
  stroke: none;
}

.aisthetix-share__badge {
  max-width: 100%;
  padding: 0;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.aisthetix-share__trigger:hover,
.aisthetix-share__trigger:focus-visible,
.aisthetix-result-action-icon:hover,
.aisthetix-result-action-icon:focus-visible,
.aisthetix-share__channel:hover:not(:disabled),
.aisthetix-share__channel:focus-visible {
  color: var(--aisthetix-primary);
}

.aisthetix-share__trigger:focus-visible,
.aisthetix-result-action-icon:focus-visible,
.aisthetix-share__channel:focus-visible {
  outline: 3px solid var(--aisthetix-primary);
  outline-offset: 2px;
}

.aisthetix-share__channel:disabled {
  cursor: wait;
  opacity: 0.45;
}

.aisthetix-share__status {
  margin: 7px 0 0;
  color: var(--aisthetix-text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}


/* Error View */
.aisthetix-error {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-error-icon {
  margin-bottom: 16px;
}

.aisthetix-error-icon svg {
  width: 48px;
  height: 48px;
  color: var(--aisthetix-error);
}

.aisthetix-error h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-error-message {
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--aisthetix-radius);
  color: var(--aisthetix-error);
  font-size: 14px;
  margin-bottom: 16px;
}

.aisthetix-error-suggestions {
  text-align: left;
  padding: 16px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  margin-bottom: 20px;
}

.aisthetix-error-suggestions p {
  font-size: 14px;
  font-weight: 500;
  color: var(--aisthetix-text);
  margin: 0 0 12px 0;
}

.aisthetix-error-suggestions ul {
  margin: 0;
  padding-left: 20px;
}

.aisthetix-error-suggestions li {
  font-size: 13px;
  color: var(--aisthetix-text-muted);
  margin-bottom: 8px;
}

.aisthetix-error-suggestions li:last-child {
  margin-bottom: 0;
}

.aisthetix-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .aisthetix-modal-content {
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .aisthetix-modal-overlay {
    padding: 0;
  }

  .aisthetix-result-actions {
    flex-direction: row;
  }

  .aisthetix-result-actions > .aisthetix-btn-primary {
    width: auto;
  }

  .aisthetix-btn {
    width: 100%;
  }
}


/* Quota Blocked View */
.aisthetix-quota-blocked {
  text-align: center;
  padding: 20px 0;
}

.aisthetix-quota-blocked-icon {
  margin-bottom: 16px;
}

.aisthetix-quota-blocked-icon svg {
  width: 48px;
  height: 48px;
  color: #f59e0b; /* Amber color for blocked state */
}

.aisthetix-quota-blocked h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px 0;
}

.aisthetix-quota-blocked-message {
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--aisthetix-radius);
  color: #92400e;
  font-size: 14px;
  margin-bottom: 16px;
}

.aisthetix-quota-blocked-info {
  padding: 12px;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  margin-bottom: 20px;
}

.aisthetix-quota-blocked-plan {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0;
}

.aisthetix-quota-blocked-plan strong {
  color: var(--aisthetix-text);
  font-weight: 600;
}

.aisthetix-quota-blocked-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Quota Warning Banner */
.aisthetix-quota-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--aisthetix-radius);
  margin-bottom: 16px;
}

.aisthetix-quota-warning-icon {
  flex-shrink: 0;
}

.aisthetix-quota-warning-icon svg {
  width: 20px;
  height: 20px;
  color: #f59e0b;
}

.aisthetix-quota-warning-content {
  flex: 1;
}

.aisthetix-quota-warning-text {
  font-size: 14px;
  color: #92400e;
  margin: 0;
  line-height: 1.5;
}

.aisthetix-quota-warning-text strong {
  font-weight: 600;
}

/* Free Tier Badge */
.aisthetix-free-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--aisthetix-radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #065f46;
  text-align: center;
}

/* ==========================================================================
   Demo store only (see src/demo/). Inert on every merchant install: nothing
   below is ever rendered unless window.AISTHETIX_CONFIG.demo === true.
   ========================================================================== */

/* --- The render, with the garment tucked into its corner --------------- */
.aisthetix-tryon-figure {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}
.aisthetix-tryon-figure-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--aisthetix-radius);
}
.aisthetix-tryon-figure--result .aisthetix-tryon-figure-image {
  /* Viewport-relative so the actions stay above the fold on short screens.
     A fixed height pushed them out of view. */
  max-height: min(400px, 40vh);
  width: auto;
  object-fit: contain;
  box-shadow: var(--aisthetix-shadow);
}
.aisthetix-tryon-figure-pip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22%;
  min-width: 48px;
  max-width: 84px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.aisthetix-tryon-figure--gallery {
  flex-shrink: 0;
}
.aisthetix-tryon-figure--gallery .aisthetix-tryon-figure-image {
  width: 96px;
  height: 128px;
  object-fit: cover;
}
.aisthetix-tryon-figure--gallery .aisthetix-tryon-figure-pip {
  right: 4px;
  bottom: 4px;
  width: 34px;
  min-width: 0;
  max-width: none;
  border-width: 1.5px;
  border-radius: 4px;
}
.aisthetix-result-notice {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--aisthetix-text-muted);
}

/* Size recommendation hangs below the try-on result and is isolated visually
   so a failure or a refusal never obscures the image the shopper already has. */
.aisthetix-size {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.aisthetix-size-offer,
.aisthetix-size-result,
.aisthetix-size-form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
}

.aisthetix-size-offer--blocked {
  background: #fff7ed;
}

.aisthetix-size-offer__title,
.aisthetix-size-result__title {
  margin: 0;
  font-weight: 700;
}

.aisthetix-size-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.aisthetix-size-form input {
  min-height: 44px;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.aisthetix-size-result__size {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
}

.aisthetix-size-result__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.aisthetix-size-result__choices button {
  min-width: 48px;
  min-height: 44px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
}

.aisthetix-size-result__choices button[aria-pressed="true"] {
  color: #fff;
  background: #111827;
}

.aisthetix-size-result__file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- The row above every screen: try-ons left, and the way back in ----- */
.aisthetix-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--aisthetix-border);
}
.aisthetix-quota-counter {
  font-size: 13px;
  color: var(--aisthetix-text-muted);
}
.aisthetix-gallery-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--aisthetix-text);
  background: transparent;
  border: 1px solid var(--aisthetix-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.aisthetix-gallery-open:hover {
  background: var(--aisthetix-secondary);
}
.aisthetix-gallery-open svg {
  width: 14px;
  height: 14px;
}

/* --- Your try-ons ------------------------------------------------------ */
.aisthetix-gallery-header {
  display: flex;
  margin-bottom: 8px;
}
/* The base .aisthetix-btn-text is defined with the other buttons above; the
   gallery's back button only needs its chevron sized. */
.aisthetix-gallery-header .aisthetix-btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.aisthetix-gallery-header .aisthetix-btn-text svg {
  width: 16px;
  height: 16px;
}
.aisthetix-gallery-empty {
  text-align: center;
  padding: 24px 8px;
}
.aisthetix-gallery-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0 0 8px;
}
.aisthetix-gallery-empty p {
  font-size: 14px;
  color: var(--aisthetix-text-muted);
  margin: 0;
}
.aisthetix-gallery-notice {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--aisthetix-text-muted);
  text-align: center;
}
.aisthetix-gallery-notice--error {
  color: var(--aisthetix-error);
}
.aisthetix-gallery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aisthetix-gallery-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--aisthetix-border);
  border-radius: var(--aisthetix-radius);
  text-align: left;
}
.aisthetix-gallery-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aisthetix-gallery-item-title {
  margin: 0;
  /* Room for the remove button pinned to the corner. */
  padding-right: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--aisthetix-text);
  overflow-wrap: anywhere;
}
.aisthetix-gallery-item-date {
  margin: 0;
  font-size: 12px;
  color: var(--aisthetix-text-muted);
}
.aisthetix-gallery-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.aisthetix-btn-small {
  padding: 8px 12px;
  font-size: 13px;
}
a.aisthetix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.aisthetix-gallery-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--aisthetix-radius);
  color: var(--aisthetix-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.aisthetix-gallery-remove:hover {
  color: var(--aisthetix-error);
  background: var(--aisthetix-secondary);
}
.aisthetix-gallery-remove svg {
  width: 16px;
  height: 16px;
}
.aisthetix-gallery-privacy {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--aisthetix-text-muted);
  text-align: center;
}

/* --- The email gate ---------------------------------------------------- */
.aisthetix-lead {
  display: flex;
  flex-direction: column;
  padding: 4px 0 8px;
}
.aisthetix-lead-purpose {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--aisthetix-text-muted);
}
.aisthetix-lead-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--aisthetix-text);
  margin-bottom: 6px;
}
.aisthetix-lead-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--aisthetix-text);
  background: #ffffff;
  border: 1px solid var(--aisthetix-border);
  border-radius: var(--aisthetix-radius);
}
.aisthetix-lead-input:focus {
  outline: 2px solid var(--aisthetix-primary);
  outline-offset: 1px;
}
.aisthetix-lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--aisthetix-text-muted);
  cursor: pointer;
}
.aisthetix-lead-consent input {
  margin: 2px 0 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.aisthetix-lead-error {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--aisthetix-error);
}
.aisthetix-lead-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.aisthetix-lead-actions .aisthetix-btn {
  flex: 1 1 auto;
}
.aisthetix-lead-actions .aisthetix-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .aisthetix-gallery-item {
    flex-direction: column;
  }
  .aisthetix-tryon-figure--gallery .aisthetix-tryon-figure-image {
    width: 100%;
    height: 200px;
  }
}

/* Transient feedback stays out of the share controls and never needs another tap. */
.aisthetix-share__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;
  max-width: calc(100vw - 32px);
  width: max-content;
  margin: 0;
  padding: 10px 16px;
  border-radius: 8px;
  background: #18181b;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.aisthetix-preview-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto 16px;
  line-height: 0;
}

.aisthetix-preview-image {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
  display: block;
}

/* Sits on the saved photo, so "use it or swap it" reads as one decision. */
.aisthetix-preview-change {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: white;
  background: rgba(0, 0, 0, 0.62);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.aisthetix-preview-change:hover {
  background: rgba(0, 0, 0, 0.8);
}

.aisthetix-preview-change svg {
  width: 14px;
  height: 14px;
}
