/* === CREA PROGETTO PAGE — Layout Split con Stepper === */

/* Container principale */
.create-project-layout {
  position: relative;
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.cp-generation-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 300;
}

.cp-generation-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.cp-generation-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  min-width: 240px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.cp-generation-overlay__content .spinner {
  width: 76px;
  height: 76px;
  border: 5px solid rgba(20, 20, 20, 0.2);
  border-top-color: #111111;
}

.cp-generation-overlay__text {
  font-size: 15px;
  font-weight: 500;
  color: #111111;
  text-transform: lowercase;
}

.cp-choice-panel {
  display:flex;
  flex-direction: column;
  flex-grow: 0;
  width:350px;
  height: 100%;
  overflow-y: auto;
  background-color:#f6f5f3;
}

.cp-preview-panel {
  flex-grow: 1;
  z-index:100;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* Header con titolo e stepper */
.cp-header {
  display: flex;
  align-items: center;
  margin-top: 90px;
  padding: 0 var(--sp-lg);
  background-color:#f6f5f3;

  font-size: 21px;
  font-weight: 600;
  margin-bottom: 0 0 18px;
  gap: 10px;  
}

.cp-header__title {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 0;
}

.cp-header__title svg {
  width: 26px;
  height: 26px;
}

.cp-header__title span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.cp-header__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.cp-header__icon-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0px;
  gap: 2px;
  width: 40px;
  height: 40px;
  opacity: 0.5;
  border-radius: 96px;
  flex: none;
  order: 0;
  flex-grow: 0;
  background-color: #f2f2f2;
  transition: all 0.3s;
}

.cp-header__icon-btn:hover {
  opacity: 1;
}

/* Stepper indicatori */
.cp-header__steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cp-step {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.5;
  transition: all 0.3s;
}

.cp-step.cp-step--active {
  opacity: 1;
}

.cp-step__number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
}

.cp-step.cp-step--active .cp-step__number {
  background: var(--c-text-primary);
  color: #ffffff;
}

.cp-step__label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cp-step--active .cp-step__label {
  color: var(--text-primary);
}

.cp-step-separator {
  width: 60px;
  height: 2px;
  background: var(--c-border);
  transition: background 0.3s;
}

.cp-step--active ~ .cp-step-separator {
  background: var(--c-text-primary);
}

/* Main container */
.cp-container {
  flex: 1;
  padding: 0 var(--sp-lg);
  padding-top:24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

/* Contenuto step */
.cp-step-content {
  display: none;
  width: 100%;
  animation: fadeIn 0.3s ease-in-out;
}

.cp-step-content--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form groups */
.cp-form-group {
  margin-bottom: 32px;
}

.cp-label-group {
  display:flex;
  align-items:center;
  gap:12px;
  flex-direction: row;
  margin-bottom: 12px;
}

.cp-label {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  flex-grow: 1;
}

.cp-label.required::after {
  content: " *";
  color: var(--c-danger);
}

.cp-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 1rem;
  border: 2px solid var(--c-border);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all 0.2s;
}

.cp-input:hover {
  border-color: var(--c-border-dark);
}

.cp-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.cp-room-config-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 1.2fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.cp-room-config-row__label {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.35;
}

.cp-room-config-row__value {
  width: 100%;
}

.cp-room-config-row__value .cp-input {
  margin: 0;
}

