/* ════════════════════════════════════════════════════════════════
   COOKIE CONSENT  —  Botron Dynamics
   All styles scoped under .bd-cookie-ui / #bd-cookie-banner /
   #bd-modal-overlay / #bd-toast — zero bleed risk.
   Root variables namespaced as --bd-*
════════════════════════════════════════════════════════════════ */

/* ── Reset (scoped) ── */
.cookie-consent *,
.cookie-consent *::before,
.cookie-consent *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens ── */
.cookie-consent {
  --bd-white:            #ffffff;
  --bd-bg-subtle:        #fafafa;
  --bd-border:           #e4e4e7;
  --bd-border-hover:     #d4d4d8;
  --bd-text:             #18181b;
  --bd-muted:            #71717a;
  --bd-accent:           #4f46e5;
  --bd-accent-hover:     #4338ca;
  --bd-accent-light:     #eef2ff;
  --bd-accent-border:    #c7d2fe;
  --bd-success:          #16a34a;
  --bd-success-bg:       #f0fdf4;
  --bd-success-border:   #bbf7d0;
  --bd-radius-sm:        6px;
  --bd-radius:           10px;
  --bd-radius-lg:        14px;
  --bd-radius-xl:        18px;
  --bd-shadow-sm:        0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --bd-shadow:           0 2px 8px rgba(0,0,0,.08), 0 4px 24px rgba(0,0,0,.06);
  --bd-shadow-modal:     0 8px 48px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  --bd-font:             'Montserrat', sans-serif;
  --bd-mono:             'Montserrat', sans-serif;
}


/* ════════════════════════════════════════════════
   BOTTOM BANNER
════════════════════════════════════════════════ */
#bd-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bd-white);
  border-top: 1px solid var(--bd-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.07), 0 -1px 4px rgba(0,0,0,.04);
  z-index: 1000;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--bd-font);
}
#bd-cookie-banner.bd-visible {
  transform: translateY(0);
}

.bd-banner-inner {
  max-width: var(--max-w, 1200px);
  width: 100%;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Cookie icon pill */
.bd-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--bd-radius);
  background: var(--bd-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bd-accent);
  flex-shrink: 0;
}

.bd-banner-text {
  flex: 1;
  min-width: 240px;
}
.bd-banner-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--bd-text);
  display: block;
  margin-bottom: 3px;
}
.bd-banner-text p {
  font-size: 13px;
  color: var(--bd-muted);
  line-height: 1.55;
}
.bd-banner-text a {
  color: var(--bd-accent);
  text-decoration: none;
}
.bd-banner-text a:hover { text-decoration: underline; }

.bd-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}


/* ════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════ */
.bd-btn {
  font-family: var(--bd-font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--bd-radius-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
  letter-spacing: -0.01em;
  outline-offset: 2px;
}
.bd-btn:focus-visible {
  outline: 2px solid var(--bd-accent);
  outline-offset: 2px;
}
.bd-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Primary */
.bd-btn-primary {
  background: var(--bd-accent);
  color: #fff;
  border-color: var(--bd-accent);
}
.bd-btn-primary:hover:not(:disabled) {
  background: var(--bd-accent-hover);
  border-color: var(--bd-accent-hover);
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}

/* Secondary */
.bd-btn-secondary {
  background: var(--bd-white);
  color: var(--bd-text);
  border-color: var(--bd-border);
}
.bd-btn-secondary:hover:not(:disabled) {
  border-color: var(--bd-border-hover);
  background: var(--bd-bg-subtle);
}

/* Ghost */
.bd-btn-ghost {
  background: transparent;
  color: var(--bd-muted);
  border-color: transparent;
  padding: 8px 14px;
}
.bd-btn-ghost:hover:not(:disabled) {
  color: var(--bd-text);
  background: #f4f4f5;
}


/* ════════════════════════════════════════════════
   MODAL OVERLAY
════════════════════════════════════════════════ */
#bd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  font-family: var(--bd-font);
}
#bd-modal-overlay.bd-visible {
  opacity: 1;
  pointer-events: all;
}

#bd-cookie-modal {
  background: var(--bd-white);
  border-radius: var(--bd-radius-lg);
  box-shadow: var(--bd-shadow-modal);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.99);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--bd-text);
  font-size: 14px;
  line-height: 1.5;
}
#bd-modal-overlay.bd-visible #bd-cookie-modal {
  transform: translateY(0) scale(1);
}


/* ── Modal header ── */
.bd-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--bd-border);
  flex-shrink: 0;
}

.bd-modal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bd-modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bd-modal-title-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bd-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bd-accent);
  flex-shrink: 0;
}

.bd-modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--bd-text);
  letter-spacing: -0.01em;
}

/* Close button — top-right of header */
.bd-modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--bd-radius-sm);
  border: 1px solid var(--bd-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bd-muted);
  transition: background .15s, color .15s, border-color .15s;
  padding: 0;
  flex-shrink: 0;
}
.bd-modal-close:hover {
  background: #f4f4f5;
  color: var(--bd-text);
  border-color: var(--bd-border-hover);
}
.bd-modal-close:focus-visible {
  outline: 2px solid var(--bd-accent);
  outline-offset: 2px;
}

.bd-modal-header p {
  font-size: 12.5px;
  color: var(--bd-muted);
  line-height: 1.6;
  padding-left: 42px; /* aligns under h2, past the icon */
}
.bd-modal-header a {
  color: var(--bd-accent);
  text-decoration: none;
}
.bd-modal-header a:hover { text-decoration: underline; }


