/* =========================================================
   ZERLAB STUDIO — CONFIGURATORE
   VERSIONE COMPATTA
   ========================================================= */


/* =========================================================
   SEZIONE
   ========================================================= */

.configurator {
  width: 100%;

  padding:
    clamp(90px, 8vw, 125px)
    var(--page-padding)
    clamp(100px, 9vw, 140px);

  background: var(--navy);

  overflow: hidden;
}


/* =========================================================
   HEADER
   ========================================================= */

.configurator-heading {
  width: 100%;
  max-width: 1100px;

  margin:
    0 auto
    clamp(42px, 5vw, 60px);
}


.configurator .section-eyebrow {
  color: rgba(255, 255, 255, 0.58);
}


.configurator .section-eyebrow span {
  background: rgba(255, 255, 255, 0.25);
}


.configurator-title-row {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 60px;
}


.configurator-title-row h2 {
  color: var(--white);

  font-size:
    clamp(50px, 5vw, 76px);

  font-weight: 500;

  line-height: 0.95;

  letter-spacing: -4px;
}


.configurator-title-row h2 strong {
  color: #7eabd1;

  font-weight: 700;
}


.configurator-title-row p {
  max-width: 330px;

  padding-bottom: 5px;

  color: rgba(255, 255, 255, 0.56);

  font-size: 14px;

  line-height: 1.65;
}


/* =========================================================
   APP
   ========================================================= */

.configurator-app {
  width: 100%;
  max-width: 1100px;

  margin: 0 auto;

  display: grid;

  grid-template-columns:
    minmax(0, 1.25fr)
    minmax(365px, 0.75fr);

  background: var(--cream-light);

  border:
    1px solid
    rgba(255, 255, 255, 0.10);

  border-radius: 18px;

  overflow: hidden;

  box-shadow:
    0 28px 70px
    rgba(0, 0, 0, 0.22);
}


/* =========================================================
   ANTEPRIMA
   ========================================================= */

.configurator-preview {
  min-height: 570px;

  padding:
    25px
    clamp(25px, 3vw, 42px);

  display: flex;

  flex-direction: column;

  background: #e9e3d9;
}


/* =========================================================
   PREVIEW TOP
   ========================================================= */

.preview-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  color: #68727d;

  font-size: 8px;
  font-weight: 700;

  letter-spacing: 1.8px;

  text-transform: uppercase;
}


.preview-size {
  padding:
    6px
    10px;

  color: var(--ink);

  border:
    1px solid
    rgba(7, 24, 44, 0.10);

  border-radius: 30px;

  background:
    rgba(255, 255, 255, 0.45);
}


/* =========================================================
   STAGE
   ========================================================= */

.preview-stage {
  flex: 1;

  min-height: 390px;

  padding:
    35px
    15px;

  display: flex;

  align-items: center;
  justify-content: center;

  perspective: 1200px;
}


/* =========================================================
   TAPPETO
   ========================================================= */

.mat-preview {
  position: relative;

  width: min(70%, 440px);

  aspect-ratio: 4 / 3;

  display: flex;

  align-items: center;
  justify-content: center;

  background: #6f5948;

  border-radius: 4px;

  overflow: hidden;

  box-shadow:
    0 12px 20px
    rgba(7, 24, 44, 0.10),

    0 28px 48px
    rgba(7, 24, 44, 0.20);

  transform:
    rotateX(5deg)
    rotateZ(-1deg);

  transition:
    width 0.4s ease,
    aspect-ratio 0.4s ease,
    background 0.35s ease,
    box-shadow 0.35s ease;
}


/* =========================================================
   TEXTURE
   ========================================================= */

.mat-texture {
  position: absolute;

  inset: 0;

  pointer-events: none;

  opacity: 0.24;

  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent 3px
    );
}


/* =========================================================
   LOGO PREVIEW
   ========================================================= */

.logo-preview {
  position: relative;

  z-index: 2;

  width: 55%;
  height: 55%;

  display: flex;

  align-items: center;
  justify-content: center;

  color:
    rgba(255, 255, 255, 0.82);

  font-size:
    clamp(14px, 1.6vw, 23px);

  font-weight: 700;

  letter-spacing: 2.5px;

  text-align: center;
}