@media (max-width: 768px) {
  .cp-room-config-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.cp-input::placeholder {
  color: var(--text-secondary);
}

.cp-input--error {
  border-color: var(--c-danger);
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.cp-form-error {
  display: block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--c-danger);
}

.cp-form-error.hidden {
  display: none;
}

/* Ambienti chips */
.cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cp-chip {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  padding: 10px 12px;
  row-gap: 0px;
  height: 38px;
  background: #F2F2F2;
  border-radius: 8px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.cp-chip:hover {
  border-color: var(--c-primary);
  background: rgba(0, 136, 204, 0.05);
  transform: translateY(-2px);
}

.cp-chip--active {
  background: #FFFFFF;
  border: 1px solid #F1B81B;
  color: var(--c-primary);
  font-weight: 600;
}

.cp-change-step {
  align-items: center;
  gap: 2px;
  text-align: end;
  flex-grow: 1;
  color: #0636B9;
  cursor:pointer;
  font-size:12px;
  transform:translateY(1px);
}

.btn--cp-operation {
  padding: 10px 12px;
  row-gap: 0px;
  min-height: 38px;
  height: auto;
  background: #F2F2F2;
  border-radius: 8px;
  margin-bottom:8px;
  width:100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: start;
}

.btn--cp-operation--active {
  background: #FFFFFF;
  border: 1px solid #F1B81B;
  color: var(--c-primary);
  font-weight: 600;
}

.btn--cp-ambstyle {
  color: var(--c-primary);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px;
  gap: 12px;

  width: 286px;
  height: 80px;

  background: #FFFFFF;
  border: 1px solid #C3C7C9;
  border-radius: 8px;

  flex: none;
  align-self: stretch;
  flex-grow: 0;
}

.btn--cp-ambstyle--active {
  background: #FFFFFF;
  border: 2px solid #F1B81B;
  border-radius: 8px;
}

.btn--cp-ambstyle span {
  flex-grow:1;
  text-align: start;
}

.btn--cp-ambstyle img {
  width: 64px;
  height: 64px;
  border: 1px solid #E8E8ED;
  border-radius: 4px;
}

.btn--cp-ambsize {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  padding: 10px 12px;
  row-gap: 0px;
  height: 38px;
  background: #F2F2F2;
  border-radius: 8px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.btn--cp-ambsize:hover {
  border-color: var(--c-primary);
  background: rgba(0, 136, 204, 0.05);
  transform: translateY(-2px);
}

.btn--cp-ambsize--active {
  background: #FFFFFF;
  border: 1px solid #F1B81B;
  color: var(--c-primary);
  font-weight: 600;
}

.cp-chip__icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.cp-chip__label {
  white-space: nowrap;
}

/* Cards modalità */
.cp-mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.cp-mode-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--c-border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cp-mode-card:hover {
  border-color: var(--c-border-dark);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cp-mode-card--selected {
  border-color: var(--c-primary);
  background: rgba(0, 136, 204, 0.05);
}

.cp-mode-card__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cp-mode-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cp-mode-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #f0f0f0;
  transition: all 0.3s;
}

.cp-mode-card--selected .cp-mode-card__icon {
  background: var(--c-primary);
  color: white;
}

.cp-mode-card__radio-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.cp-mode-card__radio-indicator::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.cp-mode-card__radio-indicator--selected::before {
  opacity: 1;
}

.cp-mode-card__radio-indicator--selected {
  border-color: var(--c-primary);
}

.cp-mode-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.cp-mode-card__description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Azioni form */
.cp-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}

.cp-actions--center {
  justify-content: center;
  border-top: none;
  padding-top: 40px;
}

.cp-actions .btn {
  min-width: 160px;
}

.cp-generateai-btn {
  color:#000;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0px 20px 0px 12px;
  gap: 8px;
  width: 302px;
  height: 40px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 0, 153, 0.198) 99.98%, rgba(255, 128, 204, 0.2) 99.99%), #F1B81B;
  border-radius: 96px;
}

.cp-generateai-btn:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 85.58%, rgba(255, 0, 153, 0) 100%), #F1B81B;
}

.btn--cp-product {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px;
  gap: 12px;
  width: 286px;
  height: 80px;
  background: #FFFFFF;
  border: 1px solid #C3C7C9;
  border-radius: 8px;
  margin-bottom:6px;
}

.btn--cp-product__thumb {
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  border: 1px solid #E8E8ED;
  border-radius: 4px;
  flex: none;
  order: 0;
  align-self: stretch;
}

.btn--cp-product__label {
  flex-grow: 1;
  white-space: wrap;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn--cp-product__title {
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
}

.btn--cp-product__subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #8B8D8F;
}

.cp-photo-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 18px;
  border: 2px dashed #C3C7C9;
  border-radius: 12px;
  background: #FAFAFA;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom:10px;
}

.cp-photo-upload:hover,
.cp-photo-upload.is-dragover {
  border-color: #F1B81B;
  background: rgba(241, 184, 27, 0.08);
}

.cp-photo-upload.is-readonly {
  cursor: default;
}

.cp-photo-upload__input {
  display: none;
}

.cp-photo-upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #444444;
}

.cp-photo-upload__icon {
  font-size: 40px;
  line-height: 1;
}

