/* =========================================================
   COOKIE CONSENT BANNER — i2C-Global
   Matches the site's dark/orange design language
   ========================================================= */

/* ── Banner overlay backdrop ── */
.cookie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.cookie-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Banner container ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9001;
  background: var(--bg-card, #1e293b);
  border-top: 1px solid rgba(232, 89, 12, 0.25);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  padding: 1.5rem clamp(1.25rem, 5%, 3.5rem);
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-banner.visible {
  transform: translateY(0);
}

/* ── Inner layout ── */
.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: center;
}

.cookie-text-block {
  min-width: 0;
}

.cookie-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8590c;
  margin-bottom: 0.55rem;
}
.cookie-eyebrow svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cookie-banner h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.45rem;
  line-height: 1.25;
  /* override global styles */
  padding: 0; border: none;
}
.cookie-banner p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  max-width: 680px;
}
.cookie-banner p a {
  color: #e8590c;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-banner p a:hover { text-decoration: none; }

/* ── Action buttons ── */
.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity 0.2s, background 0.2s, transform 0.15s;
}
.cookie-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cookie-btn:active { transform: translateY(0); }

.cookie-btn-accept {
  background: #e8590c;
  color: #fff;
}
.cookie-btn-accept:hover { background: #d14e0a; }

.cookie-btn-necessary {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.cookie-btn-necessary:hover {
  border-color: rgba(232, 89, 12, 0.5);
  color: #e8590c;
}

.cookie-btn-manage {
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.4rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
}
.cookie-btn-manage:hover { color: #e8590c; text-decoration: none; }

/* ── Preferences modal ── */
.cookie-prefs-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cookie-prefs-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.cookie-prefs-box {
  background: var(--bg-card, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(232,89,12,.3) transparent;
}
.cookie-prefs-modal.open .cookie-prefs-box {
  transform: scale(1) translateY(0);
}

.cookie-prefs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cookie-prefs-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin: 0;
  line-height: 1.3;
}
.cookie-prefs-header p {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  margin: 0.3rem 0 0;
  line-height: 1.5;
}

.cookie-prefs-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem;
  flex-shrink: 0;
  margin-top: -0.1rem;
  transition: color 0.2s;
}
.cookie-prefs-close:hover { color: #e8590c; }

/* Category rows */
.cookie-category {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}
.cookie-category:hover { border-color: rgba(232, 89, 12, 0.25); }

.cookie-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-category-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.cookie-category-desc {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

.cookie-badge-required {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e8590c;
  background: rgba(232, 89, 12, 0.12);
  border: 1px solid rgba(232, 89, 12, 0.25);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cookie-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.25s;
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.cookie-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.cookie-toggle input:checked + .cookie-toggle-track {
  background: #e8590c;
  border-color: #e8590c;
}
.cookie-toggle input:checked + .cookie-toggle-track::after {
  transform: translateX(20px);
}
.cookie-toggle input:focus-visible + .cookie-toggle-track {
  outline: 2px solid #e8590c;
  outline-offset: 2px;
}
.cookie-toggle input:disabled + .cookie-toggle-track {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Prefs footer buttons */
.cookie-prefs-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.cookie-prefs-footer .cookie-btn {
  flex: 1;
  min-width: 140px;
}

/* ── Dark mode support ── */
html.dark-mode .cookie-banner,
html.dark-mode .cookie-prefs-box {
  background: #0f172a;
}
html.dark-mode .cookie-category {
  border-color: rgba(255, 255, 255, 0.06);
}
html.dark-mode .cookie-category:hover {
  border-color: rgba(232, 89, 12, 0.3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cookie-inner {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .cookie-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .cookie-btn-accept,
  .cookie-btn-necessary {
    flex: 1;
    min-width: 130px;
  }
  .cookie-btn-manage {
    width: 100%;
    text-align: center;
  }
  .cookie-prefs-footer { flex-direction: column; }
  .cookie-prefs-footer .cookie-btn { flex: none; }
}

@media (max-width: 480px) {
  .cookie-banner { padding: 1.2rem 1.1rem; }
  .cookie-prefs-box { padding: 1.4rem 1.1rem; }
  .cookie-actions { flex-direction: column; }
  .cookie-btn-accept,
  .cookie-btn-necessary { width: 100%; }
}
