/* ============================================================
   Personnalisation produit, refonte UX (CMULTIMEDIA 07/06/2026)
   Charge dans le child theme royal-elementor-kit-child
   ============================================================ */

/* ---- Polices auto-hébergées (RGPD : aucun appel Google) ---- */
@font-face { font-family:'Alegreya SC';    src:url('fonts/alegreya-sc.woff2') format('woff2');    font-display:swap; }
@font-face { font-family:'Amita';          src:url('fonts/amita.woff2') format('woff2');          font-display:swap; }
@font-face { font-family:'Caveat';         src:url('fonts/caveat.woff2') format('woff2');         font-display:swap; }
@font-face { font-family:'Dancing Script'; src:url('fonts/dancing-script.woff2') format('woff2'); font-display:swap; }
@font-face { font-family:'Life Savers';    src:url('fonts/life-savers.woff2') format('woff2');    font-display:swap; }
@font-face { font-family:'Lobster';        src:url('fonts/lobster.woff2') format('woff2');        font-display:swap; }
@font-face { font-family:'Alex Brush';     src:url('fonts/alex-brush.woff2') format('woff2');     font-display:swap; }
@font-face { font-family:'Arizonia';       src:url('fonts/arizonia.woff2') format('woff2');       font-display:swap; }
@font-face { font-family:'Great Vibes';    src:url('fonts/great-vibes.woff2') format('woff2');    font-display:swap; }

/* ---- Masquage des anciens elements ---- */
#yith-wapo-addon-41, /* image geante des 20 polices */
#yith-wapo-addon-18, /* pave "ecrivez AUCUN" */
#yith-wapo-addon-19  /* separateur du bloc pas-de-perso */ {
  display: none !important;
}

/* ---- Habillage carte de la zone personnalisation ---- */
.op-perso-card {
  background: #faf7f2;
  border: 1px solid #e8dfd2;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 18px 0;
}
.op-perso-card .op-perso-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
  color: #3a3a3a;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Interrupteur Avec / Sans gravure ---- */
.op-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
}
.op-toggle-label { font-size: 15px; color: #3a3a3a; font-weight: 500; }
button.op-switch, .op-switch {
  position: relative;
  width: 52px !important; height: 28px !important;
  min-width: 52px !important;
  flex: 0 0 52px;
  border-radius: 14px !important;
  background: #cfc6b8 !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background .25s;
  padding: 0 !important;
}
button.op-switch[aria-checked="true"], .op-switch[aria-checked="true"] { background: #c89b5a !important; }
.op-switch .op-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .25s;
}
.op-switch[aria-checked="true"] .op-knob { left: 27px; }
.op-toggle-hint { font-size: 13px; color: #8a8378; margin: 2px 0 0; }

/* ---- Selecteur de police visuel ---- */
.op-font-picker { position: relative; max-width: 420px; }
.op-font-current {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #d9cfc0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 20px;
  line-height: 1.3;
  color: #3a3a3a;
  cursor: pointer;
  text-align: left;
}
.op-font-current:focus { outline: 2px solid #c89b5a; outline-offset: 1px; }
.op-font-current .op-caret {
  flex: 0 0 auto;
  border: solid #9a9183;
  border-width: 0 2px 2px 0;
  padding: 4px;
  transform: rotate(45deg);
  margin-top: -4px;
}
.op-font-list {
  position: absolute;
  z-index: 999;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d9cfc0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  margin: 0; padding: 6px;
  list-style: none;
  display: none;
}
.op-font-picker.open .op-font-list { display: block; }
.op-font-list li {
  padding: 9px 12px;
  font-size: 21px;
  line-height: 1.35;
  border-radius: 8px;
  cursor: pointer;
  color: #3a3a3a;
}
.op-font-list li:hover, .op-font-list li.active { background: #f5ead9; }
.op-font-list li .op-font-name { font-size: 12px; color: #9a9183; display: block; font-family: inherit; }

/* ---- Apercu en direct ---- */
.op-preview {
  margin-top: 16px;
  background: #fff;
  border: 1px dashed #d2b88a;
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}
.op-preview .op-preview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b09467;
  margin-bottom: 6px;
}
.op-preview .op-preview-text {
  font-size: 30px;
  line-height: 1.35;
  color: #2f2a24;
  word-break: break-word;
  min-height: 40px;
}
.op-preview .op-preview-text .op-line { display: block; }
.op-preview .op-preview-text.placeholder { color: #c9c0b2; font-size: 22px; }

/* ---- Compteur de caracteres ---- */
.op-charcount {
  font-size: 12px;
  color: #9a9183;
  text-align: right;
  margin-top: 4px;
}
.op-charcount.warn { color: #c0392b; }

/* ---- Nettoyage visuel des champs YITH ---- */
.yith-wapo-addon-type-text input.yith-wapo-option-value,
.yith-wapo-addon-type-textarea textarea.yith-wapo-option-value {
  border: 1px solid #d9cfc0 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 16px !important;
  background: #fff !important;
}
.yith-wapo-addon-type-textarea textarea.yith-wapo-option-value { min-height: 90px; }

/* ---- Intro courte + accordeon "En savoir plus" ---- */
.op-intro { font-size: 14.5px; color: #5d564b; margin: 4px 0 8px; }
details.op-more { margin: 0 0 10px; }
details.op-more summary {
  font-size: 13px;
  color: #b09467;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  list-style: none;
}
details.op-more summary::-webkit-details-marker { display: none; }
details.op-more[open] summary { color: #8a7142; }
details.op-more p { font-size: 13.5px; color: #6d6557; margin: 8px 0 0; }

/* etat replie quand "sans gravure" */
.op-perso-hidden { display: none !important; }

/* ---- Habillage des groupes OP Personnalisation ---- */
.op-perso-group {
  background: #faf7f2;
  border: 1px solid #e8dfd2;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0;
}
.op-perso-group .op-group-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px;
  color: #3a3a3a;
}
/* le titre du groupe Police fait doublon avec le libelle du champ */
#op-group-2 .op-group-title { display: none; }
.op-field-wrap { margin: 10px 0; }
.op-field-wrap label { font-weight: 500; color: #3a3a3a; }
.op-field-input, .op-field-select {
  border: 1px solid #d9cfc0 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  background: #fff !important;
}

/* ---- Upload de design : zone et apercu ---- */
.op-field-type-file_upload input[type="file"] {
  width: 100%;
  padding: 22px 14px;
  border: 2px dashed #d2b88a;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.op-upload-preview {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e8dfd2;
  border-radius: 10px;
  padding: 10px 14px;
}
.op-upload-preview img {
  max-width: 110px;
  max-height: 110px;
  border-radius: 8px;
  /* effet sticker decoupe a la forme */
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 1px 4px rgba(0,0,0,.25));
}
.op-upload-preview .op-upload-name { font-size: 13px; color: #5d564b; word-break: break-all; }

/* ---- Total dynamique des options ---- */
.op-total-box {
  margin-top: 14px;
  text-align: right;
  font-size: 16px;
  color: #3a3a3a;
  background: #fff;
  border: 1px solid #e8dfd2;
  border-radius: 10px;
  padding: 10px 16px;
}
.op-total-box strong { color: #8a7142; }