.cp-photo-upload__placeholder p,
.cp-photo-upload__placeholder small,
.cp-photo-upload__meta span,
.cp-photo-upload__meta small {
  margin: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.cp-photo-upload__preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.cp-photo-upload__thumb {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #E8E8ED;
  background: #FFFFFF;
}

.cp-photo-upload__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cp-photo-upload__meta strong {
  color: var(--text-primary);
}

.cp-photo-upload__remove {
  padding: 0 14px;
  height: 36px;
  border-radius: 96px;
  background: #F2F2F2;
}

@media (max-width: 768px) {
  .cp-photo-upload__preview {
    grid-template-columns: 1fr;
  }

  .cp-photo-upload__thumb {
    width: 100%;
    max-width: 180px;
    height: auto;
    aspect-ratio: 1 / 1;
    justify-self: center;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .cp-header {
    padding: 24px;
  }

  .cp-header__title h1 {
    font-size: 1.5rem;
  }

  .cp-container {
    padding: 24px;
    flex-direction: column;
    gap: 32px;
  }

  .cp-chips {
    gap: 8px;
  }

  .cp-chip {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .cp-mode-cards {
    grid-template-columns: 1fr;
  }

  .cp-actions {
    flex-direction: column;
  }

  .cp-actions .btn {
    width: 100%;
  }

  .cp-header__steps {
    margin-top: 16px;
  }
}

@media (max-width: 480px) {
  .cp-header {
    padding: 16px;
  }

  .cp-header__title {
    flex-direction: column;
    gap: 12px;
  }

  .cp-chips {
    flex-direction: column;
  }

  .cp-chip {
    width: 100%;
    justify-content: center;
  }
}

/* ================================================================
   PRODUCT SELECTOR PANEL
   ================================================================ */

/* Overlay sul pannello destro (preview) */
.cp-product-selector-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: #fff;
  z-index: 200;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  animation: cp-slide-in-right 0.22s ease;
}

@keyframes cp-slide-in-right {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Anteprima prodotto (copre tutto lo schermo tranne il selettore) ── */
.cp-ps-preview {
  position: absolute;
  inset: 0;
  right: 360px; /* lascia spazio all'overlay selettore */
  z-index: 150; /* sopra il wizard panel */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cp-ps-preview-in 0.25s ease;
}

@keyframes cp-ps-preview-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sfondo del prodotto: copre tutta l'area */
.cp-ps-preview__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background 0.3s ease;
}

/* Placeholder (nessun prodotto selezionato) */
.cp-ps-preview__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #f5f5f3;
  text-align: center;
  padding: 40px;
}

.cp-ps-preview__placeholder svg rect {
  animation: cp-ps-pulse 2s ease-in-out infinite;
}
.cp-ps-preview__placeholder svg rect:nth-child(2) { animation-delay: 0.15s; }
.cp-ps-preview__placeholder svg rect:nth-child(3) { animation-delay: 0.30s; }
.cp-ps-preview__placeholder svg rect:nth-child(4) { animation-delay: 0.45s; }

@keyframes cp-ps-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.cp-ps-preview__placeholder-title {
  font-size: 16px;
  font-weight: 600;
  color: #888;
  margin: 0;
}

.cp-ps-preview__placeholder-text {
  font-size: 13px;
  color: #aaa;
  margin: 0;
  line-height: 1.6;
}

/* Info bar in basso (nome + meta del prodotto) */
.cp-ps-preview__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  color: #fff;
  animation: cp-ps-preview-in 0.2s ease;
}

.cp-ps-preview__swatch {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.5);
  display: block;
}

.cp-ps-preview__info-text {
  min-width: 0;
}

.cp-ps-preview__name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-ps-preview__meta {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-product-selector {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.cp-product-selector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--c-border);
  background: #fff;
  flex-shrink: 0;
}

.cp-product-selector__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.cp-product-selector__cancel {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}

.cp-product-selector__cancel:hover {
  color: var(--text-primary);
}

