/* Journey A cookie banner (5 Nov 2026). Loaded only when JOURNEY_A (sections/footer-scripts.twig), after
   css/consent-manager.min.css, so B and live keep today's navy and yellow banner.
   The banner is our own copy of Silktide's consent manager (js/consent-manager.js builds the markup,
   js/d2f-consent-manager.js holds the wording); nothing here changes the markup, the wording or what the
   buttons do, only how it looks.
   - Phones (under 600px): a slim white sheet along the bottom; Accept all and Reject all side by side, the same
     size and colour (consent rules: rejecting must be as easy as accepting); Manage preferences as a link under them.
   - 600px and up: a small white card in the bottom LEFT corner, so it never sits under the round Aa
     (bottom right; js/text-size-2026.js only lifts the Aa when something really is under it).
   - The preferences pop-up and the round cookie button get the same white / ink look. */

#d2f-wrapper {
  --focus: 0 0 0 2px #ffffff, 0 0 0 4px #23233d;
  --fontFamily: var(--d2f-font, "Rethink Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  --primaryColor: #23233d;
  --backgroundColor: #ffffff;
  --textColor: #23233d;
  --backdropBackgroundColor: rgba(35, 35, 61, 0.45);
  --cookieIconColor: #ffffff;
  --cookieIconBackgroundColor: #23233d;
  --a26ck-ink: #23233d;
  --a26ck-ink-h: #3b3b5c;
  --a26ck-line: #dcdce3;
  --a26ck-euc: #4d6458;
}

/* ---------- Banner ---------- */
#d2f-wrapper #d2f-banner {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  padding: 16px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  color: var(--a26ck-ink);
  border-top: 1px solid var(--a26ck-line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(35, 35, 61, 0.14);
  transform: none;
  animation: a26ck-up 260ms ease-out 0.3s forwards;
}

#d2f-wrapper #d2f-banner p,
#d2f-wrapper #d2f-banner #cookie-consent-text {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
  color: var(--a26ck-ink);
}

#d2f-wrapper #d2f-banner a {
  display: inline;
  color: var(--a26ck-ink);
  background: transparent;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#d2f-wrapper #d2f-banner a:hover { color: var(--a26ck-euc); }

#d2f-wrapper #d2f-banner .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-top: 12px;
}

#d2f-wrapper #d2f-banner:focus { outline: none; border-radius: 16px 16px 0 0; }
@media (min-width: 600px) { #d2f-wrapper #d2f-banner:focus { border-radius: 16px; } }

/* Accept all and Reject all: one look, side by side, same size */
#d2f-wrapper #d2f-banner .actions .st-button {
  flex: none;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--a26ck-ink);
  border-radius: 8px;
  background: var(--a26ck-ink);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
#d2f-wrapper #d2f-banner .actions .st-button:hover {
  background: var(--a26ck-ink-h);
  border-color: var(--a26ck-ink-h);
  color: #ffffff;
}

/* Manage preferences: a link, not a third big button */
#d2f-wrapper #d2f-banner .actions .manage-preferences {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--a26ck-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#d2f-wrapper #d2f-banner .actions .manage-preferences:hover {
  background: transparent;
  border: 0;
  color: var(--a26ck-euc);
}

#d2f-wrapper #d2f-banner a:focus,
#d2f-wrapper #d2f-banner button:focus { box-shadow: none; outline: none; }
#d2f-wrapper #d2f-banner a:focus-visible,
#d2f-wrapper #d2f-banner button:focus-visible {
  outline: 3px solid var(--a26ck-ink);
  outline-offset: 2px;
  border-radius: 8px;
}
#d2f-wrapper #d2f-banner .actions .st-button:focus-visible { box-shadow: inset 0 0 0 2px #ffffff; }

/* 600px and up: a card in the bottom left corner */
@media (min-width: 600px) {
  #d2f-wrapper #d2f-banner,
  #d2f-wrapper #d2f-banner.bottomCenter {
    left: 16px;
    right: auto;
    bottom: 16px;
    width: min(560px, calc(100% - 32px));
    padding: 20px;
    border: 1px solid var(--a26ck-line);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(35, 35, 61, 0.18);
    transform: none;
    animation: a26ck-up 260ms ease-out 0.3s forwards;
  }
  #d2f-wrapper #d2f-banner .actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
  }
  #d2f-wrapper #d2f-banner .actions .st-button { min-width: 132px; }
  #d2f-wrapper #d2f-banner .actions .manage-preferences { margin-left: auto; justify-self: auto; }
}

