/**
 * Lettrage - front-office configurator block.
 *
 * Styling for the custom-text personalisation block rendered on the product
 * page (views/templates/hook/configurator.tpl). Only present when the product
 * is lettrage-enabled (see Lettrage::hookActionFrontControllerSetMedia).
 */

.lt-block {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  background: #fafafa;
  font-size: 0.95rem;
  position: relative;
}

.lt-block * {
  box-sizing: border-box;
}

/* Hidden working canvas (Fabric.js renders the lettering offscreen). */
.lt-canvas-hidden {
  display: none !important;
}

.lt-zone {
  margin-bottom: 18px;
}

.lt-zone-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: #222;
  text-transform: uppercase;
}

.lt-etape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #52656b;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 0 0 26px;
}

/* --- Text input --- */
.lt-input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.lt-texte {
  width: 100%;
  max-width: 420px;
}

/* --- Font selector --- */
.lt-font-select {
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
}

/* --- Colour swatches --- */
.lt-couleurs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lt-couleur {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.lt-couleur:hover {
  transform: scale(1.12);
}

.lt-couleur.is-selected {
  border-color: #52656b;
  box-shadow: 0 0 0 2px rgba(82, 101, 107, 0.35);
}

.lt-couleur-nom {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
}

/* --- Dimensions + mirror --- */
.lt-dim-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.lt-dim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lt-dim-label {
  font-size: 0.82rem;
  color: #555;
}

.lt-dim-field .lt-input {
  width: 130px;
}

.lt-dim-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
  padding-bottom: 6px;
}

.lt-dim-checkbox input {
  width: 16px;
  height: 16px;
}

/* --- Preview with cm dimension labels --- */
.lt-apercu-wrap {
  position: relative;
  border: 1px dashed #c5c5c5;
  border-radius: 6px;
  background: #fff
    repeating-linear-gradient(45deg, #f4f4f4 0, #f4f4f4 10px, #fff 10px, #fff 20px);
  padding: 34px 16px 16px 56px;
  overflow-x: auto;
  overflow-y: hidden;
}

#lt-apercu {
  text-align: center;
}

#lt-image {
  max-width: 100%;
  height: auto;
}

.lt-cote {
  position: absolute;
  font-size: 0.82rem;
  font-weight: 600;
  color: #52656b;
}

.lt-cote-largeur {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.lt-cote-largeur::before {
  content: "\2194\00a0";
}

.lt-cote-hauteur {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.lt-cote-hauteur::before {
  content: "\2195\00a0";
}

/* --- Price slot --- */
.lt-price-slot {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f6f6f6;
  border-radius: 6px;
  font-size: 16px;
}

.lt-price-slot:empty {
  display: none;
}

.lt-price-label {
  font-weight: 600;
}

.lt-price-value {
  font-weight: 700;
  font-size: 20px;
  color: #c0392b;
}

.lt-price-ht {
  color: #777;
  font-size: 13px;
}

/* --- Responsive --- */
@media (max-width: 560px) {
  .lt-block {
    padding: 14px 12px;
  }

  .lt-dim-field .lt-input {
    width: 100%;
  }
}

/* Live preview promoted into the product gallery (set by front.js relocate). */
.lt-apercu-in-gallery {
  display: block;
  width: 100%;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.lt-apercu-in-gallery #lt-image { max-width: 100%; height: auto; }
