@-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-clc-cookies-policy {
  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;
}

/* CSS variables (defaults) for cookie banner buttons */
.block-clc-cookies-policy {
  --cookie-btn-bg: linear-gradient(90deg, #ffb347, #ffcc33);
  --cookie-btn-color: #08101a;
  --cookie-btn-shadow: 0 8px 24px rgba(255, 180, 71, 0.18);
  --cookie-manage-bg: transparent;
  --cookie-manage-color: #0f1720;
  --cookie-focus-outline: rgba(34, 197, 94, 0.22);
  --cookie-icon-bg: rgba(245, 208, 145, 0.15);
  --cookie-icon-filter: none;
}

/* BEM block and element aliases (backwards compatible)
   - Use `.clc-cookie` as canonical block; keep existing classes working.
   - Elements: `__content`, `__left`, `__actions`, `__accept`, `__manage`.
*/
.clc-cookie {
  --cookie-btn-bg: var(--cookie-btn-bg);
  --cookie-btn-color: var(--cookie-btn-color);
  --cookie-btn-shadow: var(--cookie-btn-shadow);
  --cookie-manage-bg: var(--cookie-manage-bg);
  --cookie-manage-color: var(--cookie-manage-color);
  --cookie-focus-outline: var(--cookie-focus-outline);
}

/* Elements (alias existing selectors to BEM names) */
.clc-cookie__content,
.block-clc-cookies-policy .policy-content {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.clc-cookie__left,
.clc-cookie-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

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

/* Buttons support both legacy and BEM element names */
.clc-cookie__accept,
.btn-accept-cookies {
  background: var(--cookie-btn-bg);
  color: var(--cookie-btn-color);
  box-shadow: var(--cookie-btn-shadow);
}

.clc-cookie__manage,
.btn-cookies-manage {
  background: var(--cookie-manage-bg);
  color: var(--cookie-manage-color);
}

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

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

.block-clc-cookies-policy.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-clc-cookies-policy .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: var(--cookie-icon-bg);
  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;
  filter: var(--cookie-icon-filter, none);
}

.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: var(--cookie-btn-bg);
  color: var(--cookie-btn-color);
  box-shadow: var(--cookie-btn-shadow);
  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: var(--cookie-manage-bg);
  color: var(--cookie-manage-color);
  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-clc-cookies-policy,
  #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-clc-cookies-policy .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;
    background-color: var(--cookie-icon-bg);
    border: 1px solid rgba(15, 23, 32, 0.04);
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.06);
    display: grid;
    place-items: center;
  }

  .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-clc-cookies-policy,
  #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 var(--cookie-focus-outline, rgba(34, 197, 94, 0.22));
  outline-offset: 4px;
}

/* Section modifiers: apply via body/page selectors or by adding
   the modifier class `.clc-cookie--vehiculos` / `.clc-cookie--electricos`
   to the banner element. */

/* Vehiculos carga: rojo */
.page--pagina-dinamica-vehiculos-carga .block-clc-cookies-policy,
body.node--pagina-dinamica-vehiculos-carga .block-clc-cookies-policy,
body[class*="vehiculos"] .block-clc-cookies-policy,
.clc-cookie--vehiculos {
  --cookie-btn-bg: linear-gradient(90deg, #ff5a5f, #ff2e2e);
  --cookie-btn-color: #ffffff;
  --cookie-btn-shadow: 0 8px 22px rgba(255, 90, 95, 0.14);
  --cookie-manage-bg: transparent;
  --cookie-manage-color: #ff5a5f;
  --cookie-focus-outline: rgba(255, 90, 95, 0.16);
}

/* Electricos: verde */
.page--pagina-dinamica-electricos .block-clc-cookies-policy,
body.node--pagina-dinamica-electricos .block-clc-cookies-policy,
body[class*="electricos"] .block-clc-cookies-policy,
.clc-cookie--electricos {
  --cookie-btn-bg: linear-gradient(90deg, #c4e600, #9ab000);
  --cookie-btn-color: #ffffff;
  --cookie-btn-shadow: 0 8px 22px rgba(156, 180, 0, 0.12);
  --cookie-manage-bg: transparent;
  --cookie-manage-color: #c4e600;
  --cookie-focus-outline: rgba(196, 230, 0, 0.16);
}

.page-inicio {
  .clc-cookie-message {
    font-family: "Plus Jakarta Sans";
  }

  .cookie-icon {
    background-color: rgba(26, 98, 143, 0.2);
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }
}

.page-vehiculoscarga {
  .cookie-icon {
    background-color: rgba(177, 167, 167, 0.2);
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }
}

.page-electricos {
  .cookie-icon {
    background-color: rgba(178, 185, 173, 0.2);
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }
}
