/* konto.rs theme for vanilla-cookieconsent 3.x
 * Desktop: one-line bar at the bottom: text | Settings (link) · Reject · Accept.
 * Phones: the site has no <meta viewport>, so iOS lays it out 980px wide and shrinks it ~40%.
 * main.css compensates with huge fonts below 990px; the banner is zoomed to match. */

#cc-main {
  --cc-font-family: inherit;
  --cc-bg: #fff;
  --cc-primary-color: #212529;
  --cc-secondary-color: #495057;
  --cc-link-color: #243b72;
  --cc-btn-border-radius: 6px;

  --cc-btn-primary-bg: #243b72;
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-border-color: #243b72;
  --cc-btn-primary-hover-bg: #1a2b54;
  --cc-btn-primary-hover-color: #fff;
  --cc-btn-primary-hover-border-color: #1a2b54;

  --cc-btn-secondary-bg: #fff;
  --cc-btn-secondary-color: #243b72;
  --cc-btn-secondary-border-color: #243b72;
  --cc-btn-secondary-hover-bg: #eef1f8;
  --cc-btn-secondary-hover-color: #243b72;
  --cc-btn-secondary-hover-border-color: #243b72;

  --cc-toggle-on-bg: #243b72;
  --cc-toggle-readonly-bg: #9aa7c4;
  --cc-toggle-readonly-knob-icon-color: #9aa7c4;
}

/* Reject is an outlined button, the same size as Accept (equal choice). */
#cc-main .cm__btn[data-role="necessary"],
#cc-main .pm__btn[data-role="necessary"] {
  background: var(--cc-btn-secondary-bg);
  color: var(--cc-btn-secondary-color);
  border-color: var(--cc-btn-secondary-border-color);
}
#cc-main .cm__btn[data-role="necessary"]:hover,
#cc-main .pm__btn[data-role="necessary"]:hover {
  background: var(--cc-btn-secondary-hover-bg);
}

/* Settings / Save settings look like links. */
#cc-main .cm__btn[data-role="show"],
#cc-main .pm__btn[data-role="save"] {
  background: transparent;
  border-color: transparent;
  color: var(--cc-link-color);
  text-decoration: underline;
  text-underline-offset: 4px;
}
#cc-main .cm__btn[data-role="show"]:hover,
#cc-main .pm__btn[data-role="save"]:hover {
  background: transparent;
  border-color: transparent;
  color: #1a2b54;
}

/* Desktop bar: text left, buttons in one row on the right: Settings, Reject, Accept. */
#cc-main .cm--bar.cm--inline .cm__body {
  align-items: center;
}
#cc-main .cm--bar.cm--inline .cm__btns {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
  max-width: none;
  flex: 0 0 auto;
  border-top: none;
}
#cc-main .cm--bar.cm--inline .cm__btn-group {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.5rem;
  margin: 0;
}
#cc-main .cm--bar.cm--inline .cm__btn {
  margin: 0;
  min-width: 7.5rem;
}
#cc-main .cm--bar.cm--inline .cm__btn[data-role="show"] {
  min-width: 0;
}

/* Settings window: category descriptions always visible (no expand arrows),
 * and the box only as tall as its content. */
#cc-main .pm__section--toggle .pm__section-desc-wrapper {
  display: flex;
}
#cc-main .pm__section--toggle .pm__section-title {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-left: 1.2em;
  pointer-events: none;
}
#cc-main .pm__section--expandable .pm__section-arrow {
  display: none;
}
#cc-main .pm--box {
  height: auto;
}

/* Footer link inherits the footer's small text size on every screen. */
footer [data-cc="show-preferencesModal"] {
  font-size: inherit !important;
  line-height: inherit !important;
}

@media (max-width: 990px) {
  /* Scale the whole banner and settings window to the site's phone layout. */
  #cc-main .cm,
  #cc-main .pm {
    zoom: 2.5;
  }

  /* main.css forces p/a to 3rem on phones; keep banner text at its own (zoomed) size. */
  #cc-main p,
  #cc-main a {
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  /* Bar: edge to edge, text on top, the three buttons in one row below.
   * (The library sizes the bar with 100vw, which zoom would multiply.) */
  #cc-main .cm--bar {
    width: auto;
    left: 0;
    right: 0;
  }
  #cc-main .cm--bar.cm--inline .cm__body {
    flex-direction: column;
    align-items: stretch;
  }
  #cc-main .cm--bar.cm--inline .cm__texts {
    padding-bottom: 0;
  }
  #cc-main .cm--bar.cm--inline .cm__btns {
    flex: 1 1 auto;
    padding-top: 0.75rem;
  }
  #cc-main .cm--bar.cm--inline .cm__btn-group {
    flex: 2 1 0;
  }
  #cc-main .cm--bar.cm--inline .cm__btn-group:last-child {
    flex: 1 1 0;
  }
  #cc-main .cm--bar.cm--inline .cm__btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px; /* x2.5 zoom x0.4 iOS scale ≈ 46px on screen (≥44 tap target) */
  }
  #cc-main .pm__btn {
    min-height: 46px;
  }

  /* Settings: bottom sheet, full width, stacked buttons, scrolls if taller than the screen. */
  #cc-main .pm-wrapper {
    align-items: flex-end;
  }
  #cc-main .pm--box {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    height: auto;
    max-width: none;
    max-height: calc(100vh / 2.5);
    max-height: calc(100dvh / 2.5); /* visible height incl. Safari toolbars; vh fallback above */
    overflow-y: auto; /* on short screens (landscape) the whole sheet scrolls, so the buttons stay reachable */
    margin: 0;
    border-radius: 16px 16px 0 0;
    transform: none !important; /* library centres the box with translateY(-50%) */
  }
  #cc-main .pm--box .pm__body {
    flex: none;
    overflow: visible;
  }
  #cc-main .pm__footer {
    flex-direction: column;
    gap: 0.5rem;
  }
  #cc-main .pm__btn-group {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    margin: 0;
  }
  #cc-main .pm__btn {
    width: 100%;
    margin: 0 !important;
  }
}
