/* Basic styling */
.nexo-cm-root { position: fixed; left: 0; right: 0; z-index: 99999; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.nexo-cm-root[data-position="top"] { top: 0; }
.nexo-cm-root[data-position="bottom"] { bottom: 0; }
.nexo-cm-banner { background: #101828; color: #fff; padding: 14px 16px; display: none; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.nexo-cm-banner__inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.nexo-cm-banner__text { flex: 1; font-size: 14px; line-height: 1.4; }
.nexo-cm-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nexo-cm-btn { border: 0; padding: 10px 14px; cursor: pointer; border-radius: 6px; font-weight: 700; letter-spacing: .2px; }
.nexo-cm-btn--accept { background: #DB9B36; color: #101828; }
.nexo-cm-btn--deny { background: #e5e7eb; color: #111827; }
.nexo-cm-btn--prefs { background: #334155; color: #fff; }
.nexo-cm-btn--close { background: #0ea5e9; color: #042433; }
.nexo-cm-banner a { color: #93c5fd; text-decoration: underline; }

/* Preferences panel */
.nexo-cm-prefs { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 100000; }
.nexo-cm-prefs__sheet { position: absolute; right: 0; top: 0; bottom: 0; width: 420px; max-width: 100%; background: #fff; padding: 20px; overflow: auto; }
.nexo-cm-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; }
.nexo-cm-toggle { width: 46px; height: 26px; background: #e5e7eb; border-radius: 13px; position: relative; flex-shrink: 0; }
.nexo-cm-toggle input { display: none; }
.nexo-cm-toggle span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.nexo-cm-toggle input:checked + span { transform: translateX(20px); }

/* Legal modal */
.nexo-cm-legal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100001; }
.nexo-cm-legal[hidden] { display: none; }
.nexo-cm-legal__dialog { background: #fff; max-width: 720px; width: 90%; border-radius: 10px; padding: 16px; position: relative; }
.nexo-cm-legal__close { position: absolute; right: 10px; top: 10px; background: transparent; border: 0; font-size: 24px; cursor: pointer; }


.nexo-cm-legal__dialog {
  max-height: 80vh;   /* max 80% dell'altezza viewport */
  overflow-y: auto;   /* scroll verticale se il contenuto è più lungo */
  padding: 20px;
  box-sizing: border-box;
}

/* Evita che l'html interno sfori */
.nexo-cm-legal__content {
  overflow-wrap: break-word;
  line-height: 1.5;
}

/* Keep the site visible behind a compact, readable consent card on phones. */
@media (max-width: 600px) {
  .nexo-cm-root {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(16, 24, 40, .28);
    pointer-events: none;
  }

  .nexo-cm-banner {
    width: min(100%, 460px);
    max-height: 82svh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
    pointer-events: auto;
  }

  .nexo-cm-banner__inner {
    display: block;
    width: 100%;
  }

  .nexo-cm-banner__text {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .nexo-cm-banner__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nexo-cm-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 13px;
    white-space: normal;
  }
}
