/* ══════════════════════════════════════════════════════════════════════
   Cookie Consent — consent-specific styles

   These styles handle the consent-specific content (text, buttons,
   toggles, preferences) regardless of which wrapper is used.

   When a theme provides a renderer via yaxNotify.render(), the theme
   handles positioning, card styling, and animation. These styles just
   handle the consent content inside.

   The --standalone section at the bottom provides a simple bottom bar
   for environments without a theme integration.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Content layout ──────────────────────────────────────────────────── */

.cookie-consent-content {
  flex: 1;
  min-width: 0;
}

.cookie-consent-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.cookie-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: 0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}

.cookie-consent-btn:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

.cookie-consent-btn--accept {
  background: #333;
  color: #fff;
}

.cookie-consent-btn--accept:hover {
  background: #555;
}

.cookie-consent-btn--reject,
.cookie-consent-btn--manage {
  background: rgba(0, 0, 0, 0.08);
  color: #333;
}

.cookie-consent-btn--reject:hover,
.cookie-consent-btn--manage:hover {
  background: rgba(0, 0, 0, 0.15);
}

.cookie-consent-btn--save {
  background: #333;
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
}

.cookie-consent-btn--save:hover {
  background: #555;
}

/* ── Preferences panel ───────────────────────────────────────────────── */

.cookie-consent-preferences {
  width: 100%;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-consent-category {
  margin-bottom: 1rem;
}

.cookie-consent-category-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}

.cookie-consent-category-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.cookie-consent-category-status {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.cookie-consent-category-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: #888;
  line-height: 1.5;
}

/* ── Toggle switch ───────────────────────────────────────────────────── */

.cookie-consent-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.cookie-consent-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-consent-toggle-track {
  width: 2.5rem;
  height: 1.375rem;
  background: #ccc;
  border-radius: 9999px;
  position: relative;
  transition: background 150ms ease;
}

.cookie-consent-toggle-track::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 150ms ease;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-track {
  background: #333;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-track::after {
  transform: translateX(1.125rem);
}

.cookie-consent-toggle input:focus-visible + .cookie-consent-toggle-track {
  outline: 2px solid #333;
  outline-offset: 2px;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 639px) {
  .cookie-consent-actions {
    flex-direction: column;
  }

  .cookie-consent-btn {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Standalone fallback — simple bottom bar with light overlay
   ══════════════════════════════════════════════════════════════════════ */

.cookie-consent--standalone {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 300ms ease, opacity 200ms ease;
}

.cookie-consent--standalone.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-consent--standalone.is-dismissing {
  transform: translateY(100%);
  opacity: 0;
}

.cookie-consent--standalone .cookie-consent-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 639px) {
  .cookie-consent--standalone .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent--standalone {
    transition: none;
  }
}
