/* ════════════════════════════════════════════════════════════════
   BERJÓ — Cookie Consent
   Brand: verde #1E4D2B / lime #CCFF00 / #C8E61D
   ════════════════════════════════════════════════════════════════ */

.berjo-cc-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 980px;
  margin: 0 auto;
  z-index: 999990;
  background: #fff;
  color: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 22px 26px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 360ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease;
  border: 1px solid rgba(30, 77, 43, 0.08);
}
.berjo-cc-banner.berjo-cc-show { transform: translateY(0); opacity: 1; }

.berjo-cc-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.berjo-cc-close:hover { background: #f4f4f4; color: #1E4D2B; }

.berjo-cc-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.berjo-cc-text { flex: 1 1 320px; }
.berjo-cc-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #1E4D2B;
  font-family: 'Poppins', 'Inter', sans-serif;
}
.berjo-cc-body { margin: 0; color: #333; }
.berjo-cc-body a {
  color: #1E4D2B;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.berjo-cc-body a:hover { color: #0e3018; }

.berjo-cc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.berjo-cc-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
}
.berjo-cc-btn:active { transform: translateY(1px); }

.berjo-cc-btn-primary {
  background: #1E4D2B;
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 77, 43, 0.25);
}
.berjo-cc-btn-primary:hover {
  background: #0e3018;
  box-shadow: 0 6px 18px rgba(30, 77, 43, 0.35);
}

.berjo-cc-btn-secondary {
  background: transparent;
  color: #1E4D2B;
  border: 1.5px solid #1E4D2B;
}
.berjo-cc-btn-secondary:hover {
  background: #1E4D2B;
  color: #fff;
}

/* Link-style: usato per "Personalizza" (ridotto, non distrae da Accetta/Rifiuta) */
.berjo-cc-btn-link {
  background: transparent;
  color: #1E4D2B;
  border: none;
  padding: 10px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.berjo-cc-btn-link:hover { color: #0e3018; }

/* Focus visible per accessibilità (tastiera) */
.berjo-cc-btn:focus-visible,
.berjo-cc-toggle:focus-visible,
.berjo-cc-close:focus-visible,
.berjo-cc-modal-close:focus-visible,
.berjo-cc-fab:focus-visible {
  outline: 3px solid #C8E61D;
  outline-offset: 2px;
}

/* ─── Modal ────────────────────────────────────────────────── */
.berjo-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 999991;
  background: rgba(15, 30, 20, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: 'Inter', -apple-system, sans-serif;
  opacity: 0;
  transition: opacity 220ms ease;
}
.berjo-cc-modal.berjo-cc-show { display: flex; opacity: 1; }

.berjo-cc-modal-card {
  background: #fff;
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px 32px 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.berjo-cc-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}
.berjo-cc-modal-close:hover { background: #f4f4f4; color: #1E4D2B; }

.berjo-cc-modal-card h3 {
  margin: 0 0 12px;
  color: #1E4D2B;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.berjo-cc-modal-intro {
  margin: 0 0 22px;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.berjo-cc-categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}
.berjo-cc-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #f8faf6;
  border: 1px solid #e6ede7;
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.berjo-cc-cat:hover:not(.berjo-cc-cat-disabled) {
  border-color: #1E4D2B;
  background: #f0f5ee;
}
.berjo-cc-cat-text { flex: 1; min-width: 0; }
.berjo-cc-cat-disabled { opacity: 0.85; }
.berjo-cc-cat strong {
  display: block;
  color: #1E4D2B;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.berjo-cc-cat p {
  margin: 0;
  color: #666;
  font-size: 12.5px;
  line-height: 1.5;
}

.berjo-cc-toggle {
  flex-shrink: 0;
  display: inline-block;
  width: 42px;
  height: 24px;
  background: #ccc;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  /* reset button defaults — toggle è un <button role="switch"> */
  border: 0;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.berjo-cc-toggle[disabled] { cursor: default; }
.berjo-cc-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.berjo-cc-toggle-on { background: #1E4D2B; }
.berjo-cc-toggle-on::after { transform: translateX(18px); }

.berjo-cc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ─── Floating button (post-consent) ───────────────────────── */
.berjo-cc-fab {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 999989;
  background: #fff;
  color: #1E4D2B;
  border: 1.5px solid #1E4D2B;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.berjo-cc-fab:hover {
  background: #1E4D2B;
  color: #fff;
  transform: translateY(-2px);
}

/* RTL (arabo) */
[dir="rtl"] .berjo-cc-close { right: auto; left: 12px; }
[dir="rtl"] .berjo-cc-modal-close { right: auto; left: 16px; }
[dir="rtl"] .berjo-cc-fab { left: auto; right: 18px; }
[dir="rtl"] .berjo-cc-toggle::after { left: auto; right: 3px; transition: transform 0.2s; }
[dir="rtl"] .berjo-cc-toggle-on::after { transform: translateX(-18px); }

/* Responsive */
@media (max-width: 640px) {
  .berjo-cc-banner {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 18px 18px 16px;
    font-size: 13.5px;
  }
  .berjo-cc-title { font-size: 15px; }
  .berjo-cc-actions {
    width: 100%;
    flex-direction: column-reverse;
  }
  .berjo-cc-btn { width: 100%; padding: 12px 18px; }
  .berjo-cc-modal-card { padding: 26px 22px 20px; }
  .berjo-cc-modal-actions {
    width: 100%;
    flex-direction: column-reverse;
  }
  .berjo-cc-modal-actions .berjo-cc-btn { width: 100%; }
}