.logo-preview img {
  display: none;

  width: 100%;
  height: 100%;

  object-fit: contain;
}


.logo-preview.has-logo span {
  display: none;
}


.logo-preview.has-logo img {
  display: block;
}


/* =========================================================
   PREVIEW BOTTOM
   ========================================================= */

.preview-bottom {
  padding-top: 16px;

  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 25px;

  border-top:
    1px solid
    rgba(7, 24, 44, 0.11);
}


.preview-bottom > span {
  color: var(--ink);

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 1.8px;
}


.preview-bottom p {
  max-width: 245px;

  color: #747d88;

  font-size: 9px;

  line-height: 1.55;

  text-align: right;
}


/* =========================================================
   CONTROLLI
   ========================================================= */

.configurator-controls {
  padding:
    27px
    clamp(25px, 2.5vw, 36px);

  background: #fbf9f5;

  border-left:
    1px solid
    rgba(7, 24, 44, 0.09);
}


/* =========================================================
   HEADER CONTROLLI
   ========================================================= */

.controls-heading {
  padding-bottom: 21px;

  border-bottom:
    1px solid
    rgba(7, 24, 44, 0.09);
}


.controls-heading > span {
  color: var(--blue);

  font-size: 8px;
  font-weight: 800;

  letter-spacing: 2.2px;
}


.controls-heading p {
  margin-top: 6px;

  color: #7a838d;

  font-size: 11px;
}


/* =========================================================
   BLOCCHI
   ========================================================= */

.config-block {
  padding:
    21px
    0;

  display: grid;

  grid-template-columns:
    32px
    1fr;

  gap: 12px;

  border-bottom:
    1px solid
    rgba(7, 24, 44, 0.09);
}


.config-number {
  padding-top: 4px;

  color: #a1a9b1;

  font-size: 8px;
  font-weight: 700;

  letter-spacing: 1px;
}


.config-label {
  margin-bottom: 14px;

  display: flex;

  align-items: center;
  justify-content: space-between;
}


.config-label h3 {
  color: var(--ink);

  font-size: 16px;
  font-weight: 650;

  letter-spacing: -0.4px;
}


.config-label > span {
  color: #9aa1a9;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 1px;
}


/* =========================================================
   DIMENSIONI
   ========================================================= */

.size-fields {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 9px;
}


.size-fields label > span {
  display: block;

  margin-bottom: 6px;

  color: #8b939c;

  font-size: 7px;
  font-weight: 700;

  letter-spacing: 1.1px;
}