.cp-product-selector__surface {
  padding: 8px 20px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Header left group (products view) */
.cp-product-selector__header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-product-selector__back {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.cp-product-selector__back:hover {
  background: #f0f0f0;
  color: var(--text-primary);
}

/* Mode toggle (slitta Configura / Salvati) + search icon */
.cp-ps-mode-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  flex-shrink: 0;
}

.cp-ps-mode-toggle {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: #F2F2F2;
  border-radius: 96px;
  padding: 4px;
  gap: 4px;
  height: 48px;
}

.cp-ps-mode-toggle__pill {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #000000;
  border-radius: 96px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.cp-ps-mode-toggle--salvati .cp-ps-mode-toggle__pill {
  transform: translateX(100%);
}

.cp-ps-mode-toggle__btn {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #000000;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 96px;
  height: 40px;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}

.cp-ps-mode-toggle__btn--active {
  color: #FFFFFF;
  font-weight: 500;
}

/* Search icon button */
.cp-ps-search-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  background: #F2F2F2;
  border: none;
  border-radius: 96px;
  cursor: pointer;
  color: #000000;
  transition: background 0.15s;
}

.cp-ps-search-btn svg {
  width: 20px;
  height: 20px;
}

.cp-ps-search-btn:hover {
  background: #e8e8e8;
}

/* Category list */
.cp-ps-categories {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.cp-ps-category {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--c-border);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.cp-ps-category:hover {
  background: #f7f7f7;
}

.cp-ps-category__label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.cp-ps-category__chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* List */
.cp-product-selector__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.cp-product-selector__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.cp-product-selector__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Product grid */
.cp-product-selector__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}

/* Override per loader/empty che non devono essere celle */
.cp-product-selector__list > .cp-product-selector__loader,
.cp-product-selector__list > .cp-product-selector__empty {
  grid-column: 1 / -1;
}

.cp-product-selector__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0; /* prevents grid blowout on long names */
}

.cp-product-selector__item:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.cp-product-selector__item--applied {
  border-color: #4caf50;
  box-shadow: 0 0 0 1px #4caf50;
}

.cp-product-selector__item-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #e0e0e0;
  background-size: cover;
  background-position: center;
}

.cp-product-selector__item-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  padding: 5px 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
}

/* Product button selected state */
.btn--cp-product--selected {
  border-color: #F1B81B;
  background: #fffbf0;
}

.btn--cp-product__icon {
  font-size: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.btn--cp-product--selected .btn--cp-product__icon {
  color: #4caf50;
  font-weight: 700;
}

.btn--cp-product--selected .btn--cp-product__thumb {
  border-color: #F1B81B;
}

/* Checkbox styling */

.cp-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--c-border);
  border-radius: 6px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-checkbox:hover {
  border-color: var(--c-border-dark);
}

.cp-checkbox:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.cp-checkbox:checked {
  background: var(--bg-surface);
  border-color: #4caf50;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234caf50' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 8 4 4 8-8'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 85%;
}

.cp-checkbox:checked:hover {
  border-color: #43a047;
}

.cp-checkbox:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.cp-checkbox:checked:disabled {
  background: var(--bg-surface);
  border-color: #4caf50;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234caf50' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 8 4 4 8-8'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 85%;
  opacity: 0.6;
}

/* Room selection grid */
.cp-room-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cp-room-grid--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.cp-room-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-surface);
  border: 2px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  text-align: left;
}

