/* ─────────────────────────────────────────────────────────
   ZP Configurator — frontend styles
   Compatible with ZOneTheme (Bootstrap 4 base)
───────────────────────────────────────────────────────── */

.zp-configurator {
  margin: -5px 0 8px;
  font-family: inherit;
}

/* ── Section ─────────────────────────────────────────── */
.zp-section {
  margin-bottom: 50px;
}
.zp-section h6{
  text-transform: uppercase;
	font-size: 12px;
	font-weight: 700;
	color:#333;
	margin-top: 25px;
}

.zp-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  font-size: 14px;
  color: #828282;
}
.zp-section__label {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -3%;
}
.zp-section__label strong{
	color:#f15a24;
	font-weight: 700;
}

.zp-section__icon .material-icons {
  font-size: 18px;
  color: #e8730e;
  vertical-align: middle;
}

/* ── Options row ──────────────────────────────────────── */
.zp-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
	display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}


.zp-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.zp-option__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
	min-height: 100px;
  padding: 10px 14px;
  border: 1px solid #D7D7D7;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
  font-size: 13px;
  text-align: center;
  user-select: none;
	
}


.zp-option input[type="radio"]:checked + .zp-option__box {
  border-color: #EA5B27;
	box-shadow: 0px 0px 10px rgba(241,90,35,0.5);
}

.zp-option__box:hover {
  border-color: #6d6d6d;
}
.zp-option__label {
	font-size: 14px;
	font-weight: 400;
	color:#000;
	letter-spacing: -2%;
}

/* Thickness */
.zp-option--thickness .zp-option__value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.zp-option--thickness .zp-option__unit {
  font-size: 16px;
  color: #000;
	font-weight: 400;
}

/* Shape icons (SVG via CSS) */
.zp-shape-icon {
  display: block;
  width: 52px;
  height: 50px;
  margin: 0 auto 6px;
  background: currentColor;
  opacity: .30;
	background-size: 52px 50px !important;
	margin: 12px;
}

.zp-shape-icon--mezzaluna  { background: url(/img/cms/mezzaluna-shape.svg) no-repeat;}
.zp-shape-icon--circolare { background: url(/img/cms/circolare-shape.svg) no-repeat; }
.zp-shape-icon--ovale     { background: url(/img/cms/ovale-shape.svg) no-repeat; }
.zp-shape-icon--rettangolare { background: url(/img/cms/rettangolare-shape.svg) no-repeat; }

.zp-option input[type="radio"]:checked + .zp-option__box .zp-shape-icon {
  opacity: 1;
}

/* Orientation */
.zp-orient-icon img {
  width: 85px;
  padding: 5px;
	opacity: .30;
}
.zp-option input[type="radio"]:checked + .zp-option__box .zp-orient-icon img{
  opacity: 1;
}

/* ── Size section ─────────────────────────────────────── */
.zp-size-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.zp-tab-btn {
  padding: 6px 18px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.zp-tab-btn--active {
 border-color: #EA5B27;
	box-shadow: 0px 0px 10px rgba(241,90,35,0.5);
  font-weight: 600;
}
.form-floating > label {
  border: 1px solid transparent;
  height: 100%;
  padding: 0.85rem .75rem;
  pointer-events: none;
  position: absolute;
  left: 10px;
  transform-origin: 0 0;
  transition: opacity .1s ease-in-out, transform .1s ease-in-out;
  color: #6A6A6A;
  font-weight: 400 !important;
  font-size: 13px;
}
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-select ~ label {
  opacity: 1;
  transform: scale(.85) translateY(-.5rem) translateX(.15rem)
}
.form-floating > .form-control:-webkit-autofill ~ label {
  opacity: 1;
  transform: scale(.85) translateY(-.5rem) translateX(.15rem)
}
.form-floating > .form-control, .form-floating > .form-select {
  height: 49px !important;
  line-height: 1.25;
  border: 0px solid #ccc;
  border-radius: 6px;
  background: #FAF8FB;
	font-weight: 600;
}
.zp-section--size .form-group {
	margin-bottom: 0px !important;
}

.zp-size-inputs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.zp-size-field {
  flex: 1;
  min-width: 120px;
}

.zp-size-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #555;
}

