/* Norbering overrides for vanilla-cookieconsent v3.
   Goal: match the site's own components 1:1 (Inter, --cta-gradient, 100px pill
   buttons, soft shadow). Scoped to #cc-main so nothing leaks site-wide. */
#cc-main {
  --cc-font-family: Inter, Arial, sans-serif;
  --cc-bg: var(--white, #fff);
  --cc-primary-color: var(--gray900, #15191b);
  --cc-secondary-color: var(--gray600, #475467);
  --cc-link-color: var(--primary600, #16a75f);

  --cc-modal-border-radius: 0.75rem;
  /* leave --cc-btn-border-radius at the library default — it's reused by the
     category blocks; pill shape is applied only on the real buttons below. */
  --cc-z-index: 2147483000;

  --cc-separator-border-color: var(--gray200, #e4e7ec);
  --cc-toggle-on-bg: var(--primary600, #16a75f);
  --cc-toggle-off-bg: var(--gray300, #d0d5dd);
}

/* ---- Primary buttons: identical to .main-button ---- */
#cc-main .cm__btn[data-role="all"],
#cc-main .pm__btn[data-role="all"] {
  background-color: var(--primary600, #16a75f);
  background-image: var(--cta-gradient, linear-gradient(135deg, #0e5236 0%, #16a75f 100%));
  border: none;
  color: var(--white, #fff);
  font-weight: 600;
  border-radius: 100px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 1px 2px #1018280d;
  transition: all 0.3s;
}
#cc-main .cm__btn[data-role="all"]:hover,
#cc-main .pm__btn[data-role="all"]:hover {
  filter: brightness(1.1);
  background-image: var(--cta-gradient, linear-gradient(135deg, #0e5236 0%, #16a75f 100%));
  color: var(--white, #fff);
}

/* Preferences footer: flatten the two button groups into one flex row so we can
   order them — [Sutinku su visais] [Išsaugoti nustatymus] ............ [Tik būtini] */
#cc-main .pm__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
#cc-main .pm__footer .pm__btn-group {
  display: contents;
}
#cc-main .pm__btn[data-role="all"]  { order: 1; }
#cc-main .pm__btn[data-role="save"] { order: 2; }
#cc-main .pm__btn[data-role="necessary"] { order: 3; margin-left: auto; }
/* Desktop: size to content (no stretching), let padding define width. */
#cc-main .pm__btn { flex: 0 0 auto; min-width: 0; }

/* "Išsaugoti nustatymus" (save) → secondary pill button, next to accept-all
   (identical to .button-secondary on the site). */
#cc-main .pm__btn[data-role="save"] {
  background: var(--white, #fff);
  background-image: none;
  border: 1px solid var(--gray300, #d0d5dd);
  color: var(--gray700, #344054);
  font-weight: 600;
  border-radius: 100px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 1px 2px #1018280d;
  transition: all 0.3s;
}
#cc-main .pm__btn[data-role="save"]:hover {
  background: var(--gray100, #f2f4f7);
  color: var(--gray700, #344054);
  filter: none;
}

/* "Tik būtini" (necessary) → plain text link, pushed to the right. */
#cc-main .pm__btn[data-role="necessary"] {
  background: transparent;
  background-image: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--gray500, #667085);
  font-weight: 500;
  text-decoration: none;
  min-height: 0;
  padding: 0.25rem 0.25rem;
}
#cc-main .pm__btn[data-role="necessary"]:hover {
  background: transparent;
  color: var(--gray700, #344054);
  filter: none;
}

/* ---- Links: no underline, brand colour (incl. "Privatumo politikoje") ---- */
#cc-main .cc__link,
#cc-main a {
  color: var(--primary600, #16a75f);
  text-decoration: none;
  /* the library fakes an underline via an animated background-image — kill it */
  background-image: none;
  font-weight: 600;
}
#cc-main .cc__link:hover,
#cc-main a:hover {
  text-decoration: none;
  background-image: none;
  background-size: 0 0;
  color: var(--primary600, #16a75f);
  opacity: 0.8;
}

/* ---- Consent box ---- */
#cc-main .cm {
  width: 21rem;
  max-width: calc(100vw - 2.5rem);
  border: 1px solid var(--gray200, #e4e7ec);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
}
#cc-main .cm__title {
  font-weight: 600;
  font-size: 1.0625rem;
}
#cc-main .cm__desc {
  font-size: 0.8125rem;
  line-height: 1.55;
}
#cc-main .cm__btns {
  border-top: none;
}
#cc-main .cm__btn-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
/* Initial popup: Sutinku full width, Tvarkyti centred. */
#cc-main .cm__btn[data-role="all"] {
  order: 0;
  width: 100%;
}

/* "Tvarkyti" on the initial popup: quiet text link, NO underline. */
#cc-main .cm__btn[data-role="show"] {
  order: 1;
  align-self: center; /* centre the Tvarkyti link under the full-width button */
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--gray500, #667085);
  font-weight: 500;
  text-decoration: none;
  min-height: 0;
  padding: 0.25rem;
}
#cc-main .cm__btn[data-role="show"]:hover {
  background: transparent;
  color: var(--gray700, #344054);
  text-decoration: none;
}

/* ---- Preferences modal niceties ---- */
#cc-main .pm__title,
#cc-main .pm__section-title {
  font-weight: 600;
}

/* ---- Mobile: full-width bar pinned to the bottom ---- */
@media (max-width: 640px) {
  #cc-main .cm--box {
    left: 0;
    right: 0;
    bottom: 0;
  }
  #cc-main .cm {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0.75rem 0.75rem 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  /* Consent popup buttons: full width on mobile. */
  #cc-main .cm__btn-group {
    align-items: stretch;
  }
  #cc-main .cm__btn {
    width: 100%;
  }

  /* Preferences footer on mobile: the library forces the button groups back to
     `display:flex !important`, which drops our ordering. Re-flatten with
     !important and stack in the required order: Sutinku → Išsaugoti → Tik būtini. */
  #cc-main .pm__footer {
    flex-direction: column !important;
    align-items: stretch;
  }
  #cc-main .pm__footer .pm__btn-group {
    display: contents !important;
  }
  #cc-main .pm__btn {
    width: 100%;
    flex: 1 1 auto;
  }
  #cc-main .pm__btn[data-role="all"]       { order: 1; }
  #cc-main .pm__btn[data-role="save"]      { order: 2; }
  #cc-main .pm__btn[data-role="necessary"] { order: 3; margin-left: 0; }
}
