/* =========================================================
   VLC HOMES — Cookie Consent Banner & Preferences Modal
   ========================================================= */

.cookie-banner{
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  max-width: 900px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.cookie-banner.is-visible{ transform: translateY(0); opacity: 1; }

.cookie-banner-text{ flex: 1 1 320px; }
.cookie-banner-text p{
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.cookie-banner-text a{ color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.cookie-banner-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 0 0 auto;
}
.cookie-banner-actions .btn{ padding: 0.7rem 1.2rem; font-size: 0.85rem; white-space: nowrap; }

/* ---------- Modal ---------- */
.cookie-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 310;
  background: rgba(43, 36, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.cookie-modal-overlay.is-visible{ opacity: 1; visibility: visible; }

.cookie-modal{
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.cookie-modal-overlay.is-visible .cookie-modal{ transform: translateY(0) scale(1); }

.cookie-modal-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.cookie-modal-header h2{ font-size: 1.35rem; margin-bottom: 0.2em; }
.cookie-modal-close{
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.cookie-modal-close:hover{ background: var(--accent-tint); color: var(--text); }

.cookie-modal-intro{ font-size: 0.88rem; color: var(--text-soft); margin-bottom: 1.5rem; }
.cookie-modal-intro a{ color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.cookie-category{
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.cookie-category-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-category-head h3{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0;
  color: var(--text);
}
.cookie-category p{
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.5;
}
.cookie-category-badge{
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--taupe);
}

/* Toggle switch */
.cookie-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-switch input{ position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cookie-switch-track{
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.25s var(--ease);
}
.cookie-switch-track::after{
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(43,36,32,0.25);
  transition: transform 0.25s var(--ease);
}
.cookie-switch input:checked + .cookie-switch-track{ background: var(--accent); }
.cookie-switch input:checked + .cookie-switch-track::after{ transform: translateX(18px); }
.cookie-switch input:disabled + .cookie-switch-track{ background: var(--taupe); opacity: 0.55; cursor: not-allowed; }
.cookie-switch input:focus-visible + .cookie-switch-track{ box-shadow: 0 0 0 3px var(--accent-tint); }

.cookie-modal-footer{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.cookie-modal-footer .btn{ flex: 1 1 auto; }

@media (max-width: 640px){
  .cookie-banner{ flex-direction: column; align-items: stretch; padding: 1.25rem; }
  .cookie-banner-actions{ flex-direction: column; }
  .cookie-banner-actions .btn{ width: 100%; }
  .cookie-modal{ padding: 1.5rem; }
}
