/* ---- Layout generale ---- */
.lb-shell {
  display: flex;
  gap: 20px;
  font-family: inherit;
  color: inherit;
  flex-wrap: wrap;
}

/* Sidebar */
.lb-side {
  flex: 0 0 355px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lb-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* ---- Sezioni ---- */
.lb-section h3 {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #111;
}

.lb-meta {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
  color: #4b5563;
  font-family: 'Fira Sans', sans-serif;
}

/* ---- Swatches ---- */
.lb-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 6px;
}

.lb-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #000;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 1px;
}

.lb-swatch:hover {
  transform: scale(1.1);
}

.lb-swatch.is-active {
  border: 3px solid #000;
}

/* ---- Tabs categorie ---- */
.lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lb-tab {
  font-family: 'Fira Sans', sans-serif;
  font-weight: 400;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 9999px;
  border: 1px solid #000;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.lb-tab.is-active {
  background: #F7E730;
  border: 3px solid #000;
  font-weight: 700;
  color: #000;      
}

.lb-tab:hover {
  background: #F7E730;
}

/* ---- Logos ---- */
.lb-logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.lb-logo {
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  padding: 6px;
  box-sizing: border-box;
}

.lb-logo-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lb-logo-inner img,
.lb-logo-inner svg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lb-logo:hover {
  transform: scale(1.05);
  background-color: #F7E730;
}

.lb-logo.is-active {
  border: 3px solid #000;
  background-color: #F7E730;
}

/* ---- Input ---- */
.lb-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  margin-bottom: 6px;
  font-family: inherit;
}

.lb-input:focus {
  border-color: #30a1f7;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

/* ---- Toolbar ---- */
.lb-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: #4b5563;
  flex-wrap: wrap;
  gap: 6px;
}

.lb-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

/* ---- Preview (sempre sticky ed evidenziata durante lo scroll) ---- */
:root {
  --lb-sticky-offset: 12px; /* aumenta se il tema ha una header sticky, per evitare sovrapposizioni */
}

.lb-shell main.lb-card {
  position: sticky;
  top: var(--lb-sticky-offset);
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
}

/* Su desktop lo shell e' in riga: senza flex-start la card si stira
   in altezza quanto la sidebar, vanificando lo sticky */
@media (min-width: 1025px) {
  .lb-shell main.lb-card {
    align-self: flex-start;
  }
}

.lb-preview-wrap {
  width: 100%;
  max-width: 100%;
  background: #f9fafb;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage {
  width: 100% !important;
  height: auto !important;
  display: block;
  aspect-ratio: 45 / 20;
  max-width: 100%;
}

.lb-stage text {
  font-family: var(--lb-font), sans-serif !important;
}

/* ---- Fonts ---- */
.lb-fonts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  color: #000;
}

.lb-font-tab {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #000;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  color: #000;
}

.lb-font-tab.is-active {
  background: #F7E730;
  border: 3px solid #000;
  font-weight: 700;
  color:#000;
}

.lb-font-tab:hover {
  background: #F7E730;
  color: #000;
}

/* ---- Buy box ---- */
.lb-buy-box {
  margin-top: 15px;
  text-align: center;
}

.lb-buy-box .lb-price {
  font-family: "Fira Sans", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #111;
}

.lb-buy-box .lb-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 12px;
  color: #000;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.lb-buy-box .lb-btn:hover {
  background: #000;
  color:#F7E730
}





/* =======================
   RESPONSIVE ADJUSTMENTS
   ======================= */

/* Tablet e sotto (≤ 1024px) */
@media (max-width: 1024px) {
  .lb-shell {
    flex-direction: column;
  }

  .lb-side {
    flex: unset;
    width: 100%;
    order: 2;
  }

  .lb-card {
    padding: 14px;
  }

  .lb-preview-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .lb-preview-wrap {
    padding: 14px;
  }
}

/* Smartphone (≤ 640px) */
@media (max-width: 640px) {
  .lb-shell {
    gap: 12px;
  }

  .lb-section h3 {
    font-size: 13px;
  }

  .lb-tab {
    padding: 5px 10px;
    font-size: 12px;
  }

  .lb-swatch {
    width: 34px;
    height: 34px;
  }

  .lb-logos {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
  }

  .lb-logo {
    border-radius: 10px;
    padding: 4px;
  }

  .lb-input {
    font-size: 13px;
    padding: 7px 9px;
  }

  .lb-btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
  }

  .lb-preview-toolbar {
    font-size: 12px;
  }

  .lb-preview-wrap {
    padding: 10px;
  }
}