/* Bundled editor fonts (unique families — never collide with Android system fonts). */
@font-face {
  font-family: "LembFontBlack";
  src: url("fonts/archivo-black.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontSans";
  src: url("fonts/arimo-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontHelv";
  src: url("fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontSerif";
  src: url("fonts/libre-baskerville-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontMono";
  src: url("fonts/roboto-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontComic";
  src: url("fonts/comic-neue-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LembFontImpact";
  src: url("fonts/anton-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

#lemb-stickers-configurator {
  margin: 1.25rem 0 1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f7f7f7;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#lemb-stickers-configurator *,
#lemb-stickers-configurator *::before,
#lemb-stickers-configurator *::after {
  box-sizing: border-box;
}

#lemb-stickers-configurator h3 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
}

/* Colonne produit étroite : Composition / Thème pleine largeur, Prénom+Nom en duo */
#lemb-stickers-configurator .lemb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  min-width: 0;
}

@media (min-width: 480px) {
  #lemb-stickers-configurator .lemb-grid {
    grid-template-columns: 1fr 1fr;
  }

  #lemb-stickers-configurator .lemb-field-pack,
  #lemb-stickers-configurator .lemb-field-theme {
    grid-column: 1 / -1;
  }

  #lemb-stickers-configurator.lemb-single-theme .lemb-field-pack {
    grid-column: 1 / -1;
  }
}

#lemb-stickers-configurator .lemb-field-hint,
#lemb-stickers-configurator .lemb-theme-price-hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.3;
}

#lemb-stickers-configurator .lemb-theme-price-hint {
  margin: 0;
  color: #1a1a1a;
  font-weight: 600;
}

#lemb-stickers-configurator label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
  max-width: 100%;
}

#lemb-stickers-configurator select,
#lemb-stickers-configurator input[type="text"] {
  font-weight: 400;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Product gallery = theme examples (left column) */
.lemb-theme-gallery {
  display: block !important;
  margin: 0 0 1.5rem;
  width: 100%;
  max-width: 100%;
  float: none !important;
}

.lemb-theme-gallery__main {
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e2e2;
}

.lemb-theme-gallery__main img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 720px);
  object-fit: contain;
  background: #ebebeb;
}

.lemb-theme-gallery__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  background: #fff;
}

.lemb-theme-gallery__hint {
  color: #777;
  font-size: 0.82rem;
}

.lemb-theme-gallery__thumbs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (min-width: 600px) {
  .lemb-theme-gallery__thumbs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.lemb-theme-gallery__thumb {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.15;
  color: #333;
  min-width: 0;
}

.lemb-theme-gallery__thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: #eee;
}

.lemb-theme-gallery__thumb.is-active,
.lemb-theme-gallery__thumb:hover {
  border-color: #222;
}

.lemb-theme-gallery__thumb span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full-width personalized preview */
#lemb-stickers-preview {
  clear: both;
  width: 100%;
  max-width: 1100px;
  margin: 1.5rem auto 2rem;
  padding: 1.1rem 1.2rem 1.4rem;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f7f7f7;
  box-sizing: border-box;
}

#lemb-stickers-preview .lemb-personal-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #222;
  color: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

#lemb-stickers-preview .lemb-preview-panel h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

#lemb-stickers-preview .lemb-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: #555;
}

#lemb-stickers-preview .lemb-canvas-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #cfcfcf;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

#lemb-stickers-preview canvas {
  /* Cap display width so 300dpi (2232px) isn't crushed to mush on narrow columns */
  width: min(100%, 920px) !important;
  height: auto !important;
  min-height: 0;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  background: #d8d8d8;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

#lemb-stickers-preview .lemb-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: #555;
}

#lemb-stickers-preview .lemb-audience {
  text-transform: capitalize;
}

/* —— Custom editor —— */
/* Botiga puts after_summary content into the product grid — force full row. */
.woocommerce div.product .lemb-custom-studio,
.woocommerce div.product #lemb-stickers-preview,
body.single-product div.product .lemb-custom-studio,
body.single-product div.product #lemb-stickers-preview {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
  clear: both !important;
  box-sizing: border-box;
}

.lemb-custom-studio {
  padding: 1.25rem 1rem 0;
}

.lemb-custom-sidebar-hint {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #333;
}

#lemb-stickers-configurator.lemb-mode-custom {
  margin: 0 0 1.25rem;
  max-width: none;
}

#lemb-stickers-configurator.lemb-mode-custom .lemb-custom-intro {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: #555;
  font-weight: 400;
}

#lemb-stickers-configurator [hidden],
#lemb-stickers-configurator [data-custom-text-wrap][hidden],
#lemb-stickers-configurator .lemb-is-hidden,
#lemb-stickers-configurator label.lemb-is-hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#lemb-stickers-preview {
  padding-left: 1rem;
  padding-right: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

body.single-product:has(.lemb-mode-custom) #lemb-stickers-preview {
  margin-top: 0;
}

@media (min-width: 900px) {
  #lemb-stickers-configurator .lemb-custom-workspace {
    grid-template-columns: 1fr !important;
    gap: 1.1rem;
  }

  #lemb-stickers-configurator .lemb-custom-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
  }

  #lemb-stickers-configurator .lemb-custom-tools fieldset {
    margin-bottom: 0;
  }
}

