/* Unified Cookie Consent Banner — Complianz-quality modal */

/* Overlay */
.eh-consent__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99998;
}

/* Modal */
.eh-consent {
  position: fixed;
  z-index: 99999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  animation: ehFadeIn 0.3s ease;
}

@keyframes ehFadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.eh-consent--hiding {
  opacity: 0;
  transform: translate(-50%, -48%);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

/* Header */
.eh-consent__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.eh-consent__title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.eh-consent__close {
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.eh-consent__close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Scrollable body */
.eh-consent__body {
  padding: 14px 20px;
  overflow-y: auto;
  max-height: 55vh;
  flex: 1;
}

.eh-consent__message {
  margin: 0 0 14px;
  color: #444;
  line-height: 1.6;
}

/* Categories — expandable details */
.eh-consent__categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eh-consent__cat {
  background: rgba(239, 239, 239, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.eh-consent__cat-header {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.eh-consent__cat-header::-webkit-details-marker { display: none; }

.eh-consent__cat-title {
  font-size: 13px;
  font-weight: 500;
  color: #222;
}

.eh-consent__cat-active {
  font-size: 12px;
  font-weight: 500;
  color: green;
}

/* Chevron */
.eh-consent__cat-chevron {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.eh-consent__cat-chevron::after {
  content: "";
  border: solid #888;
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg);
  display: block;
}
details[open] > summary .eh-consent__cat-chevron::after {
  transform: rotate(-135deg);
}

.eh-consent__cat-desc {
  padding: 0 12px 12px;
  margin: 0;
  color: #555;
  line-height: 1.5;
}

/* Toggle switch */
.eh-consent__toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
  cursor: pointer;
  margin: 0;
}
.eh-consent__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.eh-consent__slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 18px;
  transition: background 0.3s;
}
.eh-consent__slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.eh-consent__toggle input:checked + .eh-consent__slider {
  background: #4caf50;
}
.eh-consent__toggle input:checked + .eh-consent__slider::before {
  transform: translateX(18px);
}

/* Brand-colored active toggles */
.eh-consent--gmi .eh-consent__toggle input:checked + .eh-consent__slider { background: #2ecc71; }
.eh-consent--pls .eh-consent__toggle input:checked + .eh-consent__slider { background: #e00922; }
.eh-consent--rrv .eh-consent__toggle input:checked + .eh-consent__slider { background: #e00922; }
.eh-consent--pods .eh-consent__toggle input:checked + .eh-consent__slider { background: #e00922; }

/* Links */
.eh-consent__links {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px;
  border-top: 1px solid #f0f0f0;
}
.eh-consent__link {
  font-size: 12px;
  text-decoration: underline;
}
/* Brand link colors */
.eh-consent--gmi .eh-consent__link { color: #2ecc71; }
.eh-consent--pls .eh-consent__link { color: #e00922; }
.eh-consent--rrv .eh-consent__link { color: #e00922; }
.eh-consent--pods .eh-consent__link { color: #e00922; }
.eh-consent__link:hover { opacity: 0.8; }

/* Buttons */
.eh-consent__buttons {
  display: flex;
  gap: 10px;
  padding: 12px 20px 16px;
}

.eh-consent__btn {
  height: 42px;
  padding: 0 16px;
  width: 100%;
  white-space: nowrap;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

/* Accept — brand-colored */
.eh-consent--gmi .eh-consent__btn--accept { background: #2ecc71; border-color: #27ae60; color: #fff; }
.eh-consent--gmi .eh-consent__btn--accept:hover { background: #27ae60; }
.eh-consent--pls .eh-consent__btn--accept { background: #e00922; border-color: #c0071c; color: #fff; }
.eh-consent--pls .eh-consent__btn--accept:hover { background: #c0071c; }
.eh-consent--rrv .eh-consent__btn--accept { background: #e00922; border-color: #c0071c; color: #fff; }
.eh-consent--rrv .eh-consent__btn--accept:hover { background: #c0071c; }
.eh-consent--pods .eh-consent__btn--accept { background: #e00922; border-color: #c0071c; color: #fff; }
.eh-consent--pods .eh-consent__btn--accept:hover { background: #c0071c; }

/* Deny — light neutral (high specificity to override WordPress themes) */
.eh-consent .eh-consent__btn.eh-consent__btn--deny {
  background: #f9f9f9 !important;
  border-color: #e0e0e0 !important;
  color: #333 !important;
}
.eh-consent .eh-consent__btn.eh-consent__btn--deny:hover {
  background: #f0f0f0 !important;
}

/* Mobile */
@media (max-width: 560px) {
  .eh-consent {
    width: 100%;
    max-width: 100%;
    bottom: 0;
    top: auto;
    left: 0;
    transform: none;
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
  }
  @keyframes ehFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .eh-consent--hiding {
    transform: translateY(20px);
  }
  .eh-consent__buttons {
    flex-direction: column;
  }
}
