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

.dresium-tryon-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  height: 44px;
  border: none;
  border-radius: var(--dresium-tryon-radius);
  background: var(--dresium-tryon-gradient);
  color: #ffffff;
  font-family: var(--dresium-tryon-font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: all var(--dresium-tryon-transition);
  min-width: 200px;
  outline: none;
}

.dresium-tryon-btn-primary:hover:not(:disabled) {
  background: var(--dresium-tryon-gradient-hover);
  box-shadow: var(--dresium-tryon-shadow-lg);
  color: #ffffff;
}

.dresium-tryon-btn-primary:focus-visible {
  outline: 2px solid var(--dresium-tryon-primary);
  outline-offset: 2px;
}

.dresium-tryon-btn-primary:active:not(:disabled) {
  box-shadow: var(--dresium-tryon-shadow-md);
  transform: scale(0.98);
}

.dresium-tryon-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.dresium-main-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
}

.dresium-main-modal[open] {
  display: flex;
}

.dresium-main-modal::backdrop {
  background: var(--dresium-tryon-backdrop, rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(4px);
}

.dresium-main-modal__container {
  display: flex;
  width: 90vw;
  max-width: 640px;
  height: 85vh;
  max-height: 640px;
  background: var(--dresium-tryon-white, #ffffff);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: var(--dresium-tryon-font-body);
}

#dresium-tryon-main-modal button,
#dresium-tryon-main-modal input[type="button"],
#dresium-tryon-main-modal input[type="submit"] {
  box-shadow: none !important;
}

.dresium-main-modal__sidebar {
  display: flex;
  flex-direction: column;
  width: 200px;
  background: var(--dresium-tryon-canvas, #F4F5F9);
  border-right: 1px solid #E9ECEF;
  flex-shrink: 0;
}

.dresium-main-modal__sidebar-header {
  padding: 24px;
}

.dresium-main-modal__logo {
  display: flex;
  align-items: center;
}

.dresium-main-modal .dresium-logo {
  /* 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.
     2026-09-11 fix: PNG sorgente 489x105 (aspect 4.66:1). object-fit contain
     + max-width al 100% del container garantisce che il logo non venga mai
     tagliato a destra anche se l'attributo HTML width/height e' incoerente
     o il container e' piu' stretto di 120px. */
  width: 120px;
  max-width: 100%;
  height: auto;
  margin: 0 0 25px;
  display: block;
  object-fit: contain;
}

.dresium-main-modal__nav {
  /* M42 (2026-09-04): fix regressione desktop logout position.
     Il nav deve stretchare per tutta la sidebar column così il logout
     (ultimo child con margin-top:auto) va davvero in fondo. `flex:1`
     da solo non basta in alcuni browser/edge case; aggiunta `height:
     100%` + `min-height: 0` (permette al flex child di respingere il
     size intrinseco del contenuto). */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  height: 100%;
  min-height: 0;
}

#dresium-tryon-main-modal .dresium-main-modal__nav-item,
#dresium-tryon-main-modal button.dresium-main-modal__nav-item,
#dresium-tryon-main-modal a.dresium-main-modal__nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 24px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  color: var(--dresium-tryon-gray-700, #495057) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-align: left !important;
  width: 100% !important;
  margin: 0 !important;
  text-decoration: none !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: var(--dresium-tryon-font-links, var(--dresium-tryon-font-body)) !important;
  height: auto !important;
}

#dresium-tryon-main-modal .dresium-main-modal__nav-item:hover,
#dresium-tryon-main-modal button.dresium-main-modal__nav-item:hover,
#dresium-tryon-main-modal a.dresium-main-modal__nav-item:hover {
  background: var(--dresium-tryon-gray-200, #E7E7E7) !important;
  color: var(--dresium-tryon-gray-900, #111) !important;
  box-shadow: none !important;
}

#dresium-tryon-main-modal a.dresium-main-modal__nav-item {
  text-decoration: none !important;
  color: var(--dresium-tryon-gray-700, #495057) !important;
}

#dresium-tryon-main-modal a.dresium-main-modal__nav-item .dresium-main-modal__nav-icon svg {
  stroke: currentColor !important;
}

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active,
#dresium-tryon-main-modal button.dresium-main-modal__nav-item--active,
#dresium-tryon-main-modal a.dresium-main-modal__nav-item--active {
  background: var(--dresium-tryon-primary-alpha-08, #E8EDF4) !important;
  color: var(--dresium-tryon-primary, #111827) !important;
  font-weight: 600 !important;
}

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active:hover {
  background: var(--dresium-tryon-primary-alpha-12, #E8EDF4) !important;
  color: var(--dresium-tryon-primary, #111827) !important;
}

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active .dresium-main-modal__nav-icon svg {
  stroke: var(--dresium-tryon-primary, #111827) !important;
}

/* 2026-09-08 (user request round 2): rimossa la regola margin-top:auto
   sul .nav-item--logout. Il logout non e' piu' dentro <nav> ma dentro
   un nuovo nodo dresium-main-modal__sidebar-footer, wrappato in un
   inner div flex column con justify-content:end. Il footer stesso
   assorbe lo spazio residuo tra <nav> e fine sidebar (flex: 1). */

.dresium-main-modal__nav-icon {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dresium-main-modal__nav-text {
  flex: 1;
  font-family: var(--dresium-tryon-font-body);
  font-weight: 500;
  color: var(--dresium-tryon-black, #000000);
}

/* 2026-09-08 (user request): label mobile short (Foto/Stile/Galleria/
   Logout). Nascosta in desktop, mostrata solo in mobile (max-width 968)
   dove sostituisce la label lunga sotto ogni icona. */
.dresium-main-modal__nav-text--mobile {
  display: none;
  font-family: var(--dresium-tryon-font-body);
  font-weight: 500;
  font-size: 11px;
  color: var(--dresium-tryon-black, #000000);
  text-align: center;
  line-height: 1.2;
}

/* 2026-09-08 (user request round 2): __sidebar-footer torna a essere
   usato come contenitore del Logout, duplicato semanticamente dal
   __sidebar-header. flex:1 assorbe lo spazio residuo tra <nav> e
   fine sidebar. L'inner wrapper con flex column + justify:end spinge
   il logout in fondo, allineato verticalmente. */
.dresium-main-modal__sidebar-footer {
  flex: 1;
  display: flex;
  min-height: 0;
}

.dresium-main-modal__sidebar-footer-inner {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: end;
  align-content: center;
  flex-direction: column;
}

.dresium-main-modal__credits {
  padding: 0;
  background: none;
  border-radius: 0;
  text-align: center;
  font-family: var(--dresium-tryon-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--dresium-tryon-black, #000000);
  border: none;
}

.dresium-main-modal__mobile-footer {
  display: none;
}

.dresium-main-modal__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.dresium-main-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--dresium-tryon-black, #000000);
  z-index: 100;
}

.dresium-main-modal__close:hover {
  background: transparent;
}

.dresium-main-modal__section {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 25px;
  overflow-y: auto;
}

.dresium-main-modal__section--active {
  display: flex;
}

.dresium-main-modal__section-header {
  margin-bottom: 32px;
}

.dresium-main-modal__title {
  font-family: var(--dresium-tryon-font-display);
  font-size: 28px;
  font-weight: 700;
  color: #212529;
  margin: 0;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--dresium-tryon-canvas, #F4F5F9);
  padding-bottom: 6px;
  margin-bottom: 6px;
  line-height: 1.25;
}

.dresium-main-modal__subtitle {
  font-size: 15px;
  color: #7A7A7A;
  margin: 0;
  line-height: 1.6;
  font-family: var(--dresium-tryon-font-body);
}

h2.dresium-main-modal__title + p.dresium-main-modal__subtitle {
  margin-block-start: 6px !important;
  padding-top: 6px !important;
}

.dresium-main-modal__section-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dresium-dismissible-box {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 4px;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.dresium-dismissible-box--hidden {
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  overflow: hidden;
}

.dresium-dismissible-box__content {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.5;
}

.dresium-dismissible-box__content svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.dresium-dismissible-box__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.dresium-dismissible-box__close:hover {
  opacity: 1;
}

.dresium-warning-info {
  margin: 0 0 12px 0;
  background: #fdf33c;
}

.dresium-warning-info .dresium-dismissible-box__content,
.dresium-warning-info .dresium-dismissible-box__content strong,
.dresium-warning-info .dresium-dismissible-box__content span {
  color: var(--dresium-tryon-black, #000000);
}

.dresium-warning-info .dresium-dismissible-box__close svg {
  stroke: var(--dresium-tryon-black, #000000);
}

.dresium-upload-info {
  margin: 0 0 25px 0;
  background: #0969da;
}

.dresium-upload-info .dresium-dismissible-box__content,
.dresium-upload-info .dresium-dismissible-box__content strong,
.dresium-upload-info .dresium-dismissible-box__content span {
  color: var(--dresium-tryon-white, #ffffff);
}

.dresium-upload-info .dresium-dismissible-box__close svg {
  stroke: var(--dresium-tryon-white, #ffffff);
}


@media (max-width: 768px) {
  .dresium-dismissible-box {
      padding: 0.75rem;
      gap: 0.5rem;
    }
  .dresium-dismissible-box__content {
      font-size: 0.8rem;
      line-height: 1.4;
      word-break: break-word;
    }
  .dresium-warning-info { margin-bottom: 10px !important; }
  .dresium-upload-info { margin-bottom: 20px !important; }
}


.dresium-style-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}


@media (max-width: 768px) {
  .dresium-style-form {
      grid-template-columns: 1fr;
    }
}


.dresium-style-form__buttons {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

#dresium-tryon-main-modal button[type="submit"],
#dresium-tryon-main-modal .dresium-btn--primary,
#dresium-tryon-main-modal .dresium-tryon-btn-primary {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 14px 32px !important;
  background: var(--dresium-tryon-gradient-diag, linear-gradient(135deg, #4362db 0%, #7C3AED 100%)) !important;
  color: var(--dresium-tryon-white, #ffffff) !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-family: var(--dresium-tryon-font-body) !important;
  box-shadow: 0 4px 12px var(--dresium-tryon-primary-alpha-20, rgba(67, 98, 219, 0.2)) !important;
}

#dresium-tryon-main-modal button[type="submit"]:hover:not(:disabled),
#dresium-tryon-main-modal .dresium-btn--primary:hover:not(:disabled),
#dresium-tryon-main-modal .dresium-tryon-btn-primary:hover:not(:disabled) {
  background: var(--dresium-tryon-gradient-diag-hover, linear-gradient(135deg, #3451c9 0%, #6b2adc 100%)) !important;
  /* 2026-09-08 (user report): translateY(-1px) rimosso perche' spostava
     visivamente il testo. Sostituito con box-shadow piu' marcata sotto
     al bottone (illusione di "sollevamento" senza layout shift). */
  box-shadow: 0 8px 20px var(--dresium-tryon-primary-alpha-40, rgba(67, 98, 219, 0.4)) !important;
}

#dresium-tryon-main-modal button[type="submit"]:disabled,
#dresium-tryon-main-modal .dresium-btn--primary:disabled,
#dresium-tryon-main-modal .dresium-tryon-btn-primary:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* 2026-09-08 (user report): il JS setta hidden=true su "Select this photo"
   quando photos.length===0, ma la regola display:flex !important sopra
   sovrascrive il default browser display:none dell'attributo hidden.
   Serve una classe hide-force con !important per nascondere davvero. */
#dresium-tryon-main-modal .dresium-tryon-btn-primary.dresium-tryon-btn--hidden,
#dresium-tryon-main-modal .dresium-tryon-btn-primary[hidden] {
  display: none !important;
}

#dresium-tryon-main-modal .dresium-btn--reset {
  background: var(--dresium-tryon-canvas, #F4F5F9) !important;
  color: var(--dresium-tryon-black, #000000) !important;
  font-weight: 500 !important;
  border-style: none !important;
  border-radius: 8px !important;
  padding: 16px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  justify-content: center !important;
  gap: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  font-family: var(--dresium-tryon-font-body) !important;
}

#dresium-tryon-main-modal .dresium-btn--reset svg {
  flex-shrink: 0;
}

#dresium-tryon-main-modal .dresium-btn--reset:hover {
  background: #e8e9ed !important;
}

.dresium-field__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  font-family: var(--dresium-tryon-font-body);
}

.dresium-field__select {
  width: 100%;
  padding: 5px 20px 5px 14px;
  font-size: 14px;
  color: var(--dresium-tryon-black, #000000);
  background-color: var(--dresium-tryon-canvas, #F4F5F9);
  border: 1px solid #DEE2E6;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  font-family: var(--dresium-tryon-font-body);
  height: 40px;
}

.dresium-field__select:hover {
  border-color: #ADB5BD;
}

.dresium-field__select:focus {
  outline: none;
  border-color: var(--dresium-tryon-primary, #4C6EF5);
  box-shadow: 0 0 0 3px var(--dresium-tryon-primary-alpha-12, rgba(76, 110, 245, 0.1));
}

.dresium-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.dresium-photo-grid__item {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 3px solid transparent;
  background: #e7e7e7;
}

.dresium-photo-grid__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.dresium-photo-grid__item--selected {
  border-color: var(--dresium-tryon-primary, #4A90E2);
  box-shadow: 0 4px 16px var(--dresium-tryon-primary-alpha-30, rgba(74, 144, 226, 0.3));
}

.dresium-photo-grid__item--upload {
  border: 3px dashed #CED4DA;
  background: #F8F9FA;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dresium-photo-grid__item--upload:hover {
  border-color: var(--dresium-tryon-primary, #4A90E2);
  background: var(--dresium-tryon-primary-alpha-08, #EBF5FF);
}

.dresium-photo-grid__upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #868E96;
  transition: all 0.2s ease;
}

.dresium-photo-grid__item--upload:hover .dresium-photo-grid__upload-icon {
  color: var(--dresium-tryon-primary, #4A90E2);
  transform: scale(1.1);
}

.dresium-photo-grid__image {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.dresium-photo-grid__delete-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.16);
  border-radius: 0 0 13px 13px;
  z-index: 2;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.dresium-photo-grid__item:hover .dresium-photo-grid__delete-wrapper {
  opacity: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.24);
}

.dresium-photo-grid__item .dresium-photo-grid__delete {
  background: transparent !important;
  border: none !important;
  padding: 4px 10px !important;
  margin: 0 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dresium-photo-grid__delete svg {
  width: 20px !important;
  height: 20px !important;
  color: var(--dresium-tryon-white, #ffffff) !important;
  stroke: var(--dresium-tryon-white, #ffffff) !important;
}

.dresium-photo-grid__empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.dresium-photo-grid__empty--visible {
  display: flex;
}

.dresium-photo-grid__empty-icon {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.dresium-photo-grid__empty-text {
  font-size: 16px;
  color: #868E96;
  margin: 0;
}

/* 2026-09-08 (user report round 3): distanziamento SOLO tra il testo
   "No photos uploaded" e il bottone "Upload your first photo" — icona
   e testo restano vicini. Applicato margin-top sul bottone stesso. */
.dresium-photo-grid__empty .dresium-tryon-btn-secondary {
  margin-top: 32px;
}

/* 2026-09-08 (user report): bottone "Upload your first photo" (empty state)
   deve mantenere sfondo bianco anche all'hover — override della regola
   .dresium-tryon-btn-secondary:hover che passa a #f9fafb. */
.dresium-photo-grid__empty .dresium-tryon-btn-secondary:hover:not(:disabled) {
  background: #ffffff;
}

.dresium-photo-grid__footer {
  margin-top: auto;
}

.dresium-photo-grid--loading {
  pointer-events: none;
  position: relative;
  min-height: 300px;
}

.dresium-photo-grid--loading > * {
  opacity: 0;
  visibility: hidden;
}

.dresium-photo-grid--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--dresium-tryon-primary, #8B5CF6);
  border-radius: 50%;
  animation: dresium-main-modal-spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.dresium-outfit-gallery {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dresium-outfit-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.dresium-outfit-gallery__item {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  background: #F8F9FA;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dresium-outfit-gallery__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.dresium-outfit-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dresium-outfit-gallery__item-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2;
  border-radius: 0 0 13px 13px;
}

.dresium-outfit-gallery__item:hover .dresium-outfit-gallery__item-overlay {
  opacity: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.24);
}

.dresium-outfit-gallery__item.active .dresium-outfit-gallery__item-overlay {
  opacity: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.24);
}

.dresium-outfit-gallery__item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s ease;
}

.dresium-outfit-gallery__item-btn svg {
  width: 15px;
  height: 15px;
  color: var(--dresium-tryon-white, #ffffff);
  stroke: var(--dresium-tryon-white, #ffffff);
}

.dresium-outfit-gallery__item-btn:hover svg {
  transform: scale(1.1);
}

.dresium-outfit-gallery__grid--loading {
  pointer-events: none;
  position: relative;
  min-height: 200px;
}

.dresium-outfit-gallery__grid--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--dresium-tryon-primary, #8B5CF6);
  border-radius: 50%;
  animation: dresium-main-modal-spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

.dresium-outfit-gallery__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #ADB5BD;
}

.dresium-outfit-gallery__empty-icon {
  font-size: 64px;
}

.dresium-outfit-gallery__empty:not(:only-child) {
  display: none;
}

.dresium-outfit-gallery__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: auto;
}

.dresium-outfit-gallery__nav-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8F9FA;
  border: 1px solid #DEE2E6;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  color: #495057;
  transition: all 0.2s ease;
}

.dresium-outfit-gallery__nav-btn:hover:not(:disabled) {
  background: #E9ECEF;
  border-color: #ADB5BD;
}

.dresium-outfit-gallery__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dresium-outfit-gallery__page-info {
  font-size: 14px;
  color: #495057;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
  font-family: var(--dresium-tryon-font-body);
}

#dresium-tryon-main-modal .dresium-gallery-scope-wrapper {
  display: flex !important;
  justify-content: center !important;
  margin-top: 12px !important;
}

#dresium-tryon-main-modal .dresium-gallery-scope {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 12px auto 0 auto !important;
  background: #f1f1f1 !important;
  border-radius: 999px !important;
  padding: 3px !important;
  box-shadow: none !important;
  border: 0 !important;
  width: auto !important;
  max-width: 100% !important;
}

#dresium-tryon-main-modal .dresium-gallery-scope__btn,
#dresium-tryon-main-modal button.dresium-gallery-scope__btn {
  border: 0 !important;
  background: transparent !important;
  color: #555 !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
  font-family: var(--dresium-tryon-font-body) !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-height: 0 !important;
  height: auto !important;
  width: auto !important;
  margin: 0 !important;
  text-decoration: none !important;
  outline: none !important;
  white-space: nowrap !important;
}

#dresium-tryon-main-modal .dresium-gallery-scope__btn--active,
#dresium-tryon-main-modal button.dresium-gallery-scope__btn--active {
  background: var(--dresium-tryon-white, #ffffff) !important;
  color: var(--dresium-tryon-gray-900, #111827) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

#dresium-tryon-main-modal .dresium-gallery-scope__btn:hover:not(.dresium-gallery-scope__btn--active) {
  background: rgba(255, 255, 255, 0.6) !important;
  color: #333 !important;
}


@media (max-width: 968px) {
  .dresium-main-modal__container {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      max-width: 100%;
      max-height: 100%;
      flex-direction: column;
      border-radius: 0;
    }
  .dresium-main-modal__content {
      position: unset;
    }
  .dresium-main-modal__sidebar {
      /* 2026-09-08 (user request): layout mobile — header (logo) sopra,
         una singola riga di 4 icone sotto (Foto/Stile/Galleria/Logout).
         Usiamo flex-wrap sull'aside stesso: header prende basis 100%
         (una riga intera), nav e sidebar-footer stanno nella stessa
         riga con flex 1 rispettivamente (nav 3 icone, footer 1). */
      width: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      padding: 16px;
      border-right: none;
      border-bottom: 1px solid #E9ECEF;
      gap: 0;
    }
  .dresium-main-modal__sidebar-header {
      /* Header su una riga intera. */
      flex-basis: 100%;
      padding: 0;
    }
  .dresium-main-modal__nav {
      flex-direction: row;
      justify-content: space-evenly;
      align-items: center;
      padding: 0;
      gap: 0;
      flex-wrap: nowrap;
      margin: 20px 0 10px 0;
      /* Il nav prende lo spazio delle 3 tab piu' il logout. Il footer
         (con logout) sta a fianco come 4° elemento. Insieme riempiono
         la riga sotto l'header. */
      flex: 1 1 auto;
    }
  #dresium-tryon-main-modal .dresium-main-modal__nav-item {
      flex-direction: column !important;
      flex: 1 !important;
      min-width: 0 !important;
      padding: 8px 4px !important;
      gap: 4px !important;
    }
  .dresium-main-modal__nav-text {
      /* Mobile: label lunga desktop nascosta (troppo grande per row). */
      display: none;
    }
  .dresium-main-modal__nav-text--mobile {
      /* Mobile: label short mostrata sotto l'icona (Foto/Stile/…). */
      display: block;
    }
  .dresium-main-modal__sidebar-footer {
      /* 2026-09-08 (user request round 3): sidebar-footer come 4° elemento
         inline nella riga icone. Reset del flex column desktop e stessi
         margin del nav per allineamento verticale. */
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      margin: 20px 0 10px 0;
      min-height: 0;
    }
  .dresium-main-modal__sidebar-footer-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      width: auto;
      height: auto;
    }
  .dresium-main-modal__mobile-footer {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px 16px;
      background: var(--dresium-tryon-canvas, #F4F5F9);
      border-top: 1px solid #E9ECEF;
      flex-shrink: 0;
    }
  .dresium-main-modal__mobile-credits {
      font-family: var(--dresium-tryon-font-body);
      font-size: 13px;
      font-weight: 600;
      color: var(--dresium-tryon-black, #000000);
      text-align: center;
    }
  #dresium-tryon-main-modal .dresium-main-modal__nav-item--logout {
      /* 2026-09-08 (user request round 3): il logout matcha lo stile
         inline delle 3 tab (column, no text, padding 8-4). Cosi' le
         4 icone hanno layout uniforme nella riga sotto l'header. */
      flex-direction: column !important;
      padding: 8px 4px !important;
      gap: 4px !important;
      margin: 0 !important;
      min-width: 0 !important;
    }
  .dresium-main-modal__section {
      padding: 32px 24px;
    }
  .dresium-outfit-gallery__grid,
    .dresium-photo-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
}


#dresium-tryon-main-modal .dresium-btn--reset {
    background: var(--dresium-tryon-canvas, #F4F5F9) !important;
    color: var(--dresium-tryon-black, #000000) !important;
    font-weight: 500 !important;
    justify-content: center !important;
    gap: 8px !important
    }

#dresium-tryon-main-modal .dresium-btn--reset svg {
    flex-shrink: 0 !important
    }

#dresium-tryon-main-modal .dresium-btn--reset:hover {
    background: #e8e9ed !important
    }

#dresium-tryon-main-modal button, #dresium-tryon-main-modal .button, #dresium-tryon-main-modal input[type="button"], #dresium-tryon-main-modal input[type="submit"] {
    box-shadow: none !important
    }

#dresium-tryon-main-modal .dresium-main-modal__nav-item, #dresium-tryon-main-modal button.dresium-main-modal__nav-item, .dresium-main-modal__nav-item, button.dresium-main-modal__nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 24px !important;
    /* RG-WEBDEV 2025-11-24: Adjusted from 14px 16px for better spacing */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #495057 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-align: left !important;
    width: 100% !important;
    margin: 0 !important;
    text-decoration: none !important;
    user-select: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    outline: none !important
    }

#dresium-tryon-main-modal .dresium-main-modal__nav-item:hover, #dresium-tryon-main-modal button.dresium-main-modal__nav-item:hover, .dresium-main-modal__nav-item:hover, button.dresium-main-modal__nav-item:hover {
    background: #E7E7E7 !important;
    color: #111 !important;
    box-shadow: none !important
    }

#dresium-tryon-main-modal a.dresium-main-modal__nav-item, a.dresium-main-modal__nav-item {
    text-decoration: none !important;
    color: #495057 !important
    }

#dresium-tryon-main-modal a.dresium-main-modal__nav-item:hover, a.dresium-main-modal__nav-item:hover {
    text-decoration: none !important;
    color: #111 !important
    }

#dresium-tryon-main-modal a.dresium-main-modal__nav-item .dresium-main-modal__nav-icon svg, a.dresium-main-modal__nav-item .dresium-main-modal__nav-icon svg {
    stroke: currentColor !important
    }

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active, #dresium-tryon-main-modal button.dresium-main-modal__nav-item--active, #dresium-tryon-main-modal a.dresium-main-modal__nav-item--active, .dresium-main-modal__nav-item--active, button.dresium-main-modal__nav-item--active, a.dresium-main-modal__nav-item--active {
    background: #E8EDF4 !important;
    color: var(--dresium-tryon-gray-900, #111827) !important;
    /* gray-900 */
    font-weight: 600 !important
    }

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active:hover, #dresium-tryon-main-modal button.dresium-main-modal__nav-item--active:hover, #dresium-tryon-main-modal a.dresium-main-modal__nav-item--active:hover, .dresium-main-modal__nav-item--active:hover, button.dresium-main-modal__nav-item--active:hover, a.dresium-main-modal__nav-item--active:hover {
    background: #E8EDF4 !important;
    color: var(--dresium-tryon-gray-900, #111827) !important
    }

#dresium-tryon-main-modal .dresium-main-modal__nav-item--active .dresium-main-modal__nav-icon svg, .dresium-main-modal__nav-item--active .dresium-main-modal__nav-icon svg {
    stroke: var(--dresium-tryon-gray-900, #111827) !important
    }

/* 2026-09-08 (user request round 2): duplicato margin-top:auto sul logout
   rimosso — il posizionamento e' ora gestito da .sidebar-footer con
   flex:1 e inner con justify-content:end. */

.dresium-btn--reset {
    background: var(--dresium-tryon-canvas, #F4F5F9) !important;
    color: var(--dresium-tryon-black, #000000) !important;
    font-weight: 500 !important;
    border-style: none !important;
    border-radius: 8px !important;
    padding: 16px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    justify-content: center !important;
    gap: 8px !important
    }

.dresium-btn--reset svg {
    flex-shrink: 0
    }

.dresium-btn--reset:hover {
    background: #e8e9ed !important
    }

.dresium-btn--disabled, .dresium-style-form button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #ccc !important;
    color: #666 !important
    }


@media (max-width: 968px) {
  .dresium-main-modal__nav-item {
        flex-direction: column;
        flex: 1;
        /* RG-WEBDEV 2026-03-09: Equal width for all items */
        min-width: 0;
        /* RG-WEBDEV 2026-03-09: Allow shrinking below content size */
        padding: 8px 4px;
        /* RG-WEBDEV 2026-03-09: Compact padding */
        gap: 4px
        }
  .dresium-main-modal__nav-item--logout {
        margin-top: 0 !important;
        margin-left: 0 !important
        }
}

/* 2026-09-08 (user request): margin-bottom 48px sul link logout solo
   in desktop (viewport >= 969px). In mobile il logout e' inline sulla
   riga del nav con le altre 3 icone — margin-bottom non ha senso.
   Specificity boost via #id: la regola generica alla riga 1122
   (#dresium-tryon-main-modal .nav-item { margin: 0 !important })
   ha specificity 1-1-0 e vince sulla nostra 0-2-0. Aggiungiamo l'id
   per portare la specificity a 1-2-0. */
@media (min-width: 969px) {
  #dresium-tryon-main-modal .dresium-main-modal__nav-item.dresium-main-modal__nav-item--logout {
    margin-bottom: 48px !important;
  }
}


#dresium-tryon-main-modal h1,
#dresium-tryon-main-modal h2,
#dresium-tryon-main-modal h3,
#dresium-tryon-main-modal h4,
#dresium-tryon-main-modal h5,
#dresium-tryon-main-modal h6 {
    /* M55E: heading merchant-driven (fallback Poppins). */
    font-family: var(--dresium-tryon-font-headings, "Poppins", Sans-serif) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--dresium-tryon-black, #000000) !important;
    line-height: 1.5 !important;
    margin-block-end: 0 !important;
    margin-block-start: 0 !important;
}

/* 2026-09-08 (user request round 2): rimossa la regola specificity-boost
   che forzava margin-top:auto sul .nav-item--logout dentro <nav>. Il
   logout ora e' fuori dal <nav>, dentro .sidebar-footer > inner con
   flex column + justify:end. Il posizionamento in fondo e' gestito
   dal footer stesso (flex:1) senza margin-top hacks. */

#dresium-tryon-main-modal p {
    /* M55E: paragrafi merchant-driven (fallback Inter). */
    font-family: var(--dresium-tryon-font-paragraphs, "Inter", Sans-serif) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin-block-end: 0 !important;
    margin-block-start: 0 !important;
}

.dresium-photo-grid__item--vibrate {
    animation: dresium-tryon-vibrate 0.3s ease;
}


/* ============================================================
   M51 (2026-09-04): port letterale CSS gallery tile da MSW.
   Fonte: client/wp/wp-content/plugins/dresium/assets/css/
   dresium-main-modal.css (righe 1897-2027 badge/fullscreen +
   :646-699 overlay/btn + :1825-1875 video/processing).
   Ordine e valori esatti 1:1 con MSW per rendere il rendering
   identico. Le mie precedenti scelte (M47 viola-gradient 32x32,
   M49 quadratini 28x28) erano arbitrarie e non coincidevano.
   ============================================================ */

/* Video Badge — Base (MSW :1897)
   M51-fix2 (2026-09-04): il badge ha `width: 20px !important` che
   vince sul reset button MSW (mentre il fullscreen-btn perde perché
   non ha !important — vedi commento su .__fullscreen-btn). Con
   box-sizing: border-box (default MSS via tryon.css:162) padding 0
   e width 20px = 20x20 esterno. Corretto per matchare MSW. */
.dresium-outfit-gallery__item-video-badge {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 20px !important;
    height: 20px !important;
    background: var(--dresium-tryon-primary, #8B5CF6) !important;
    border: none !important;
    border-radius: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

/* Video Badge — Button override (MSW :1917) */
#dresium-tryon-main-modal .dresium-outfit-gallery__item button.dresium-outfit-gallery__item-video-badge,
.dresium-outfit-gallery__item button.dresium-outfit-gallery__item-video-badge {
    background-color: rgba(0, 0, 0, 0.24) !important;
    border-radius: 4px !important;
}

.dresium-outfit-gallery__item-video-badge:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.6) !important;
}

.dresium-outfit-gallery__item-video-badge:active {
    transform: scale(0.95) !important;
}

.dresium-outfit-gallery__item-video-badge:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.dresium-outfit-gallery__item-video-badge:disabled:hover {
    transform: none !important;
}

.dresium-outfit-gallery__item-video-badge--hidden {
    display: none !important;
}

.dresium-outfit-gallery__item-video-badge svg {
    color: #fff !important;
    width: 15px !important;
    height: 15px !important;
    background-color: transparent;
    padding: 2px;
    box-sizing: content-box !important;
}

/* M57-fix (2026-09-08): badge play/stop DEVE restare cliccabile quando
   video visibile per permettere all'utente di stopparlo. Il MSW pattern
   originale nascondeva il badge in playing-state, ma UX richiede toggle
   attivo. Rimosso pointer-events:none + opacita' ridotta. */

/* Spin animation utility (MSW :1964) — keyframes dresium-spin
   equivalente a MSW dresium-video-spin, già in tryon.css:381 */
.dresium-spin {
    animation: dresium-spin 1s linear infinite;
}

/* Fullscreen Button — Base (MSW :1981)
   M51-fix2 (2026-09-04): il MSW ha un reset button `#dresium-main-modal
   button { width: auto !important; ... }` che sovrascrive il width:28px
   del rule .__fullscreen-btn. Risultato computed MSW: bottone 19x19
   (auto = content SVG 15x15 + padding 2px con border-box).
   Nel MSS non ho quel reset — quindi il bottone rimaneva 28x28.
   Fix: forzo `width: auto !important; height: auto !important` per
   replicare il comportamento MSW. Il bottone si dimensiona sul contenuto
   svg + padding. NON aggiungo min-width/min-height (default = 0). */
.dresium-outfit-gallery__fullscreen-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.dresium-outfit-gallery__item:hover .dresium-outfit-gallery__fullscreen-btn,
.dresium-outfit-gallery__item.active .dresium-outfit-gallery__fullscreen-btn,
.dresium-outfit-gallery__item--showing-video .dresium-outfit-gallery__fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

.dresium-outfit-gallery__fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dresium-outfit-gallery__fullscreen-btn svg {
    width: 15px;
    height: 15px;
    stroke: #FFFFFF;
}

/* Fullscreen Button — Override higher-specificity (MSW :2022) */
#dresium-tryon-main-modal div.dresium-main-modal__content .dresium-outfit-gallery__item button.dresium-outfit-gallery__fullscreen-btn {
    background-color: rgba(0, 0, 0, 0.24) !important;
    padding: 2px !important;
    border-radius: 4px !important;
    color: #ffffff !important;
}

/* Video inline nella tile (MSW :1846). Nascosto di default via
   display: none (NON hidden attribute — MSW usa class toggle). */
.dresium-outfit-gallery__item-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: none;
}

.dresium-outfit-gallery__item-video.dresium-video-visible {
    display: block;
}

/* ============================================================
   M52 (2026-09-04): Share expansion inline — port letterale MSW.
   Fonte: dresium-main-modal.css:1524-1603 (share expansion +
   btn active/hidden + media queries mobile).
   
   Comportamento: al click sul share button si nascondono i 3
   item-btn (view/share/delete) e appaiono inline nell'overlay
   le 3 icone social (WhatsApp/Facebook/Instagram).
   ============================================================ */

/* Share expansion container (MSW :1524) */
.dresium-share-expansion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.1s ease-out;
    pointer-events: none;
}

.dresium-share-expansion--active {
    opacity: 1;
    pointer-events: all;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

/* Share expansion buttons (MSW :1545) */
.dresium-share-expansion__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    color: #FFFFFF;
}

.dresium-share-expansion__btn:hover {
    transform: scale(1.1);
}

.dresium-share-expansion__btn:active {
    transform: scale(0.95);
}

.dresium-share-expansion__btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}
/* 2026-09-08 (fix user): tutte le 3 icone social (WA/FB/IG) usano ora
   fill="currentColor" nel path SVG + color:#FFFFFF sul btn container →
   uniformi bianche. L'override --instagram fill:none e' stato rimosso
   perche' non piu' necessario. */

/* Share button active state (MSW :1572) */
.dresium-outfit-gallery__item-btn--active {
    background: rgba(0, 123, 255, 0.1) !important;
    border-color: rgba(0, 123, 255, 0.3) !important;
    transform: scale(1.05);
}

/* Hide main buttons durante share expansion (MSW :1579) */
.dresium-outfit-gallery__item-btn--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: opacity 0.1s ease-out,
                transform 0.1s ease-out;
}

/* Mobile responsive (MSW :1589) */
@media (max-width: 768px) {
    .dresium-share-expansion {
        gap: 3vw !important;
    }
    .dresium-share-expansion__btn {
        width: 6vw !important;
        height: 6vw !important;
        padding: 0 !important;
    }
    .dresium-share-expansion__btn svg {
        width: 4vw !important;
        height: 4vw !important;
    }
}
