/*
 * Cookie consent banner (consent.js) and the footer "cookie settings" control.
 * Layout, sizes, radii, shadow, colours and pills follow the strawberrybrowser.com
 * banner. Adapted: Montserrat (so a slightly wider card on desktop), 44px targets,
 * refuse and accept styled the same, no close button, labels never cut,
 * description text dark enough for 4.5:1.
 * The Hello Elementor theme styles every <button> (#c36, nowrap), so each rule
 * here resets it with a more specific selector.
 */

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

.ect-consent[hidden],
.ect-consent [hidden],
.ect-consent-open[hidden],
[data-ect-consent-open][hidden] { display: none !important; }

/* Phone first: a full-width card above the bottom edge (and the home indicator). */
.ect-consent {
  position: fixed;
  left: .75rem;
  right: .75rem;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  display: block;
  width: auto;
  max-width: none;
  max-height: calc(100vh - 1.5rem - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 1.5rem - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: .875rem 1rem;
  background: rgb(255, 252, 250);
  color: rgb(37, 37, 34);
  border: 1px solid rgb(239, 230, 220);
  border-radius: 1.25rem;
  box-shadow: rgba(0, 0, 0, .04) 0 1px 2px, rgba(0, 0, 0, .08) 0 12px 32px;
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .875rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* From 481px: the floating card in the bottom-left corner. */
@media (min-width: 481px) {
  .ect-consent {
    left: 1rem;
    right: auto;
    bottom: 1rem;
    width: calc(100% - 2rem);
    /* Strawberry uses 22.5rem. Montserrat is wider than system-ui: the widest summary
       label ("Accept toate", about 90.5px at 14px/500) needs a card of about 23.7rem for
       three equal pills on one row, so 24.5rem keeps one row with a few px to spare. */
    max-width: 24.5rem;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 1rem 1.125rem;
  }
}

.ect-consent .ect-consent__view {
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

.ect-consent p { margin: 0; }

.ect-consent .ect-consent__copy {
  font-size: .875rem;
  line-height: 1.45;
  color: rgb(37, 37, 34);
}

.ect-consent .ect-consent__link,
.ect-consent .ect-consent__link:visited,
.ect-consent .ect-consent__link:hover,
.ect-consent .ect-consent__link:focus {
  color: rgb(37, 37, 34);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ect-consent .ect-consent__link:focus { outline: none; }
.ect-consent .ect-consent__link:focus-visible {
  outline: 2px solid rgb(37, 37, 34);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── pills ─── */

/* Refuse and accept are always equal: the summary has three equal columns; the
   settings view has refuse + accept as equal halves and save on the full second row. */
.ect-consent .ect-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  align-items: stretch;
}

.ect-consent .ect-consent__actions--summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ect-consent .ect-consent__actions--customise .ect-consent__pill--wide { grid-column: 1 / -1; }

.ect-consent .ect-consent__pill {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: .625rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease-out, color .12s ease-out, border-color .12s ease-out, transform .12s ease-out;
}

.ect-consent .ect-consent__actions--summary .ect-consent__pill {
  padding-inline: .5rem;
  white-space: nowrap;
}

.ect-consent .ect-consent__actions--customise .ect-consent__pill { padding-inline: .5rem; }

.ect-consent .ect-consent__pill-label { min-width: 0; }

.ect-consent .ect-consent__pill--ghost,
.ect-consent .ect-consent__pill--ghost:hover,
.ect-consent .ect-consent__pill--ghost:focus {
  background: transparent;
  color: rgb(37, 37, 34);
  border-color: rgb(230, 219, 209);
}

.ect-consent .ect-consent__pill--solid,
.ect-consent .ect-consent__pill--solid:hover,
.ect-consent .ect-consent__pill--solid:focus {
  background: rgb(26, 26, 26);
  color: rgb(255, 253, 251);
  border-color: transparent;
}

@media (hover: hover) {
  .ect-consent .ect-consent__pill--ghost:hover { background: rgba(0, 0, 0, .04); }
  .ect-consent .ect-consent__pill--solid:hover { background: rgb(42, 42, 42); }
}

.ect-consent .ect-consent__pill:active { transform: translateY(1px); }
.ect-consent .ect-consent__pill:focus { outline: none; }
.ect-consent .ect-consent__pill:focus-visible {
  outline: 2px solid rgb(37, 37, 34);
  outline-offset: 2px;
}

/* Summary pills that do not fit on one row (set by consent.js; only on narrow
   phones, e.g. the Romanian labels below about 400px): refuse + accept share the
   first row, customise takes the full second row. Above 480px they always fit. */
.ect-consent.ect-consent--stacked .ect-consent__actions--summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ect-consent.ect-consent--stacked .ect-consent__actions--summary .ect-consent__pill--ghost { grid-column: 1 / -1; }
.ect-consent.ect-consent--stacked .ect-consent__actions--summary .ect-consent__pill { white-space: normal; }

/* ─── customise view ─── */

.ect-consent .ect-consent__head {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.ect-consent .ect-consent__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgb(37, 37, 34);
}

.ect-consent .ect-consent__title:focus { outline: none; }

.ect-consent .ect-consent__categories {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: .625rem 0;
  border-top: 1px solid rgb(239, 230, 220);
  border-bottom: 1px solid rgb(239, 230, 220);
}

.ect-consent .ect-consent__category {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  min-height: 44px;
  margin: 0;
  font-size: .875rem;
  line-height: 1.45;
  vertical-align: baseline;
  cursor: pointer;
}

.ect-consent .ect-consent__category--locked { cursor: not-allowed; }

.ect-consent .ect-consent__check {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: .15rem 0 0;
  padding: 0;
  accent-color: rgb(26, 26, 26);
  cursor: inherit;
}

.ect-consent .ect-consent__category--locked .ect-consent__check { opacity: .65; }
.ect-consent .ect-consent__check:focus { outline: none; }
.ect-consent .ect-consent__check:focus-visible {
  outline: 2px solid rgb(37, 37, 34);
  outline-offset: 2px;
}

.ect-consent .ect-consent__label {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
}

.ect-consent .ect-consent__name {
  font-size: .875rem;
  font-weight: 500;
  color: rgb(37, 37, 34);
}

.ect-consent .ect-consent__desc {
  font-size: .8125rem;
  line-height: 1.4;
  color: rgba(37, 37, 34, .72);
}

/* ─── footer: privacy link and "cookie settings" button ─── */

/* The "PAGINI IMPORTANTE" list (class added by scripts/lib/privacy.mjs): every link
   and the settings button sit on the same 44px row, so the rhythm stays even and
   each one is a 44px target. */
footer .ect-footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

footer .ect-footer-links > br { display: none; }

footer .ect-footer-links > a,
footer .ect-footer-links > .ect-consent-open {
  display: flex;
  align-items: center;
  max-width: 100%;
  min-height: 44px;
}

.ect-consent-open.ect-consent-open {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #27272d;
  font: inherit; /* Montserrat 16px (15px on tablet and phone) and the list line height */
  letter-spacing: inherit;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  transition: none;
}

.ect-consent-open.ect-consent-open:focus {
  color: #27272d;
  background: none;
  outline: none;
}

.ect-consent-open.ect-consent-open:hover {
  color: #fd8649;
  background: none;
}

.ect-consent-open.ect-consent-open:focus-visible {
  outline: 3px solid #27272d;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .ect-consent .ect-consent__pill { transition: none; }
  .ect-consent .ect-consent__pill:active { transform: none; }
}