.cp-room-tile:hover {
  border-color: var(--c-border-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cp-room-tile--selected {
  border-color: #F1B81B;
  box-shadow: 0 0 0 3px rgba(241, 184, 27, 0.25);
}

.cp-room-tile__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: #e8e8e8;
  background-size: cover;
  background-position: center;
}

.cp-room-tile__label {
  display: block;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Preview panel: contain + blurred cover bg + centroid dots === */

.cp-preview-panel--contain {
  background-image: none !important;
}

/* Blurred full-cover background to fill letterbox/pillarbox areas */
.cp-preview__bg-blur {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(22px);
  z-index: 0;
}

/* Contain layer: image shown in full, centered */
.cp-preview__contain {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 1;
}

/* SVG centroid overlay: same aspect-ratio centering as background-size:contain */
.cp-preview__centroids {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.cp-centroid-dot {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.cp-centroid-group {
  pointer-events: all;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.cp-centroid-group:hover .cp-centroid-dot {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}


/* ================================================================
   CONFIGURA PAGE — Layout (pannello sx + preview + pannello dx)
   ================================================================ */

.configura-layout {
  position: relative;
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

/* Override: il pannello sinistro della pagina configura
   riusa .cp-choice-panel di create-project */
.configura-layout .cp-choice-panel {
  flex-shrink: 0;
}

/* Override: nel pannello sx del configuratore i cp-form-group
   devono essere impilati verticalmente, non affiancati */
.configura-layout .cp-container {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow-y: auto;
}

/* Area centrale — BabylonJS canvas / splashscreen */
.cfg-preview-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f5f5f3;
  z-index: 100;
}

/* Splashscreen (mostrato finché non c'è un prodotto configurato) */
.cfg-splash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg,#f2f1ee,#e9e7e3);
}

.cfg-splash__spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.cfg-splash__spinner .spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.babylon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Pannello destro (tipologia selezionata) */
.cfg-right-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 350px;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  border-left: 1px solid var(--c-border);
  animation: cp-slide-in-right 0.2s ease;
  z-index: 100;
}

.cfg-right-panel.hidden {
  display: none;
}

/* Drawer header (pannello destro) */
.cfg-drawer-header {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px 32px;
  gap: 12px;
  height: 73px;
  flex-shrink: 0;
  border-bottom: 1px solid #C3C7C9;
}

.cfg-drawer-header__container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.cfg-drawer-header__text-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.cfg-drawer-header__title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 150%;
  color: #000000;
  align-self: stretch;
}

.cfg-drawer-header__description {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 150%;
  color: #545455;
  align-self: stretch;
}

/* Pulsante annulla */
.cfg-cancel-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  width: 75px;
  height: 40px;
  background: #F2F2F2;
  border: none;
  border-radius: 96px;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
  transition: background 0.15s;
}

.cfg-cancel-btn:hover {
  background: #e8e8e8;
}

/* Right panel content area */
.cfg-right-content {
  display: flex;
  flex-direction: column;
  padding: 16px 32px;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

/* Drawer footer (pannello destro) */
.cfg-drawer-footer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 32px;
  gap: 10px;
  width: 350px;
  height: 72px;
  background: #FFFFFF;
  border-top: 1px solid #C3C7C9;
  flex-shrink: 0;
}

.cfg-confirm-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0px 16px;
  gap: 2px;
  height: 40px;
  background: #000000;
  border: none;
  border-radius: 96px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  line-height: 100%;
  color: #FFFFFF;
  cursor: pointer;
  align-self: stretch;
  flex-grow: 0;
}

.cfg-confirm-btn:disabled {
  background: #C3C7C9;
  cursor: not-allowed;
}

/* Filter block */
.cfg-filter-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 16px;
  gap: 12px;
  background: #F2F2F2;
  border-radius: 8px;
  align-self: stretch;
}

.cfg-filter-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  height: 24px;
  cursor: pointer;
  user-select: none;
}

.cfg-filter-header__label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 120%;
  text-transform: uppercase;
  color: #000000;
}

.cfg-filter-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.cfg-filter-toggle svg {
  transition: transform 0.2s ease;
  transform: rotate(0deg);
}

.cfg-filter-toggle.is-collapsed svg {
  transform: rotate(-90deg);
}

.cfg-filter-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0;
  gap: 16px;
  align-self: stretch;
}

.cfg-filter-body.hidden {
  display: none;
}

.cfg-filter-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  align-self: stretch;
}

.cfg-filter-label-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.cfg-filter-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 120%;
  text-transform: uppercase;
  color: #545455;
}

.cfg-filter-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid #8B8D8F;
  border-radius: 96px;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.cfg-filter-select {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  align-self: stretch;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #C3C7C9;
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 120%;
  color: #000000;
  cursor: pointer;
}

.cfg-filter-select:focus {
  outline: none;
  border-color: #000000;
}

/* Product grid (3-column, used for Colori/Miscele/Decori) */
.cfg-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cfg-product-thumb {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  cursor: pointer;
  isolation: isolate;
  min-width: 0; /* prevents grid blowout on long product names */
}

.cfg-product-thumb__img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #F2F2F2;
}

.cfg-product-thumb__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.cfg-product-thumb:hover .cfg-product-thumb__img {
  outline: 2px solid #F1B81B;
  outline-offset: -2px;
}

.cfg-product-thumb.is-selected .cfg-product-thumb__img {
  outline: 2px solid #000000;
  outline-offset: -2px;
}