/* ── Modal body (scrollable) ── */
.bd-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--bd-border) transparent;
}
.bd-modal-body::-webkit-scrollbar { width: 4px; }
.bd-modal-body::-webkit-scrollbar-track { background: transparent; }
.bd-modal-body::-webkit-scrollbar-thumb {
  background: var(--bd-border);
  border-radius: 4px;
}


/* ════════════════════════════════════════════════
   CATEGORY ROWS
════════════════════════════════════════════════ */
.bd-category {
  border-bottom: 1px solid var(--bd-border);
}
.bd-category--last,
.bd-category:last-child {
  border-bottom: none;
}

.bd-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 16px;
  background: var(--bd-white);
  transition: background .12s ease;
}
.bd-category-row:hover {
  background: #fafafa;
}

.bd-category-info { flex: 1; min-width: 0; }

.bd-category-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--bd-text);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

/* Tags */
.bd-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.bd-tag-required {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.bd-tag-optional {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.bd-category-desc {
  font-size: 12px;
  color: var(--bd-muted);
  line-height: 1.5;
}

/* Controls: expand chevron + toggle */
.bd-category-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Expand / chevron button */
.bd-expand-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--bd-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bd-muted);
  padding: 0;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.bd-expand-btn:hover,
.bd-expand-btn[aria-expanded="true"] {
  background: var(--bd-accent-light);
  color: var(--bd-accent);
  border-color: var(--bd-accent-border);
}
.bd-expand-btn:focus-visible {
  outline: 2px solid var(--bd-accent);
  outline-offset: 2px;
}

/* Chevron rotation */
.bd-chevron {
  display: block;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.bd-expand-btn[aria-expanded="true"] .bd-chevron {
  transform: rotate(180deg);
}


/* ── Toggle switch ── */
.bd-switch {
  position: relative;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  cursor: pointer;
}
.bd-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.bd-switch-track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 21px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.bd-switch-track::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.1);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.bd-switch input:checked + .bd-switch-track {
  background: var(--bd-accent);
}
.bd-switch input:checked + .bd-switch-track::after {
  transform: translateX(17px);
}
.bd-switch input:disabled + .bd-switch-track {
  cursor: not-allowed;
  background: #9ca3af;
  opacity: 0.7;
}
.bd-switch input:focus-visible + .bd-switch-track {
  outline: 2px solid var(--bd-accent);
  outline-offset: 2px;
  border-radius: 21px;
}


/* ════════════════════════════════════════════════
   EXPANDABLE DETAIL PANELS
════════════════════════════════════════════════ */
.bd-category-details {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bd-bg-subtle);
  border-top: 1px solid var(--bd-border);
    /* background-color: #e2e2e2; */
}
/* hidden attr managed by JS — CSS drives animation */
.bd-category-details.bd-details-open {
  max-height: 700px;
}

.bd-details-inner {
  padding: 14px 24px 18px;
}

.bd-details-intro {
  font-size: 12px;
  color: var(--bd-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.bd-details-intro strong {
  color: var(--bd-text);
  font-weight: 600;
}

/* Detail table */
.bd-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: var(--bd-text);
  margin-bottom: 12px;
  border: 1px solid var(--bd-border);
  border-radius: var(--bd-radius-sm);
  overflow: hidden;
}
.bd-details-table thead tr {
  background: #f0f0f4;
}
.bd-details-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--bd-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--bd-border);
}
.bd-details-table td {
  padding: 7px 10px;
  vertical-align: top;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.45;
}
.bd-details-table tbody tr:last-child td {
  border-bottom: none;
}
.bd-details-table tbody tr:hover td {
  background: #f4f4f6;
}
.bd-details-table td:first-child {
  width: 36%;
  white-space: nowrap;
}
.bd-details-table td:last-child {
  width: 15%;
  white-space: nowrap;
  color: var(--bd-muted);
}
.bd-details-table code {
  font-family: var(--bd-mono);
  font-size: 10.5px;
  background: #ededf2;
  color: var(--bd-accent);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid #dcdce4;
}

/* Detail note */
.bd-details-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--bd-muted);
  line-height: 1.5;
  background: var(--bd-accent-light);
  border-left: 3px solid var(--bd-accent);
  padding: 8px 11px;
  border-radius: 0 var(--bd-radius-sm) var(--bd-radius-sm) 0;
}
.bd-details-note svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--bd-accent);
}


/* ── Modal footer ── */
.bd-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--bd-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bd-white);
}


/* ════════════════════════════════════════════════
   RE-OPEN BUTTON  (placed wherever in your layout)
════════════════════════════════════════════════ */
#bd-reopen-btn {
  font-family: var(--bd-font);
  font-size: 12px;
  font-weight: 500;
  display: none;
  line-height: 1.5;
  color: var(--bd-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
#bd-reopen-btn:hover { color: var(--bd-text); }
#bd-reopen-btn.bd-show { display: inline-flex; align-items: center; gap: 5px; }


/* ════════════════════════════════════════════════
   TOAST
════════════════════════════════════════════════ */
#bd-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bd-accent);
  color: #fff;
  font-family: var(--bd-font);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--bd-radius);
  box-shadow: 0 4px 20px rgba(79,70,229,.35), 0 2px 6px rgba(0,0,0,.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}
#bd-toast::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
#bd-toast.bd-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .bd-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 14px;
  }
  .bd-banner-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .bd-banner-actions .bd-btn-primary {
    grid-column: span 2;
  }

  #bd-cookie-modal {
    max-height: 96vh;
    border-radius: var(--bd-radius) var(--bd-radius) 0 0;
  }
  #bd-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .bd-modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .bd-modal-footer .bd-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .bd-details-table td:first-child,
  .bd-details-table td:last-child {
    width: auto;
    white-space: normal;
  }

  .bd-modal-header p {
    padding-left: 0;
  }
}