/* ════════════════════════════════════════════════════════════
   ADDONS — Popup Modal + Cookie Banner
   Design: matches ef-v3 glass aesthetic
   Append to base.css OR include separately after base.css
═════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   POPUP / MODAL
═════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.7); }

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-tint, #faf6ee);
  color: var(--text);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.45));
  border-radius: 8px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 64px -12px rgba(40, 30, 20, 0.30),
    0 8px 24px -4px rgba(40, 30, 20, 0.16);
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.45s var(--ease-out), opacity 0.35s var(--ease-out);
  position: relative;
}

[data-theme="dark"] .modal {
  background: var(--bg-tint, #1c1a15);
  border-color: var(--line, rgba(255,255,255,0.10));
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Top accent line */
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Modal header */
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 36px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-head-text { flex: 1; min-width: 0; }

.modal-eyebrow {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.modal-title em { font-style: italic; color: var(--gold); font-weight: 500; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface, rgba(255,255,255,0.55));
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--gold-light, rgba(201,164,100,0.18));
  color: var(--gold);
  border-color: var(--gold);
}

/* Modal body */
.modal-body {
  padding: 28px 36px 32px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

.modal-body p + p { margin-top: 14px; }

.modal-body strong { color: var(--text); font-weight: 600; }

.modal-body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}

.modal-body ul, .modal-body ol {
  margin: 14px 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-body a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-light, rgba(201,164,100,0.4));
  transition: border-color 0.2s;
}

.modal-body a:hover { border-bottom-color: var(--gold); }

/* Modal footer (actions) */
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 36px 28px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-foot.split { justify-content: space-between; }

/* Modal sizes */
.modal.small  { max-width: 440px; }
.modal.large  { max-width: 720px; }
.modal.xlarge { max-width: 880px; }

/* Modal scrollbar styling */
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--line-2, rgba(0,0,0,0.15)); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: var(--gold); }

@media (max-width: 600px) {
  .modal { max-height: 92vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 24px; padding-right: 24px; }
  .modal-title { font-size: 22px; }
  .modal-foot { flex-direction: column; align-items: stretch; }
  .modal-foot .btn { width: 100%; justify-content: center; }
}


/* ════════════════════════════════════════════════════════════
   COOKIE BANNER (bottom slide-up bar)
═════════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(20, 20, 25, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: #f5f3ee;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.40);
  transform: translateY(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.55s var(--ease-out), opacity 0.4s var(--ease-out);
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(201, 164, 100, 0.14);
  border: 1px solid rgba(201, 164, 100, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cookie-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cookie-banner-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 224, 200, 0.55);
}

.cookie-banner-msg {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(232, 224, 200, 0.88);
}

.cookie-banner-msg a {
  color: var(--gold, #c9a464);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,164,100,0.4);
  transition: border-color 0.2s;
  cursor: pointer;
}

.cookie-banner-msg a:hover { border-bottom-color: var(--gold, #c9a464); }

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.cookie-btn-secondary {
  background: transparent;
  color: rgba(232, 224, 200, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
}

.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f5f3ee;
  border-color: rgba(255, 255, 255, 0.20);
}

.cookie-btn-primary {
  background: var(--gold, #c9a464);
  color: #18181d;
  border-color: var(--gold, #c9a464);
}

.cookie-btn-primary:hover {
  background: var(--gold-2, #e0b876);
  border-color: var(--gold-2, #e0b876);
  transform: translateY(-1px);
}

@media (max-width: 700px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px;
    bottom: 16px;
    left: 16px;
    right: 16px;
  }
  .cookie-banner-icon { display: none; }
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1; justify-content: center; }
}

/* Cookie settings: in modal — toggle rows */
.cookie-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.cookie-row:first-child { border-top: 1px solid var(--line); }
.cookie-row:last-child { border-bottom: none; }

.cookie-row-text { flex: 1; min-width: 0; }

.cookie-row-name {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 4px;
}

.cookie-row-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border-radius: 100px;
  background: var(--line-2, rgba(0,0,0,0.15));
  cursor: pointer;
  transition: background 0.25s;
}

.cookie-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.25s var(--ease);
}

.cookie-toggle.on {
  background: var(--gold, #c9a464);
}

.cookie-toggle.on::before {
  transform: translateX(18px);
}

.cookie-toggle.locked {
  background: var(--gold-light, rgba(201,164,100,0.4));
  cursor: not-allowed;
}

.cookie-toggle.locked::before {
  background: var(--gold, #c9a464);
  transform: translateX(18px);
}

.cookie-row-required {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
  display: inline-block;
}