/* Badge "selezionato" (cerchio bianco in alto a destra) */
.cfg-product-thumb__badge {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: #FFFFFF;
  border-radius: 96px;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.cfg-product-thumb.is-selected .cfg-product-thumb__badge {
  display: flex;
}

.cfg-product-thumb__name {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 140%;
  color: #000000;
  text-align: center;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-grid-loader {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 0;
}

.cfg-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 12px;
  color: #8B8D8F;
  padding: 24px 0;
}

/* Section step header (e.g. "Tipologia") */
.cfg-section-step {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  height: 18px;
  align-self: stretch;
  margin-bottom: 8px;
}

.cfg-section-step__label {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 150%;
  color: #000000;
}

/* Section header nel pannello destro (Tessere / Decoro / ecc.) */
.cfg-section-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 18px;
  align-self: stretch;
  margin-bottom: 12px;
  margin-top: 16px;
}

.cfg-section-header__label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 150%;
  color: #000000;
}

/* Lista pulsanti tipologia */
.cfg-tipologia-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.cfg-tipo-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;

  padding: 13px 14px;
  border-radius: 14px;
  margin-bottom: 4px;
  transition: background .3s var(--ease),padding-left .3s var(--ease),box-shadow .3s var(--ease);  
}

.cfg-tipo-btn:hover {
  background: #fff;
  padding-left: 18px;
  box-shadow: 0 2px 10px rgba(20,20,20,.05), 0 1px 2px rgba(20,20,20,.04);
}

.cfg-tipo-btn span {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 15px;
	font-weight: 500;
	transition: transform .3s var(--ease),opacity .3s var(--ease);
}

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

.cfg-tipo-btn .chev {
  opacity:0;
}

.cfg-tipo-btn:hover .chev {
  opacity:1;
}

.cfg-tipo-btn__label {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 150%;
  color: #000000;
}

.cfg-tipo-btn__arrow {
  display: none;
}

/* ============================================================
   Mix editor — step 2 miscele (configura.js wizard)
   ============================================================ */

/* Prodotto wizard step 1: larghezza full nel pannello sx */
.cfg-wizard-product {
  width: 100%;
  box-sizing: border-box;
  cursor: default;
}

/* Lista righe miscela */
.cfg-mix-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Riga singolo colore nella miscela */
.cfg-mix-row {
  width: 100%;
  box-sizing: border-box;
  cursor: default;
}

/* Label nel mix: prende lo spazio residuo, tronca se troppo lunga */
.cfg-mix-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wrapper input percentuale + simbolo % */
.cfg-mix-pct-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.cfg-mix-pct {
  width: 50px;
  border: 1px solid #C3C7C9;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 13px;
  text-align: right;
  -moz-appearance: textfield;
}
.cfg-mix-pct::-webkit-outer-spin-button,
.cfg-mix-pct::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cfg-mix-pct:focus {
  outline: none;
  border-color: #F1B81B;
}

.cfg-mix-pct-unit {
  font-size: 12px;
  color: #8B8D8F;
}

/* Bottone "Aggiungi tessere" */
/* Bottone "Aggiungi tessere" — stile link compatto */
.cfg-mix-add-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0;
  gap: 2px;
  width: 100%;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #545455;
  margin-top: 8px;
  box-sizing: border-box;
}
.cfg-mix-add-row:hover {
  color: #000;
}

.cfg-mix-add-icon {
  font-size: 16px;
  line-height: 1;
  color: inherit;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer: Totale e Applica composizione su righe separate */
.cfg-mix-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 0 0;
  border-top: 1px solid #E8E8ED;
}

/* Riga totale percentuale */
.cfg-mix-total {
  display: block;
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 10px;
  line-height: 140%;
  text-align: center;
  color: #545455;
  white-space: nowrap;
  box-sizing: border-box;
}

