/*
 * BioPrevent consent banner. Selectors start with an id so the shop theme's global button, link, table and
 * paragraph styles (OceanWP, Elementor kit) can't restyle it, and the same file looks the same on /lp/.
 */
#bp-consent,
#bp-consent-settings,
.bpc-reopen {
  --bpc-ink: #1d2a2e;
  --bpc-muted: #56666b;
  --bpc-deep: #083f49;
  --bpc-teal: #0b5e6e;
  --bpc-line: #d9e2e4;
  --bpc-bg: #ffffff;
  --bpc-tint: #e7f1f3;
  --bpc-focus: #7a4fa3;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--bpc-ink);
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}

#bp-consent *,
#bp-consent-settings * {
  box-sizing: border-box;
}

#bp-consent[hidden],
.bpc-reopen[hidden] {
  display: none !important;
}

/* First layer: a card at the bottom that never blocks the page (no cookie wall). */
#bp-consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
  max-width: 760px;
  max-height: calc(100vh - 24px);
  /* The visible height on phones (toolbars shown); older browsers keep the line above. */
  max-height: calc(100dvh - 24px);
  margin: 0 auto;
  padding: 20px;
  overflow-y: auto;
  background: var(--bpc-bg);
  border: 1px solid var(--bpc-line);
  border-radius: 12px;
  box-shadow: 0 10px 36px rgb(8 63 73 / 0.22);
}

#bp-consent p,
#bp-consent-settings p,
#bp-consent-settings h2 {
  margin: 0 0 10px;
  padding: 0;
  font-family: inherit;
  color: var(--bpc-ink);
}

#bp-consent .bpc-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--bpc-deep);
}

#bp-consent .bpc-text,
#bp-consent-settings .bpc-text {
  font-size: 14.5px;
}

#bp-consent .bpc-links,
#bp-consent-settings .bpc-links {
  margin-bottom: 14px;
  font-size: 14px;
}

#bp-consent-settings .bpc-status {
  padding: 8px 10px;
  font-size: 13px;
  word-break: break-word;
  background: #eaf3f4;
  border-radius: 8px;
}

#bp-consent-settings .bpc-status[hidden] {
  display: none;
}

/* The cookie list on the cookie policy page ([bioprevent_kolacici]); it inherits the theme's typography. */
.bpc-policy .bpc-table {
  width: 100%;
  margin: 8px 0 24px;
  border-collapse: collapse;
  font-size: 14px;
}

.bpc-policy .bpc-table th,
.bpc-policy .bpc-table td {
  padding: 8px 10px 8px 0;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #d9e2e4;
}

.bpc-policy .bpc-table code {
  word-break: break-word;
}

/* Screen-reader only: the "saved" announcement. */
.bpc-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#bp-consent a,
#bp-consent-settings a {
  color: var(--bpc-teal);
  text-decoration: underline;
  font-weight: 600;
}

/* "Odbij sve", "Prilagodi" / "Spremi odabir" and "Prihvati sve" share size, type, corners and row. On the
   banner only "Prihvati sve" is filled; the other two are outlined in the same teal and read at 7.4:1
   (Marko, 2026-10-19). In the dialog all three stay filled: a visitor who has just picked purposes must not
   be steered to "Prihvati sve" over "Spremi odabir". */
#bp-consent .bpc-actions,
#bp-consent-settings .bpc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* On a short screen the text scrolls inside the card, but the three buttons always stay in view. */
#bp-consent .bpc-actions {
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px;
  padding: 10px 20px 20px;
  background: var(--bpc-bg);
}

/* While the banner is up, nothing the keyboard focuses may hide behind it (WCAG 2.4.11), and the landing
   pages' own bottom bar steps aside. --bpc-h is the banner's height, set by consent.js. */
html.bpc-open {
  scroll-padding-bottom: calc(var(--bpc-h, 0px) + 24px);
}

html.bpc-open body {
  padding-bottom: var(--bpc-h, 0px);
}

html.bpc-open .sticky-buy {
  visibility: hidden;
}

#bp-consent .bpc-btn,
#bp-consent-settings .bpc-btn {
  flex: 1 1 120px;
  min-height: 46px;
  margin: 0;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  color: #ffffff;
  background: var(--bpc-teal);
  border: 2px solid var(--bpc-teal);
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

#bp-consent .bpc-btn:hover,
#bp-consent-settings .bpc-btn:hover {
  background: var(--bpc-deep);
  border-color: var(--bpc-deep);
  color: #ffffff;
}

/* Every button carries the same 2 px border, so the outlined ones are exactly as large as the filled one. */
#bp-consent .bpc-btn[data-bpc="reject"],
#bp-consent .bpc-btn[data-bpc="settings"] {
  background: var(--bpc-bg);
  color: var(--bpc-teal);
}

#bp-consent .bpc-btn[data-bpc="reject"]:hover,
#bp-consent .bpc-btn[data-bpc="settings"]:hover {
  background: var(--bpc-tint);
  border-color: var(--bpc-deep);
  color: var(--bpc-deep);
}

