/* ================================
   Cookie Banner — Mobile-first
   Bottom Sheet (no blur)
   ================================ */

/* ================================
   Cookie Banner — Harmonised with site
   Mobile-first, clean look
================================ */
:root {
  --cb-bg: var(--card-bg, #ffffff);       /* matches site cards */
  --cb-text: var(--text-base, #1f2937);   /* main text */
  --cb-muted: var(--text-secondary, #6b7280); /* muted copy */
  --cb-border: var(--ring, rgba(0,0,0,.08));  /* subtle divider */
  --cb-primary: var(--primary-color, #6C3FA3); /* CTA purple */
  --cb-primary-600: color-mix(in srgb, var(--cb-primary), #000 12%);
  --cb-radius: 14px;
  --cb-shadow: var(--shadow, 0 6px 18px rgba(0,0,0,.08));
  --cb-maxw: 720px;
}

/* Container pinned to bottom with safe-area padding */
.cookie-banner{
  position: fixed;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 1000;
  font-size: 16px; /* readable on mobile */
  color: var(--cb-text);
}

/* Card */
.cookie-content{
  margin: 0 auto;
  max-width: var(--cb-maxw);
  background: var(--cb-bg);
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;

  /* slide-up on first show */
  transform: translateY(16px);
  opacity: 0;
  animation: cb-enter .25s ease-out forwards;
}
@keyframes cb-enter{
  to{ transform: translateY(0); opacity: 1; }
}

/* Copy */
.cookie-text{
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.cookie-text a{
  color: var(--cb-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Actions — single column on small screens, big tap targets */
.cookie-actions{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.cookie-actions .btn{
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  display: inline-block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--cb-border);
  background: #f8fafc;
  color: var(--cb-text);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, transform .06s ease, border-color .15s ease;
}
.cookie-actions .btn:active{ transform: translateY(1px) scale(0.995); }

.btn-primary{
  background: var(--cb-primary);
  border-color: var(--cb-primary);
  color: #fff;
}
.btn-primary:hover{ background: var(--cb-primary-600); }

.btn-secondary{
  background: transparent;
  color: var(--cb-text);
}

.btn-outline{
  background: transparent;
  color: var(--cb-muted);
}

/* Settings panel (accordion style) */
.cookie-panel{
  border: 1px dashed var(--cb-border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.cookie-panel .opt{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
}
.cookie-panel .opt:hover{ background: #f8fafc; }
.cookie-panel input[type="checkbox"]{
  width: 20px; height: 20px;
  accent-color: var(--cb-primary);
}

/* A11y focus */
.cookie-banner :is(a,button,input):focus-visible{
  outline: 2px solid var(--cb-primary);
  outline-offset: 2px;
  border-radius: 10px;
}

/* Utility */
.hidden{ display: none !important; }

/* =========================
   Tablet / Desktop tweaks
   ========================= */
@media (min-width: 700px){
  .cookie-content{
    padding: 16px 18px;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
  }
  .cookie-actions{
    grid-template-columns: repeat(3, auto);
    gap: 12px;
  }
  .cookie-actions .btn{ width: auto; padding: 12px 14px; }
  .cookie-panel{ grid-column: 1 / -1; }
}

/* Slim-bar variant for very small phones (optional) */
@media (max-width: 340px){
  .cookie-content{
    border-radius: 10px;
    padding: 10px;
  }
  .cookie-actions .btn{ padding: 12px; font-size: 0.95rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .cookie-content{ animation: none; transform: none; opacity: 1; }
  .cookie-actions .btn{ transition: none; }
}

/* =============================
   Desktop "strip" presentation
   ============================= */
@media (min-width: 960px){
  /* Pin edge-to-edge at bottom */
  .cookie-banner{
    left: 0;
    right: 0;
    bottom: 0;
  }

  /* Turn the card into a slim strip */
  .cookie-content{
    max-width: none;                 /* full width */
    border-radius: 0;                /* no rounded corners */
    box-shadow: none;                /* remove drop shadow */
    border: none;                    /* no outer border */
    border-top: 1px solid var(--cb-border, #e2e8f0);
    background: var(--cb-bg, #ffffff);
    padding: 10px 16px;              /* slimmer padding */
    display: grid;
    grid-template-columns: 1fr auto; /* text left, buttons right */
    align-items: center;
    gap: 14px;
  }

  /* Keep text tidy; truncate long lines gracefully */
  .cookie-text{
    font-size: 0.95rem;
    margin: 0;
  }
  .cookie-text a{
    text-underline-offset: 2px;
  }

  /* Inline actions, compact buttons */
  .cookie-actions{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px;
  }
  .cookie-actions .btn{
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
  }

  /* Settings panel drops below, full width */
  .cookie-panel{
    grid-column: 1 / -1;
    border-radius: 8px;
    margin-top: 6px;
  }
}

/* Optional ultra-compact strip for very large desktops */
@media (min-width: 1280px){
  .cookie-content{
    padding: 10px 24px;
  }
}