/*
 * CookinBreak : fenêtre « Partager » (app/views/partials/share_sheet.php, static/js/ds/share-sheet.js).
 * Même présentation que celle des recettes : fenêtre arrondie et centrée, pastilles rondes de couleur, champ de copie ;
 * feuille du bas sur mobile. Préfixe cbs-. Tout lit les tokens (mode sombre automatique).
 */
.cbs {
  position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity 280ms var(--ds-ease, ease);
}
.cbs[hidden] { display: none; }
.cbs.is-open { opacity: 1; }
.cbs *, .cbs *::before, .cbs *::after { box-sizing: border-box; }

.cbs__panel {
  position: relative; display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 550px; padding: 30px;
  border-radius: var(--ds-radius-lg, 30px); background: var(--ds-surface, #fff); color: var(--ds-text, #1f2933);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3); font-family: var(--ds-font-body, inherit);
  transform: scale(0.95); transition: transform 320ms var(--ds-ease, cubic-bezier(0.19, 1, 0.22, 1));
}
.cbs.is-open .cbs__panel { transform: none; }
.cbs__handle { display: none; }

.cbs__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cbs__title { margin: 0; font-family: var(--ds-font-display, inherit); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ds-primary-text, #006b76); }
.cbs__close {
  display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ds-surface-2, #f3f4f6); color: var(--ds-text-3, #6b7280); font-size: 1.1rem; cursor: pointer;
  transition: background 200ms var(--ds-ease, ease), color 200ms var(--ds-ease, ease);
}
.cbs__close:hover { background: var(--ds-primary-soft, #dcefec); color: var(--ds-primary-text, #006b76); }

.cbs__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 10px; justify-items: center; }
.cbs__item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; transition: transform 200ms var(--ds-ease, ease);
}
.cbs__item[hidden] { display: none; }
.cbs__item:hover { transform: translateY(-3px); }
.cbs__round {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; font-size: 1.6rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); transition: filter 200ms var(--ds-ease, ease);
}
.cbs__item:hover .cbs__round { filter: brightness(1.1); }
.cbs__label { font-size: 0.78rem; font-weight: 600; color: var(--ds-text, #1f2933); text-align: center; }
.cbs__round--native { background: var(--ds-surface-2, #f8fafc); border: 1px solid var(--ds-border, #e2e8f0); color: var(--ds-primary-text, #006b76); box-shadow: none; }
.cbs__round--wa { background: #25d366; }
.cbs__round--fb { background: #1877f2; }
.cbs__round--pin { background: #e60023; }
.cbs__round--x { background: #000; }
.cbs__round--mail { background: #9ca3af; }

.cbs__copy {
  display: flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--ds-border, #e2e8f0); border-radius: 999px;
  background: var(--ds-surface-2, #f8fafc);
}
.cbs__field { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding-left: 14px; color: var(--ds-text-3, #94a3b8); }
.cbs__field input {
  width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ds-text, #1f2933);
  font: inherit; font-size: 0.85rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap;
}
.cbs__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cbs__copybtn {
  flex: 0 0 auto; min-width: 96px; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ds-primary, #00828e); color: var(--ds-on-primary, #fff);
  font-family: var(--ds-font-display, inherit); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background 200ms var(--ds-ease, ease);
}
.cbs__copybtn:hover { background: var(--ds-primary-hover, #025f67); }
.cbs__copybtn.is-done { background: var(--ds-success, #10b981); }
.cbs__feedback { min-height: 0; margin: -12px 0 0; color: var(--ds-success, #2f8a55); font-size: 0.82rem; font-weight: 700; text-align: center; }
.cbs__feedback:empty { display: none; }
.cbs :focus-visible { outline: none; box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(0, 130, 142, 0.4)); }

@media (max-width: 640px) {
  .cbs { align-items: flex-end; padding: 0; }
  .cbs__panel {
    max-width: none; gap: 20px; padding: 28px 22px calc(34px + env(safe-area-inset-bottom, 0px));
    border-radius: 32px 32px 0 0; transform: translateY(100%);
  }
  .cbs.is-open .cbs__panel { transform: none; }
  .cbs__handle { display: block; width: 40px; height: 5px; margin: -14px auto -6px; border-radius: 10px; background: var(--ds-border-strong, #e2e8f0); }
  .cbs__round { width: 52px; height: 52px; font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cbs, .cbs__panel, .cbs__item { transition: none; }
}