#lemb-stickers-configurator .lemb-custom-editor {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#lemb-stickers-configurator .lemb-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#lemb-stickers-configurator .lemb-type-tabs button,
#lemb-stickers-configurator .lemb-variant-list button {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

#lemb-stickers-configurator .lemb-type-tabs button.is-active,
#lemb-stickers-configurator .lemb-variant-list button.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

#lemb-stickers-configurator .lemb-variant-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

#lemb-stickers-configurator .lemb-variant-label {
  font-weight: 600;
  font-size: 0.85rem;
}

#lemb-stickers-configurator .lemb-variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

#lemb-stickers-configurator .lemb-custom-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  #lemb-stickers-configurator .lemb-custom-workspace {
    grid-template-columns: 1fr;
  }
}

#lemb-stickers-configurator .lemb-custom-preview-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 360px;
}

#lemb-stickers-configurator .lemb-custom-preview-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 360px;
  height: auto;
  border-radius: 10px;
  background: #e8e8e8;
  border: 1px solid #ddd;
  touch-action: none;
  cursor: grab;
  /* Avoid browser "optimizing" a crisp bitmap into mush */
  image-rendering: auto;
}

#lemb-stickers-configurator .lemb-custom-tools fieldset {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.85rem;
  margin: 0 0 0.65rem;
  background: #fff;
}

#lemb-stickers-configurator .lemb-custom-tools legend {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 0.25rem;
}

#lemb-stickers-configurator .lemb-custom-tools label {
  margin-top: 0.45rem;
}

#lemb-stickers-configurator .lemb-custom-tools input[type="color"] {
  width: 100%;
  height: 2.2rem;
  padding: 0.15rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

#lemb-stickers-configurator .lemb-color-heading {
  margin: 0.45rem 0 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}

#lemb-stickers-configurator .lemb-color-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

#lemb-stickers-configurator .lemb-color-picker-wrap,
#lemb-stickers-configurator .lemb-hex-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0 !important;
}

#lemb-stickers-configurator .lemb-color-picker-wrap span,
#lemb-stickers-configurator .lemb-hex-field span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

#lemb-stickers-configurator .lemb-custom-tools .lemb-color-picker-wrap input[type="color"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 4.6rem !important;
  min-width: 4.6rem;
  height: 3.1rem !important;
  padding: 0.12rem !important;
  border: 2px solid #212121 !important;
  border-radius: 10px;
  background: #fff !important;
  cursor: pointer;
}

#lemb-stickers-configurator .lemb-hex-field input[type="text"] {
  width: 7.2rem;
  min-height: 3.1rem;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: #fff;
}

#lemb-stickers-configurator .lemb-swatch-title {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

#lemb-stickers-configurator .lemb-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.85rem, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.45rem;
}

#lemb-stickers-configurator .lemb-swatches-text {
  grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr));
}

#lemb-stickers-configurator .lemb-swatch {
  width: 100%;
  aspect-ratio: 1;
  min-height: 2.85rem;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  -webkit-tap-highlight-color: transparent;
}

#lemb-stickers-configurator .lemb-swatch.is-light {
  border-color: rgba(0, 0, 0, 0.38);
}

#lemb-stickers-configurator .lemb-swatch.is-active {
  outline: 3px solid #212121;
  outline-offset: 2px;
  border-color: #212121;
}

#lemb-stickers-configurator .lemb-swatch:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  #lemb-stickers-configurator .lemb-swatches {
    grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr));
    gap: 0.55rem;
  }
  #lemb-stickers-configurator .lemb-swatch {
    min-height: 3.1rem;
    border-radius: 12px;
  }
}

#lemb-stickers-configurator .lemb-custom-tools input[type="range"] {
  width: 100%;
}

#lemb-stickers-configurator .lemb-custom-tools textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

#lemb-stickers-configurator .lemb-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
  align-items: center;
}

#lemb-stickers-configurator .lemb-bg-image-row {
  margin-top: 0.65rem;
}

#lemb-stickers-configurator .lemb-bg-apply-row {
  margin-top: 0.5rem;
}

#lemb-stickers-configurator .lemb-bg-apply-row .button {
  flex: 1 1 10rem;
  min-height: 40px;
  font-weight: 600;
}

#lemb-stickers-configurator .lemb-upload-btn,
#lemb-stickers-configurator button.lemb-upload-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #212121 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 44px;
}

#lemb-stickers-configurator .lemb-library-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#lemb-stickers-configurator .lemb-library-modal[hidden] {
  display: none !important;
}

#lemb-stickers-configurator .lemb-library-dialog {
  background: #fff;
  border-radius: 14px;
  width: min(920px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

#lemb-stickers-configurator .lemb-library-head,
#lemb-stickers-configurator .lemb-library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

#lemb-stickers-configurator .lemb-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
}

#lemb-stickers-configurator .lemb-library-item {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0.25rem;
  background: #f6f6f6;
  cursor: pointer;
}

#lemb-stickers-configurator .lemb-library-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