.number-input {
  height: 43px;

  padding:
    0
    12px;

  display: flex;

  align-items: center;

  border:
    1px solid
    rgba(7, 24, 44, 0.13);

  border-radius: 7px;

  background: #ffffff;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}


.number-input:focus-within {
  border-color:
    rgba(7, 73, 132, 0.55);

  box-shadow:
    0 0 0 3px
    rgba(7, 73, 132, 0.06);
}


.number-input input {
  width: 100%;

  border: 0;
  outline: 0;

  color: var(--ink);

  background: transparent;

  font-size: 13px;
  font-weight: 600;
}


.number-input > span {
  color: #939aa2;

  font-size: 9px;
}


/* =========================================================
   COLORI
   ========================================================= */

.background-options {
  display: flex;

  flex-wrap: wrap;

  gap: 7px;
}


.background-option {
  min-height: 37px;

  padding:
    0
    11px;

  display: flex;

  align-items: center;

  gap: 7px;

  border:
    1px solid
    rgba(7, 24, 44, 0.12);

  border-radius: 30px;

  color: #59636e;

  background: #ffffff;

  font-size: 9px;
  font-weight: 600;

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}


.background-option:hover {
  border-color:
    rgba(7, 73, 132, 0.45);

  transform:
    translateY(-1px);
}


.background-option > span {
  width: 15px;
  height: 15px;

  display: block;

  border-radius: 50%;

  box-shadow:
    inset 0 0 0 1px
    rgba(0, 0, 0, 0.08);
}


.background-option.is-selected {
  border-color: var(--blue);

  color: var(--ink);

  background:
    rgba(7, 73, 132, 0.055);
}


/* =========================================================
   UPLOAD
   ========================================================= */

.upload-button {
  width: 100%;

  min-height: 56px;

  padding:
    9px
    12px;

  display: flex;

  align-items: center;

  gap: 10px;

  border:
    1px dashed
    rgba(7, 24, 44, 0.24);

  border-radius: 8px;

  background:
    rgba(255, 255, 255, 0.45);

  cursor: pointer;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}


.upload-button:hover {
  border-color: var(--blue);

  background:
    rgba(7, 73, 132, 0.035);

  transform:
    translateY(-1px);
}


.upload-plus {
  width: 31px;
  height: 31px;

  flex-shrink: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  color: var(--white);

  background: var(--blue);

  font-size: 17px;
}


.upload-button div {
  flex: 1;
}


.upload-button strong {
  display: block;

  color: var(--ink);

  font-size: 8px;

  letter-spacing: 0.9px;
}


.upload-button small {
  display: block;

  margin-top: 3px;

  color: #9199a2;

  font-size: 7px;
}


.upload-arrow {
  color: var(--ink);

  font-size: 14px;
}


.uploaded-file {
  margin-top: 7px;

  color: var(--blue);

  font-size: 8px;

  word-break: break-word;
}


/* =========================================================
   RIEPILOGO
   ========================================================= */

.config-summary {
  padding-top: 22px;
}


.summary-top {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;
}


.summary-top > div:first-child > span {
  display: block;

  color: var(--ink);

  font-size: 8px;
  font-weight: 700;

  letter-spacing: 1.3px;
}


.summary-top small {
  display: block;

  margin-top: 5px;

  color: #838b94;

  font-size: 9px;
}


.config-price {
  text-align: right;
}


.config-price span {
  display: block;

  margin-bottom: 4px;

  color: #8c949c;

  font-size: 6px;
  font-weight: 700;

  letter-spacing: 1px;
}


.config-price strong {
  color: var(--ink);

  font-size: 24px;
  font-weight: 700;

  letter-spacing: -1px;
}


.price-note {
  margin-top: 13px;

  color: #969da5;

  font-size: 8px;

  line-height: 1.45;
}


/* =========================================================
   CONTINUA
   ========================================================= */

.config-continue {
  width: 100%;
  height: 48px;

  margin-top: 15px;

  padding:
    0
    17px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  border: 0;

  border-radius: 7px;

  color: var(--white);

  background: var(--blue);

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 1px;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}


.config-continue:hover {
  background: var(--blue-hover);

  transform:
    translateY(-2px);

  box-shadow:
    0 10px 22px
    rgba(7, 73, 132, 0.18);
}


.config-continue span {
  font-size: 16px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

  .configurator-heading {
    max-width: 760px;
  }


  .configurator-app {
    max-width: 760px;

    grid-template-columns: 1fr;
  }


  .configurator-preview {
    min-height: 530px;
  }


  .preview-stage {
    min-height: 360px;
  }


  .mat-preview {
    width: min(68%, 430px);
  }


  .configurator-controls {
    border-top:
      1px solid
      rgba(7, 24, 44, 0.09);

    border-left: 0;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

  .configurator {
    padding:
      75px
      20px
      85px;
  }


  .configurator-heading {
    margin-bottom: 38px;
  }


  .configurator-title-row {
    align-items: flex-start;

    flex-direction: column;

    gap: 20px;
  }


  .configurator-title-row h2 {
    font-size:
      clamp(46px, 13vw, 60px);

    letter-spacing: -3px;
  }


  .configurator-title-row p {
    max-width: 290px;

    font-size: 12px;
  }


  .configurator-app {
    border-radius: 13px;
  }


  .configurator-preview {
    min-height: 420px;

    padding:
      22px
      18px;
  }


  .preview-stage {
    min-height: 295px;

    padding:
      32px
      5px;
  }


  .mat-preview {
    width: min(82%, 330px);
  }


  .preview-bottom {
    align-items: flex-start;

    flex-direction: column;

    gap: 7px;
  }


  .preview-bottom p {
    max-width: 250px;

    text-align: left;
  }


  .configurator-controls {
    padding:
      27px
      20px;
  }


  .config-block {
    grid-template-columns:
      28px
      1fr;
  }


  .size-fields {
    grid-template-columns:
      repeat(2, 1fr);
  }


  .summary-top {
    align-items: flex-start;

    flex-direction: column;

    gap: 13px;
  }


  .config-price {
    text-align: left;
  }

}


/* =========================================================
   MOBILE PICCOLO
   ========================================================= */

@media (max-width: 430px) {

  .configurator {
    padding-left: 16px;
    padding-right: 16px;
  }


  .configurator-title-row h2 {
    font-size: 45px;

    letter-spacing: -2.7px;
  }


  .configurator-preview {
    min-height: 390px;
  }


  .preview-stage {
    min-height: 270px;
  }


  .mat-preview {
    width: 88%;
  }


  .size-fields {
    grid-template-columns: 1fr;
  }


  .background-options {
    gap: 6px;
  }

}
/* =========================================================
   CONFIGURATORE — DESKTOP ULTRA COMPATTO
   ========================================================= */

@media (min-width: 1051px) {

  .configurator-heading {
    max-width: 950px;

    margin:
      0 auto
      42px;
  }


  .configurator-title-row h2 {
    font-size: clamp(48px, 4.5vw, 68px);

    letter-spacing: -3.5px;
  }


  .configurator-title-row p {
    max-width: 300px;

    font-size: 13px;
  }


  .configurator-app {
    max-width: 950px;

    grid-template-columns:
      minmax(0, 1.2fr)
      360px;

    border-radius: 16px;
  }


  /* =========================
     PREVIEW
     ========================= */

  .configurator-preview {
    min-height: 470px;

    padding:
      22px
      30px;
  }


  .preview-stage {
    min-height: 315px;

    padding:
      25px
      10px;
  }


  .mat-preview {
    width: min(68%, 360px);
  }


  .logo-preview {
    font-size: 18px;
  }


  .preview-bottom {
    padding-top: 13px;
  }


  .preview-bottom p {
    max-width: 210px;

    font-size: 8px;
  }


  /* =========================
     CONTROLLI
     ========================= */

  .configurator-controls {
    padding:
      22px
      28px;
  }


  .controls-heading {
    padding-bottom: 16px;
  }


  .controls-heading p {
    margin-top: 5px;

    font-size: 10px;
  }


  .config-block {
    padding:
      16px
      0;

    grid-template-columns:
      27px
      1fr;

    gap: 9px;
  }


  .config-label {
    margin-bottom: 10px;
  }


  .config-label h3 {
    font-size: 15px;
  }


  /* =========================
     DIMENSIONI
     ========================= */

  .number-input {
    height: 38px;
  }


  /* =========================
     COLORI
     ========================= */

  .background-option {
    min-height: 33px;

    padding:
      0
      9px;

    font-size: 8px;
  }


  .background-option > span {
    width: 13px;
    height: 13px;
  }


  /* =========================
     UPLOAD
     ========================= */

  .upload-button {
    min-height: 48px;

    padding:
      7px
      10px;
  }


  .upload-plus {
    width: 28px;
    height: 28px;

    font-size: 15px;
  }


  /* =========================
     PREZZO
     ========================= */

  .config-summary {
    padding-top: 16px;
  }


  .config-price strong {
    font-size: 22px;
  }


  .price-note {
    margin-top: 9px;

    font-size: 7px;
  }


  .config-continue {
    height: 43px;

    margin-top: 11px;
  }

}
/* =========================================================
   CONFIGURATORE — ALTRI COLORI A TENDINA
   ========================================================= */

.colors-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  margin-top: 10px;
  padding: 0;

  border: 0;
  background: transparent;

  color: var(--blue);

  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;

  cursor: pointer;
}


.colors-toggle-plus {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 17px;
  height: 17px;

  border: 1px solid rgba(7, 73, 132, 0.25);
  border-radius: 50%;

  font-size: 14px;
  font-weight: 400;
  line-height: 1;

  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}


.colors-toggle:hover .colors-toggle-plus {
  background: rgba(7, 73, 132, 0.06);
}


/* =========================================================
   CONTENITORE NASCOSTO
   ========================================================= */

.colors-extra {
  display: grid;

  grid-template-rows: 0fr;

  opacity: 0;

  margin-top: 0;

  transition:
    grid-template-rows 0.4s ease,
    opacity 0.3s ease,
    margin-top 0.4s ease;
}


.colors-extra > .background-options {
  overflow: hidden;
}


/* =========================================================
   STATO APERTO
   ========================================================= */

.colors-extra.is-open {
  grid-template-rows: 1fr;

  opacity: 1;

  margin-top: 12px;
}


.colors-toggle[aria-expanded="true"]
.colors-toggle-plus {
  transform: rotate(45deg);
}


/* =========================================================
   COLORI SECONDARI
   ========================================================= */

.background-options-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}