#bp-consent .bpc-btn:focus-visible,
#bp-consent-settings .bpc-btn:focus-visible,
#bp-consent-settings .bpc-close:focus-visible,
#bp-consent-settings summary:focus-visible,
#bp-consent-settings input:focus-visible,
#bp-consent a:focus-visible,
#bp-consent-settings a:focus-visible,
.bpc-reopen:focus-visible {
  outline: 3px solid var(--bpc-focus);
  outline-offset: 2px;
}

/* Second layer: the settings dialog (native <dialog>, so focus stays inside and Esc closes it). */
#bp-consent-settings {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 22px 22px 20px;
  overflow-y: auto;
  background: var(--bpc-bg);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgb(8 63 73 / 0.3);
}

#bp-consent-settings[open] {
  display: block;
}

/* Browsers without showModal() get a plain fixed panel. */
#bp-consent-settings[open]:not(:modal) {
  position: fixed;
  inset: 12px;
  z-index: 2147483001;
}

#bp-consent-settings::backdrop {
  background: rgb(8 63 73 / 0.45);
}

#bp-consent-settings .bpc-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#bp-consent-settings h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--bpc-deep);
}

#bp-consent-settings .bpc-close {
  flex: none;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 0;
  padding: 0;
  font-family: inherit;
  font-size: 26px;
  line-height: 1;
  color: var(--bpc-ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

#bp-consent-settings .bpc-cat {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--bpc-line);
}

#bp-consent-settings .bpc-cat:last-of-type {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bpc-line);
}

#bp-consent-settings .bpc-cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--bpc-deep);
  cursor: pointer;
}

/* Native checkboxes: the shop theme (OceanWP) restyles every checkbox with a faint 1.9:1 border. */
#bp-consent-settings .bpc-cat-head input {
  -webkit-appearance: checkbox;
  appearance: auto;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  accent-color: var(--bpc-teal);
  cursor: pointer;
}

#bp-consent-settings .bpc-cat-head input::before,
#bp-consent-settings .bpc-cat-head input::after {
  content: none;
}

#bp-consent-settings .bpc-cat-head input:disabled {
  cursor: default;
}

#bp-consent-settings .bpc-cat-head small {
  font-size: 13px;
  font-weight: 400;
  color: var(--bpc-muted);
}

#bp-consent-settings .bpc-cat-desc {
  margin: 6px 0 6px 32px;
  font-size: 14px;
  color: var(--bpc-muted);
}

#bp-consent-settings .bpc-cat-cookies {
  margin: 0 0 0 32px;
  font-size: 13px;
}

#bp-consent-settings summary {
  display: list-item;
  padding: 4px 0;
  font-weight: 600;
  color: var(--bpc-teal);
  cursor: pointer;
}

#bp-consent-settings .bpc-table {
  width: 100%;
  margin: 6px 0 0;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.4;
  background: transparent;
  border: 0;
}

#bp-consent-settings .bpc-table th,
#bp-consent-settings .bpc-table td {
  padding: 6px 8px 6px 0;
  vertical-align: top;
  text-align: left;
  color: var(--bpc-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--bpc-line);
}

#bp-consent-settings .bpc-table th {
  font-weight: 700;
  color: var(--bpc-muted);
}

#bp-consent-settings .bpc-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-word;
  color: var(--bpc-ink);
  background: transparent;
  padding: 0;
}

/* Re-open button for pages without a footer link; bottom left, clear of the chat and scroll-to-top buttons. */
.bpc-reopen {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--bpc-teal);
  background: #ffffff;
  border: 1px solid var(--bpc-line);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgb(8 63 73 / 0.18);
  cursor: pointer;
}

.bpc-reopen:hover {
  color: var(--bpc-deep);
}

@media (max-width: 560px) {
  #bp-consent {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 14px 14px 12px;
  }

  #bp-consent .bpc-actions {
    bottom: -12px;
    margin: 0 -14px -12px;
    padding: 8px 14px 12px;
  }

  #bp-consent .bpc-title {
    margin-bottom: 6px;
    font-size: 16px;
  }

  #bp-consent .bpc-text {
    margin-bottom: 8px;
    font-size: 13.5px;
    line-height: 1.45;
  }

  #bp-consent .bpc-links {
    margin-bottom: 10px;
    font-size: 13.5px;
  }

  /* Still one row of three equal buttons: a stack would make the banner taller than the page it covers. */
  #bp-consent .bpc-btn,
  #bp-consent-settings .bpc-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    font-size: 14px;
  }

  #bp-consent-settings {
    padding: 18px 16px 16px;
  }

  #bp-consent-settings .bpc-cat-desc,
  #bp-consent-settings .bpc-cat-cookies {
    margin-left: 0;
  }

  /* The cookie table becomes one block per cookie. */
  #bp-consent-settings .bpc-table thead {
    display: none;
  }

  #bp-consent-settings .bpc-table tr {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid var(--bpc-line);
  }

  #bp-consent-settings .bpc-table td {
    display: block;
    padding: 1px 0;
    border: 0;
  }

  #bp-consent-settings .bpc-table td::before {
    content: attr(data-label) ': ';
    font-weight: 700;
    color: var(--bpc-muted);
  }
}

@media print {
  #bp-consent,
  .bpc-reopen {
    display: none !important;
  }
}
