@-moz-keyframes show_cookies {
  0% {
    bottom: -30%;
  }
  100% {
    bottom: 0;
  }
}

@-webkit-keyframes show_cookies {
  0% {
    bottom: -30%;
  }
  100% {
    bottom: 0;
  }
}

@keyframes show_cookies {
  0% {
    bottom: -30%;
  }
  100% {
    bottom: 0;
  }
}

/* Modern cookie banner styles */
#block-cookiespolicy,
#block-aktmotos-cookiespolicy {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2%;
  z-index: 9999;
  width: calc(100% - 40px);
  max-width: 1100px;
  padding: 12px;
  box-sizing: border-box;
  display: none;
}

/* Small screens: stack content */
@media (max-width: 720px) {
  #block-aktmotos-cookiespolicy p {
    font-size: 16px;
  }
}

#block-aktmotos-cookiespolicy p {
  line-height: 1.3;
}

#block-cookiespolicy.active,
#block-aktmotos-cookiespolicy.active {
  -moz-animation: show_cookies 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) forwards
    0.1s;
  -webkit-animation: show_cookies 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) forwards
    0.1s;
  animation: show_cookies 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) forwards 0.1s;
  display: block;
}

#block-cookiespolicy .policy-content,
#block-aktmotos-cookiespolicy .policy-content {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  color: #08101a;
  background: linear-gradient(135deg, #ffffffc7 0%, #fafafae0 100%);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 6px 30px rgba(16, 24, 32, 0.24);
}

/* Left column: icon + text */
.clc-cookie-left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1 1 60%;
}

.cookie-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  display: inline-block;
  background-color: rgba(245, 208, 145, 0.15);
  display: grid;
  place-items: center;
}

.cookie-icon::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='10' fill='%23f5d091'/><circle cx='9.2' cy='9.2' r='1.2' fill='%23854e2b'/><circle cx='14.8' cy='11.5' r='1.3' fill='%23854e2b'/><circle cx='11.5' cy='14.2' r='1' fill='%23854e2b'/><path d='M18 8c-.4 0-.8.2-1 .5.2-.1.5-.2.8-.2.4 0 .8.1 1.1.3A6.9 6.9 0 0018 8z' fill='%23ffffff' opacity='0.18'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}

.clc-cookie-message {
  color: #0f1720;
  font-size: 0.98rem;
  line-height: 1.3;
}

.clc-cookie-message a {
  font-weight: 600;
  color: #003f6d;
}

.clc-cookie-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.btn-accept-cookies,
.btn-cookies-manage {
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-accept-cookies {
  background: linear-gradient(90deg, #ffb347, #ffcc33);
  color: #08101a;
  box-shadow: 0 8px 24px rgba(255, 180, 71, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 10px 20px;
  min-width: 110px;
  border-radius: 12px;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.18s ease;
}

.btn-accept-cookies:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 180, 71, 0.2);
}

.btn-cookies-manage {
  background: transparent;
  color: #0f1720;
  border: 1px solid rgba(15, 23, 32, 0.08);
}

/* Small screens: stack content */
@media (max-width: 720px) {
  /* Centered, slightly inset banner with rounded corners and spacing */
  #block-cookiespolicy,
  #block-aktmotos-cookiespolicy {
    left: 50%;
    transform: translateX(-50%);
    bottom: 10% !important;
    width: 95%;
    max-width: none;
    padding: 0;
    border-radius: 14px;
  }

  /* Policy content: stacked, touch-friendly spacing */
  #block-cookiespolicy .policy-content,
  #block-aktmotos-cookiespolicy .policy-content {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 14px;
    border-radius: 12px;
  }

  .cookie-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
  }
  .cookie-icon::before {
    width: 28px;
    height: 28px;
    background-size: contain;
  }

  .clc-cookie-message {
    font-size: 1rem;
    line-height: 1.4;
  }

  /* Actions stacked and touch-friendly */
  .clc-cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: stretch;
    align-items: stretch;
  }

  .btn-accept-cookies,
  .btn-cookies-manage {
    width: 100%;
    padding: 12px 16px;
    min-width: 0;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .btn-accept-cookies {
    font-size: 1rem;
  }

  /* Respect device safe area on modern phones */
  #block-cookiespolicy,
  #block-aktmotos-cookiespolicy {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }
}

/* Accessibility focus states */
.btn-accept-cookies:focus,
.btn-cookies-manage:focus {
  outline: 3px solid rgba(34, 197, 94, 0.18);
  outline-offset: 2px;
}
.btn-accept-cookies:focus,
.btn-cookies-manage:focus {
  outline: 3px solid rgba(34, 197, 94, 0.18);
  outline-offset: 2px;
}

/* State when the policy is being removed: fade and translate down */
.policy-removed {
  opacity: 0 !important;
  transform: translateY(10px) !important;
  transition: opacity 0.32s ease, transform 0.32s ease;
  pointer-events: none;
}

/* Disabled accept button */
.btn-accept-cookies[disabled] {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* Focus-visible more visible */
.btn-accept-cookies:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.22);
  outline-offset: 4px;
}

/* Utility: hide on print */
@media print {
  #block-cookiespolicy,
  #block-aktmotos-cookiespolicy {
    display: none !important;
  }
}