@keyframes a26ck-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #d2f-wrapper #d2f-banner,
  #d2f-wrapper #d2f-banner.bottomCenter,
  #d2f-wrapper #d2f-modal { animation: none; opacity: 1; transform: none; }
  #d2f-wrapper #d2f-modal { transform: none; }
}

/* ---------- Preferences pop-up ---------- */
#d2f-wrapper #d2f-modal {
  width: 640px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  padding: 24px;
  background: #ffffff;
  color: var(--a26ck-ink);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(35, 35, 61, 0.24);
}
#d2f-wrapper #d2f-modal header p { color: var(--a26ck-ink); font-size: 22px; line-height: 28px; }
#d2f-wrapper #d2f-modal p,
#d2f-wrapper #d2f-modal legend { color: var(--a26ck-ink); }
#d2f-wrapper #d2f-modal .cookie-type-description p { color: #4a4a63; font-size: 15px; line-height: 22px; }
/* no divider line: a fieldset draws its top border through the middle of its legend (it read as crossed-out text on phones) */
#d2f-wrapper #d2f-modal fieldset { margin-bottom: 24px; padding: 0; border: 0; }
#d2f-wrapper #d2f-modal legend { font-size: 17px; line-height: 24px; }
#d2f-wrapper #d2f-modal .modal-close {
  width: 44px; height: 44px; padding: 0; justify-content: center; align-items: center;
  background: transparent; border-radius: 8px;
}
#d2f-wrapper #d2f-modal .modal-close svg { width: 16px; height: 16px; fill: var(--a26ck-ink); }
#d2f-wrapper #d2f-modal .modal-close:hover { background: #f1f1f4; }
#d2f-wrapper #d2f-modal section::-webkit-scrollbar-thumb { background-color: #b8b8c4; }

/* switches: grey when off, eucalyptus when on */
#d2f-wrapper #d2f-modal .switch__pill { background: #c9c9d3; }
#d2f-wrapper #d2f-modal .switch__dot { background: #ffffff; box-shadow: 0 1px 3px rgba(35, 35, 61, 0.3); }
#d2f-wrapper #d2f-modal .switch__off { color: var(--a26ck-ink); }
#d2f-wrapper #d2f-modal .switch__on { color: #ffffff; }
#d2f-wrapper #d2f-modal .switch input:checked + .switch__pill { background: var(--a26ck-euc); }

#d2f-wrapper #d2f-modal footer .st-button {
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--a26ck-ink);
  border-radius: 8px;
  background: var(--a26ck-ink);
  color: #ffffff;
  font-size: 16px;
}
#d2f-wrapper #d2f-modal footer .st-button:hover { background: var(--a26ck-ink-h); border-color: var(--a26ck-ink-h); color: #ffffff; }
/* Save my choices: same size, outlined (the navy-outline secondary button used for "Load more bouquets") */
#d2f-wrapper #d2f-modal footer .preferences-save { background: #ffffff; color: var(--a26ck-ink); border: 1px solid #c2c2ca; }   /* softer secondary (Nilesh 5 Nov: "too harsh") */
#d2f-wrapper #d2f-modal footer .preferences-save:hover,
#d2f-wrapper #d2f-modal footer .preferences-save:active { background: #ffffff; color: var(--a26ck-ink); border-color: var(--a26ck-ink); box-shadow: inset 0 0 0 1px var(--a26ck-ink); }
#d2f-wrapper #d2f-modal button:focus { box-shadow: none; }
#d2f-wrapper #d2f-modal button:focus-visible,
#d2f-wrapper #d2f-modal .switch:focus-within { outline: 3px solid var(--a26ck-ink); outline-offset: 2px; box-shadow: none; }

/* ---------- Round cookie button (after a choice; bottom left, opens the settings again) ---------- */
#d2f-wrapper #d2f-cookie-icon {
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border: 1px solid var(--a26ck-line);
  box-shadow: 0 4px 14px rgba(35, 35, 61, 0.18);
}
#d2f-wrapper #d2f-cookie-icon svg { fill: var(--a26ck-ink); width: 24px; height: 24px; }
#d2f-wrapper #d2f-cookie-icon:focus { box-shadow: none; }
#d2f-wrapper #d2f-cookie-icon:focus-visible { outline: 3px solid var(--a26ck-ink); outline-offset: 2px; }