.zp-size-field label small {
  font-weight: 400;
  color: #888;
}

.zp-select,
.zp-input {
  width: 100%;
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}

.zp-select:focus,
.zp-input:focus {
  border-color: #e8730e;
}

.zp-fixed-size {
  font-size: 14px;
  color: #444;
  margin: 4px 0 0;
}

.zp-hidden {
  display: none !important;
}

/* ── Logo upload ──────────────────────────────────────── */
.zp-dropzone {
  display: block;
  border: 1px dashed #662D91;
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
  background: #FAF8FB;
  margin-bottom: 12px;
}

.zp-dropzone:hover,
.zp-dropzone.is-over {
  border-color: #e8730e;
  background: #fff8f3;
}

.zp-dropzone input[type="file"] {
  display: none;
}

.zp-dropzone__inner .material-icons {
  font-size: 32px;
  color: #bbb;
  display: block;
  margin-bottom: 6px;
}

.zp-dropzone__inner span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #333;
	margin-top: 10px;
}

.zp-dropzone__inner small {
  color: #000;
  font-size: 12px;
	font-weight: 400;
}

.zp-dropzone__preview {
  margin-top: 8px;
  font-size: 13px;
  color: #e8730e;
  font-weight: 600;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zp-dropzone__preview-text {
  flex: 1;
  word-break: break-all;
}

.zp-dropzone__remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.zp-dropzone__remove:hover {
  border-color: #d9534f;
  color: #d9534f;
}

.zp-dropzone__remove .material-icons {
  font-size: 16px;
}

/* ── Color selector ───────────────────────────────────── */
.zp-options--color {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;

}

.zp-color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: border-color .15s, transform .1s;
	border: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px #ddd;
	margin-bottom: 8px;
}

.zp-color-swatch:hover {
  transform: scale(1.08);
	box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e8730e;
}

.zp-color-swatch--selected {
	box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px #e8730e !important;

}

.zp-color-swatch--hidden {
  display: none;
}

.zp-color-show-all {
  margin-top: 10px;
  background: none;
  border: none;
  color: #555;
  font-size: 13px;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ── Logo services ────────────────────────────────────── */
.zp-logo-services__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #555;
  margin-bottom: 8px;
}

.zp-service-option {
  display: block;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .15s;
	text-align: left;
}
.zp-service-option:hover {
	border: 1px solid #6d6d6d;
}

.zp-service-option input[type="checkbox"] {
  display: none;
}

.zp-service-option__body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.zp-service-option__body strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
	font-weight: 700;
	
}

.zp-service-option__body p {
  font-size: 13px;
  color: #666;
  margin: 0;
	font-weight: 400;
}

.zp-service-option__price {
  font-size: 15px;
  font-weight: 700;
  color: #662d91;
  white-space: nowrap;
}

.zp-service-option.selected,
.zp-service-option:has(input:checked) {
  border-color: #EA5B27;
  background: #fff;
	box-shadow: 0px 0px 10px rgba(241,90,35,0.5);
}

/* ── Price box ────────────────────────────────────────── */
.zp-price-box {
  
}

.zp-price-box--top {
  margin-top: 0;
  margin-bottom: 16px;
}

.zp-price-box__label {
  font-size: 14px;
  color: #444;
	margin-bottom: 10px;
	display: block;
}

.zp-price-box__value {
  font-size: 32px;
  font-weight: 700;
  color: #662D91;
	letter-spacing: -3%;
	display: block;
	margin-bottom: 30px;
}

.zp-price-box__hint {
  font-size: 12px;
  color: #888;
  width: 100%;
}

