/**
 * Dresium Try-On — CSS loading
 *
 * File estratto dal monolitico tryon.css nel M34 (2026-09-03).
 * Contiene solo le regole applicative del componente loading.
 * Caricato dal blocks/tryon.liquid via stylesheet_tag.
 *
 * NON aggiungere qui regole di altre modali — se serve, crea un file dedicato.
 */

.dresium-loading-modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}

.dresium-loading-modal::backdrop {
  background: var(--dresium-tryon-backdrop, rgba(0, 0, 0, 0.6)); /* ext value */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: dresium-result-fade-in 0.2s ease-out;
}

.dresium-loading-modal[open] {
  animation: dresium-result-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dresium-loading-modal__container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 25px 25px 20px; /* ext modal-header padding */
  background: var(--dresium-tryon-white, #ffffff);
  border-radius: var(--dresium-tryon-radius, 10px); /* ext modal-radius */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); /* ext modal-shadow */
  /* Larghezza fissa 640px — evita "wobble" al variare del trivia.
     min() protegge il viewport stretto senza fallback su 90%. */
  width: min(640px, calc(100vw - 40px));
  max-width: 640px;
  max-height: 85vh; /* ext value */
  overflow-y: auto;
  /* M55E (2026-09-08): usa var --dresium-tryon-font-paragraphs (default
     system, override dal merchant via applyTypography). Container: font
     "corpo" della modale. Fallback su Poppins per pre-M55E. */
  font-family: var(--dresium-tryon-font-paragraphs, 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

.dresium-loading-modal__brand-logo {
  display: block;
  /* 2026-09-08 (user report): larghezza max 120px + margin-bottom 25px per
     tutti e 3 i logo modali (loading/result/setting), coerente con il
     brand. Nota: sostituisce il margin:0 precedente, che si affidava al
     gap:16px del container. */
  margin: 0 0 25px;       /* allineato a sinistra, no auto-center */
  width: 120px;
  height: auto;
  max-width: 120px;
  background: transparent; /* explicit per prevenire bg da reset CSS del tema */
}

.dresium-loading-modal__content-enhanced {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 8px;
  background: var(--dresium-tryon-white, #ffffff);
  border-radius: var(--dresium-tryon-radius, 12px);
  border: 1px solid var(--dresium-tryon-canvas, #F4F5F9);
}

.dresium-loading-modal__image-wrapper {
  position: relative;
  width: 90px;
  height: 120px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--dresium-tryon-radius, 10px);
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dresium-loading-modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(30%);
  animation: dresium-loading-pulse 2s ease-in-out infinite;
}

.dresium-loading-modal__scanner {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  /* Scanner LED: identico a .ext-dresium-scanner-line dell'estensione
     (content-style.css:1160-1166) */
  background: linear-gradient(to right, transparent, var(--dresium-tryon-primary, #4362db), transparent);
  box-shadow: 0 0 8px var(--dresium-tryon-primary, #4362db), 0 0 16px var(--dresium-tryon-primary, #4362db);
  animation: dresium-loading-scan 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.dresium-loading-modal__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dresium-loading-modal__title {
  /* M55E: font heading merchant-driven (fallback Poppins pre-M55E). */
  font-family: var(--dresium-tryon-font-headings, 'Poppins', -apple-system, sans-serif);
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.dresium-loading-modal__subtitle {
  font-family: var(--dresium-tryon-font-paragraphs, 'Poppins', -apple-system, sans-serif);
  font-size: 14px;
  color: var(--dresium-tryon-gray-500, #6b7280);
  margin: 0 0 8px;
  line-height: 1.4;
}

.dresium-loading-modal__progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dresium-loading-modal__progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.dresium-loading-modal__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  /* Gradient indigo→magenta come l'estensione (--ext-dresium-gradient) */
  background: var(--dresium-tryon-gradient, linear-gradient(90deg, rgb(76, 110, 245) 0%, rgb(155, 81, 224) 100%));
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.dresium-loading-modal__progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--dresium-tryon-gray-500, #6b7280);
  min-width: 40px;
  text-align: right;
}

.dresium-loading-modal__curiosity {
  width: 100%;
  padding: 12px 16px;
  background: var(--dresium-tryon-primary-alpha-08, rgba(76, 110, 245, 0.08));
  border-radius: var(--dresium-tryon-radius, 12px);
  border-left: 3px solid var(--dresium-tryon-primary, #4362db);
}

.dresium-loading-modal__curiosity-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dresium-tryon-primary, #4362db);
  margin-bottom: 6px;
}

.dresium-loading-modal__curiosity-text {
  font-size: 13px;
  color: var(--dresium-tryon-gray-600, #4b5563);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
  min-height: 40px;
  transition: opacity 0.4s ease;
}

@keyframes dresium-loading-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes dresium-loading-scan {
  0% { top: -10%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 110%; opacity: 0; }
}


@media (max-width: 968px) {
  .dresium-loading-modal__container {
      width: 100vw;
      max-width: 100vw;
      height: 100vh;
      max-height: 100vh;
      border-radius: 0;
      justify-content: center;
      padding: 40px 20px;
    }
  .dresium-loading-modal__image-wrapper {
      width: 140px;
      height: 190px;
    }
}


@keyframes dresium-tryon-vibrate {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