/* =========================================================
   COLORI PRINCIPALI
   ========================================================= */

.background-options-main {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
/* =========================================================
   CONFIGURATORE — RIDUZIONE SPAZI VUOTI DESKTOP
   ========================================================= */

@media (min-width: 1051px) {

  .configurator-preview {
    min-height: 0;
    height: auto;

    padding:
      22px
      30px
      18px;

    display: flex;
    flex-direction: column;
  }


  .preview-top {
    flex: 0 0 auto;
  }


  .preview-stage {
    flex: 0 0 auto;

    min-height: 0;
    height: 330px;

    padding:
      18px
      10px
      12px;

    display: flex;
    align-items: center;
    justify-content: center;
  }


  .mat-preview {
    max-width: 430px;
  }


  .preview-bottom {
    flex: 0 0 auto;

    margin-top: 0;
    padding-top: 13px;
  }

}


  /* Zona centrale del tappeto */

 .preview-stage {
  min-height: 330px;
  height: auto;

  padding:
    20px
    10px;

  display: flex;
  align-items: center;
  justify-content: center;
}

  /* Manteniamo il tappeto ben presente */

  .mat-preview {
    max-width: 390px;
  }


  /* Parte inferiore più vicina */

  .preview-bottom {
    margin-top: 0;
    padding-top: 12px;
  }


  /* Anche il pannello destro segue l'altezza */

  .configurator-controls {
    min-height: 0;
  }

/* =========================================================
   CONFIGURATORE — COMPRESSIONE VERTICALE FINALE
   ========================================================= */

@media (min-width: 1051px) {

  /* =========================
     COLONNA DESTRA
     ========================= */

  .configurator-controls {
    padding:
      20px
      28px
      18px;
  }


  /* Titolo PERSONALIZZA */

  .controls-heading {
    padding-bottom: 13px;
  }

  .controls-heading p {
    margin-top: 3px;
  }


  /* =========================
     BLOCCHI
     ========================= */

  .config-block {
    padding:
      13px
      0;

    gap: 8px;
  }

  .config-label {
    margin-bottom: 8px;
  }


  /* =========================
     DIMENSIONI
     ========================= */

  .number-input {
    height: 36px;
  }


  /* =========================
     COLORI
     ========================= */

  .background-options-main {
    gap: 6px;
  }

  .background-option {
    min-height: 31px;

    padding:
      0
      8px;
  }

  .colors-toggle {
    margin-top: 7px;
  }


  /* =========================
     UPLOAD LOGO
     ========================= */

  .upload-button {
    min-height: 45px;
  }


  /* =========================
     RIEPILOGO / PREZZO
     ========================= */

  .config-summary {
    padding-top: 12px;
  }

  .price-note {
    margin-top: 5px;
  }

  .config-continue {
    height: 41px;

    margin-top: 8px;
  }


  /* =========================
     PREVIEW SINISTRA
     ========================= */

  .configurator-preview {
    padding:
      20px
      30px
      18px;
  }

  .preview-stage {
    height: 305px;

    padding:
      10px;
  }

  .mat-preview {
    max-width: 410px;
  }

  .preview-bottom {
    margin-top: 0;

    padding-top: 11px;
  }

}
@media (min-width: 1051px) {

  .configurator-preview {
    display: flex;
    flex-direction: column;
  }

  .preview-top {
    flex: 0 0 auto;
  }

  .preview-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 300px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 15px 10px;
  }

  .preview-bottom {
    flex: 0 0 auto;

    margin-top: auto;
    padding-top: 12px;
  }

}