.cookie-consent,
.cookie-consent *,
.cookie-consent *::before,
.cookie-consent *::after {
  box-sizing: border-box;
}

.cookie-consent[hidden],
.cookie-consent [hidden] {
  display: none !important;
}

.cookie-consent {
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 32px), 1180px);
  max-height: calc(100dvh - 40px);
  margin: 0;
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 56, 147, 0.14);
  border-radius: 20px;
  background: rgba(250, 252, 255, 0.97);
  color: #17243a;
  box-shadow: 0 24px 70px rgba(4, 25, 58, 0.24), 0 4px 16px rgba(4, 25, 58, 0.1);
  font-family: var(--brand-font);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 56, 147, 0.25) transparent;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: cookie-consent-in 0.24s ease-out both;
}

.cookie-consent::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, #ffd96a 0%, #4d8dff 52%, #003893 100%);
  content: "";
}

.cookie-consent__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
  gap: 22px 32px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 24px 54px 24px 30px;
}

.cookie-consent__copy {
  min-width: 0;
}

.cookie-consent__copy h2 {
  margin: 0 0 8px;
  color: #092957;
  font-family: var(--brand-font);
  font-size: clamp(18px, 1.7vw, 23px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.cookie-consent__copy p {
  max-width: 53rem;
  margin: 0 0 7px;
  color: rgba(23, 36, 58, 0.76);
  font-size: 13px;
  line-height: 1.65;
}

.cookie-consent__copy p:last-of-type {
  margin-bottom: 0;
}

.cookie-consent__copy p:empty {
  display: none;
}

.cookie-consent__copy p a {
  color: var(--navy, #001e60);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.cookie-consent__aside,
.cookie-consent__actions {
  display: grid;
  min-width: 0;
}

.cookie-consent__aside {
  gap: 12px;
}

.cookie-consent__actions {
  gap: 9px;
}

.cookie-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid #003893;
  border-radius: 11px;
  appearance: none;
  background: #003893;
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 56, 147, 0.2);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cookie-consent__btn:hover {
  border-color: #135bbd;
  background: #135bbd;
  box-shadow: 0 9px 22px rgba(0, 56, 147, 0.26);
  transform: translateY(-1px);
}

.cookie-consent__btn:active {
  transform: translateY(0);
}

.cookie-consent__btn--reject {
  border-color: rgba(23, 36, 58, 0.2);
  background: #fff;
  color: #21324b;
  box-shadow: none;
}

.cookie-consent__btn--reject:hover {
  border-color: rgba(0, 56, 147, 0.42);
  background: #f2f6fc;
  color: #003893;
  box-shadow: none;
}

.cookie-consent__btn--save {
  border-color: #2f6759;
  background: #2f6759;
  box-shadow: 0 7px 18px rgba(47, 103, 89, 0.2);
}

.cookie-consent__btn--save:hover {
  border-color: #245347;
  background: #245347;
}

.cookie-consent__btn-icon,
.cookie-consent__link-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.cookie-consent__btn-icon {
  width: 16px;
  height: 16px;
}

.cookie-consent__link-icon {
  width: 13px;
  height: 13px;
  opacity: 0.9;
}

.cookie-consent__btn-icon svg,
.cookie-consent__link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cookie-consent__btn-icon svg {
  stroke-width: 2.2;
}

.cookie-consent__link-icon svg {
  stroke-width: 1.7;
}

.cookie-consent__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cookie-consent__links a,
.cookie-consent__links button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: rgba(23, 36, 58, 0.65);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  justify-content: center;
  cursor: pointer;
}

.cookie-consent__links a:hover,
.cookie-consent__links button:hover {
  color: #003893;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent__categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.cookie-consent__category {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(23, 36, 58, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.cookie-consent__category:hover {
  border-color: rgba(0, 56, 147, 0.3);
  background: #fff;
}

.cookie-consent__category input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: #003893;
}

.cookie-consent__category > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #17243a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cookie-consent__category small {
  color: rgba(23, 36, 58, 0.58);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
}

.cookie-consent__services {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(23, 36, 58, 0.14);
}

.cookie-consent__service {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.cookie-consent__service a {
  justify-self: start;
  color: #003893;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.cookie-consent__service a:hover {
  color: #135bbd;
}

.cookie-consent__service small {
  overflow-wrap: anywhere;
}

.cookie-consent__close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: max(14px, env(safe-area-inset-right, 0px));
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0 0 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  appearance: none;
  background: transparent;
  color: rgba(23, 36, 58, 0.58);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.cookie-consent__close:hover {
  border-color: rgba(23, 36, 58, 0.12);
  background: rgba(0, 56, 147, 0.06);
  color: #003893;
}

.cookie-consent:focus {
  outline: none;
}

.cookie-consent__btn:focus-visible,
.cookie-consent__links a:focus-visible,
.cookie-consent__links button:focus-visible,
.cookie-consent__close:focus-visible,
.cookie-consent__service a:focus-visible,
.cookie-consent__category:focus-within {
  outline: 3px solid rgba(63, 130, 246, 0.35);
  outline-offset: 2px;
}

@keyframes cookie-consent-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 900px) {
  .cookie-consent {
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: min(calc(100% - 24px), 680px);
    max-height: calc(100dvh - 24px);
    border-radius: 17px;
  }

  .cookie-consent::before {
    inset: 0 0 auto;
    width: auto;
    height: 4px;
    border-radius: 17px 17px 0 0;
    background: linear-gradient(90deg, #ffd96a 0%, #4d8dff 52%, #003893 100%);
  }

  .cookie-consent__inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 20px 20px;
  }

  .cookie-consent__copy {
    padding-right: 30px;
  }

  .cookie-consent__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cookie-consent__btn--save:not([hidden]) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .cookie-consent {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 15px;
  }

  .cookie-consent__inner {
    gap: 15px;
    padding: 22px 16px 16px;
  }

  .cookie-consent__copy h2 {
    margin-bottom: 6px;
    font-size: 18px;
  }

  .cookie-consent__copy p {
    font-size: 12px;
    line-height: 1.55;
  }

  .cookie-consent__categories {
    grid-template-columns: 1fr;
    max-height: 210px;
    overflow: auto;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cookie-consent__btn--save:not([hidden]) {
    grid-column: auto;
  }

  .cookie-consent__btn {
    min-height: 44px;
  }

  .cookie-consent__links {
    gap: 9px 12px;
  }

  .cookie-consent__close {
    top: 9px;
    right: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent { animation: none; }
  .cookie-consent__btn,
  .cookie-consent__category,
  .cookie-consent__close { transition: none; }
}
