/* ═══════════════════════════════════════════════════════════════
   LP Unica — lp-vetro.css
   Classi allineate a index.html + lp-config.js (lp-chip, lp-chip-emoji, lp-pill)
   Font DM Sans: caricato in index.html (no @import qui)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --lp-color-primary: #059669;
  --lp-hero-bg: #059669;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* Body + shell: mobile-first, desktop centrato 480px */
body.lp-v4 {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: #111827;
  background: linear-gradient(180deg, #ecfdf5 0%, #f0f9ff 50%, #faf5ff 100%);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.lp-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 20px;
  width: 100%;
}

/* ── Header ── */
.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 14px;
}

.lp-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lp-logo {
  height: 34px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.lp-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lp-brand {
  display: none;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.lp-claim {
  font-size: 10px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  flex-shrink: 0;
}

.lp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: lp-pulse 2s ease-in-out infinite;
}

@keyframes lp-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ── Main ── */
.lp-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* ── Hero (mockup: gradient verde #059669, radius 18px, padding 22px, testo bianco) ── */
.lp-hero {
  position: relative;
  margin: 0;
  padding: 22px 20px;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  background: var(--lp-hero-bg);
  box-shadow: 0 8px 28px rgba(5, 150, 105, 0.22);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

.lp-hero-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

.lp-hero-title {
  position: relative;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  padding-right: 40px;
}

.lp-hero-desc {
  position: relative;
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  opacity: 0.92;
}

/* ── Categorie: una riga, flex nowrap ── */
.lp-categories {
  padding: 4px 0 0;
}

.lp-categories-label {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
}

.lp-categories-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid #e5e7eb;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.lp-arrow:hover:not(:disabled) {
  background: #fff;
  border-color: #d1d5db;
}

.lp-arrow:disabled,
.lp-arrow[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.lp-categories-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.lp-categories-viewport::-webkit-scrollbar {
  display: none;
}

.lp-categories-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 5px;
  width: max-content;
}

/* Pill chip: larghezza contenuto, niente compressione */
.lp-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  color: #374151;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.lp-chip:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.lp-chip.active {
  border: 2px solid var(--lp-color-primary);
  border-color: var(--lp-color-primary);
  background: rgba(0, 0, 0, 0.05);
  color: var(--lp-color-primary);
  box-shadow: 0 2px 12px rgba(5, 150, 105, 0.15);
}

.lp-chip-emoji {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Sotto-servizi ── */
.lp-subservices {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}

.lp-subservices.visible {
  display: flex !important;
  flex-wrap: wrap;
  animation: lp-fadeIn 0.3s ease;
}

@keyframes lp-fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lp-pill {
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.lp-pill:hover {
  border-color: var(--lp-color-primary);
}

.lp-pill.active {
  border-color: var(--lp-color-primary);
  background: rgba(0, 0, 0, 0.05);
  color: var(--lp-color-primary);
  font-weight: 600;
}

/* ── Chat wrapper: max 480px, radius 20px, glass (NON full-width oltre 480) ── */
.lp-chat {
  width: 100%;
  max-width: 480px;
  margin: 8px auto 0;
  padding: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.lp-chat #chatWidgetContainer {
  width: 100%;
  min-height: 320px;
  position: relative;
}

/* Widget gs-chat (classe reale: .gs-chat, id #gsChatWidget) */
.lp-chat #chatWidgetContainer .gs-chat {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 360px;
  max-height: none !important;
  margin: 0 !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.lp-chat #chatWidgetContainer .gs-chat__messages {
  max-height: 330px;
}

/* ── Footer (classi reali: .lp-footer-line) ── */
.lp-footer {
  padding: 16px 8px 12px;
  text-align: center;
}

.lp-footer-line {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: #9ca3af;
}

@media (min-width: 500px) {
  .lp-shell {
    padding-top: 16px;
    padding-bottom: 24px;
  }
}