.cfg-mix-apply-btn {
  font-size: 13px;
  padding: 6px 14px;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

/* ── ProductSelector: pannello stucco fisso in fondo ── */
.cp-ps-grout-panel {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
  background: #fff;
  gap: 12px;
}

.cp-ps-grout-panel__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cp-ps-grout-panel__swatch {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: block;
}

.cp-ps-grout-panel__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cp-ps-grout-panel__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cp-ps-grout-panel__subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-ps-grout-panel__edit {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cp-ps-grout-panel__edit:hover {
  color: var(--text-primary);
}

/* ── Palette colori stucco ── */
.cp-ps-grout-palette {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cp-ps-grout-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.cp-ps-grout-swatch {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: outline 0.1s, transform 0.1s;
}

.cp-ps-grout-swatch:hover {
  transform: scale(1.08);
}

.cp-ps-grout-swatch--selected {
  outline: 2px solid #1A1A1A;
  outline-offset: 2px;
}

/* Riga conferma stucco (fissa in fondo alla palette) */
.cp-ps-grout-confirm-row {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
  background: #fff;
}

.cp-ps-grout-confirm-btn {
  width: 100%;
}

/* ── Image configurator ── */
.cfg-image-dropZone {
  width: 100%;
  min-height: 160px;
  border: 2px dashed var(--c-border);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
  /* Make the whole dropzone clickable, including text */
  pointer-events: auto;
}

.cfg-image-dropZone__content {
  text-align: center;
  pointer-events: auto;
}

.cfg-image-dropZone__text {
  pointer-events: auto;
}

.cfg-image-dropZone:hover {
  background: #fafafa;
  border-color: #888;
}

.cfg-image-dropZone.has-image {
  border-style: solid;
  border-color: #1A1A1A;
}

.cfg-image-dropZone__content {
  text-align: center;
}

.cfg-image-dropZone__icon {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cfg-image-dropZone__text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  pointer-events: none;
}

.cfg-image-dropZone__hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.cfg-image-preview-container {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.cfg-image-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cfg-image-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10;
}

.cfg-image-remove-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.cfg-image-filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0;
}

.cfg-image-filter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfg-image-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cfg-image-format-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cfg-image-format-btn {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  background: #fff;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.cfg-image-format-btn:hover {
  border-color: #888;
}

.cfg-image-format-btn--selected {
  background: #1A1A1A;
  color: #fff;
  border-color: #1A1A1A;
}

.cfg-image-dimensions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cfg-image-dim-input {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  width: 286px;
  min-width: 180px;
  height: 48px;
  background: #fff;
  border: 1px solid #C3C7C9;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
}

.cfg-image-dim-input:focus {
  outline: none;
  border-color: #1A1A1A;
}

.cfg-image-color-selector {
  display: flex;
  gap: 8px;
}

.cfg-image-color-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  background: #fff;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.cfg-image-color-btn:hover {
  border-color: #888;
}

.cfg-image-color-btn--selected {
  background: #1A1A1A;
  color: #fff;
  border-color: #1A1A1A;
}

/* ── Image preview ── */
.cfg-image-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cfg-image-preview--hidden {
  display: none;
}

/* Make preview clickable anywhere (including file info) */
.cfg-image-preview__content,
.cfg-image-preview__fileinfo,
.cfg-image-preview__filename,
.cfg-image-preview__filesize {
  cursor: pointer;
}

/* Preview image container (clickable) */
.cfg-image-preview__content {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px;
  gap: 12px;
  width: 286px;
  height: 72px;
  background: #FFFFFF;
  border: 1px solid #C3C7C9;
  border-radius: 8px;
  cursor: pointer;
}

.cfg-image-preview__image {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
}

.cfg-image-preview__fileinfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.cfg-image-preview__filename {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfg-image-preview__filesize {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Form Select Styles ── */
.cfg-image-format-select,
.cfg-image-color-select {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  width: 286px;
  min-width: 180px;
  height: 48px;
  background: #fff;
  border: 1px solid #C3C7C9;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.cfg-image-format-select:focus,
.cfg-image-color-select:focus {
  outline: none;
  border-color: #1A1A1A;
}
.cfg-image-format-select option,
.cfg-image-color-select option {
  padding: 8px 12px;
}

/* ── Image upload container ── */
.cfg-image-upload-container {
  position: relative;
}

/* Hide dropzone when image is loaded */
.cfg-image-upload-container.has-image .cfg-image-dropZone {
  display: none;
}

/* Make preview clickable when it has image */
.cfg-image-preview.has-image {
  cursor: pointer;
}
.cfg-image-preview.has-image .cfg-image-preview__image {
  cursor: pointer;
}

/* ── File info in preview ── */
.cfg-image-preview__fileinfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfg-image-preview__filename {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.cfg-image-preview__filesize {
  font-size: 11px;
  color: var(--text-secondary);
}