.zp-price-hint--error {
  color: #d9534f !important;
  font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
  .zp-options--thickness,
  .zp-options--shape,
  .zp-options--orientation {
    gap: 6px;
  }

  .zp-option__box {
    min-width: 52px;
    padding: 8px 10px;
  }

  .zp-options--color {
    grid-template-columns: repeat(6, 1fr);
    max-width: 100%;
  }

  .zp-color-swatch {
    width: 32px;
    height: 32px;
  }
}

/* ── DEBUG: formula di calcolo prezzo, passo-passo ────────────────
   Temporaneo per debug — rimuovi questo blocco (e il div in
   configurator.tpl) quando non serve più mostrarlo in pagina. */
.zp-price-debug {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbe6;
  border: 1px dashed #d4b106;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #3a3a3a;
  white-space: pre-wrap;
}

.zp-price-debug__title {
  font-weight: 700;
  color: #ad8b00;
  margin-bottom: 4px;
  display: block;
}

.zp-price-debug__line--applied {
  color: #237804;
}

.zp-price-debug__line--skipped {
  color: #8c8c8c;
}

.zp-price-debug__line--total {
  font-weight: 700;
  border-top: 1px dashed #d4b106;
  margin-top: 4px;
  padding-top: 4px;
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   v1.13.1 — Evidenziazione campi obbligatori / misura massima
   Classi aggiunte dal JS (markFieldError / clearFieldError).
   ══════════════════════════════════════════════════════════════ */

/* Input / select in errore */
.zp-input--error,
.zp-input--error:focus {
  border-color: #d9534f !important;
  box-shadow: 0 0 0 1px #d9534f !important;
}

.zp-size-field.zp-field--error label {
  color: #d9534f;
}

/* Messaggio sotto il campo / sezione */
.zp-field-error {
  color: #d9534f;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 6px;
  animation: zp-field-error-in .2s ease-out;
}

/* Sezioni senza input (colori, formato predefinito, fallback misura) */
.zp-section.zp-field--error .zp-section__label,
.zp-section.zp-field--error .zp-section__label strong {
  color: #d9534f;
}

.zp-section.zp-field--error .zp-options,
#zp-panel-preset.zp-field--error .zp-options {
  outline: 2px solid #d9534f;
  outline-offset: 4px;
  border-radius: 4px;
}

@keyframes zp-field-error-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   v1.14.0 — Alert misura non standard
   Riga rossa sotto larghezza + altezza (pannello "Personalizzata"),
   mostrata/nascosta dal JS con l'attributo hidden. Pulsante info che
   apre il testo configurabile + misure standard + percentuale.
   ══════════════════════════════════════════════════════════════ */

.zp-nonstandard-alert[hidden],
.zp-nonstandard-alert__info[hidden] {
  display: none !important;
}

.zp-nonstandard-alert {
  margin-top: 10px;
  border: 1px solid #d9534f;
  border-left-width: 4px;
  border-radius: 4px;
  background: #fdf2f2;
  color: #d9534f;
  font-size: 14px;
  line-height: 1.35;
  animation: zp-field-error-in .2s ease-out;
}

.zp-nonstandard-alert__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 12px;
}

.zp-nonstandard-alert__msg {
  font-weight: 600;
}

.zp-nonstandard-alert__info-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d9534f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease;
}

.zp-nonstandard-alert__info-btn:hover,
.zp-nonstandard-alert__info-btn.is-open {
  background: rgba(217, 83, 79, .12);
}

.zp-nonstandard-alert__info-btn:focus-visible {
  outline: 2px solid #d9534f;
  outline-offset: 1px;
}

.zp-nonstandard-alert__info {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(217, 83, 79, .3);
  color: #333;
  font-size: 13px;
}

.zp-nonstandard-alert__text {
  margin: 0 0 8px;
  white-space: pre-line; /* mantiene gli a capo del testo configurato */
}

.zp-nonstandard-alert__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
