/* SoundGlow consent banner — Cookiebot-style modal
 * 4 categories (necessary / preferences / statistics / marketing)
 * Center modal with backdrop. Bilingual via SGConsent JS.
 *
 * Naming convention: .sgc-* (SoundGlow Consent) to avoid colliding with
 * any of the existing .cart, .checkout, .nav classes.
 */

.sgc-root {
  position: fixed;
  inset: 0;
  z-index: 2147483600; /* above Stripe (2147483640+) deliberately not — Stripe is higher; but cart drawer is 9999 so we beat that */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sgc-root.is-open {
  display: flex;
}

.sgc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sgc-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  background: #ffffff;
  color: #111;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sgc-pop 220ms cubic-bezier(.2,.9,.3,1.2);
}

@keyframes sgc-pop {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.sgc-header {
  padding: 22px 24px 8px;
}
.sgc-title {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sgc-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #3a3a44;
}
.sgc-intro a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sgc-body {
  padding: 0 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.sgc-categories {
  margin: 16px 0 8px;
  display: none; /* hidden in summary view */
  flex-direction: column;
  gap: 10px;
}
.sgc-root[data-view="details"] .sgc-categories { display: flex; }
.sgc-root[data-view="details"] .sgc-intro     { display: none; }

.sgc-cat {
  border: 1px solid #e6e6ec;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafc;
}
.sgc-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sgc-cat-name {
  font-weight: 600;
  font-size: 14px;
  color: #111;
}
.sgc-cat-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
}

/* Toggle switch */
.sgc-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
}
.sgc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.sgc-slider {
  position: absolute;
  inset: 0;
  background: #d0d0d8;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease;
}
.sgc-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.sgc-switch input:checked + .sgc-slider { background: #111; }
.sgc-switch input:checked + .sgc-slider::after { transform: translateX(18px); }
.sgc-switch input:disabled + .sgc-slider {
  background: #2d7a3a;
  cursor: not-allowed;
  opacity: 0.85;
}
.sgc-switch input:disabled + .sgc-slider::after { transform: translateX(18px); }

.sgc-cat-locked {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2d7a3a;
  margin-left: 8px;
}

.sgc-footer {
  padding: 14px 24px 22px;
  border-top: 1px solid #ececf2;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fafafc;
}
.sgc-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
.sgc-btn-primary {
  background: #111;
  color: #fff;
}
.sgc-btn-primary:hover { background: #000; }
.sgc-btn-secondary {
  background: #fff;
  color: #111;
  border-color: #d0d0d8;
}
.sgc-btn-secondary:hover { border-color: #111; }
.sgc-btn-link {
  flex: 0 0 auto;
  background: transparent;
  color: #555;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
  min-height: 44px;
  padding: 0 8px;
  font-weight: 500;
}
.sgc-btn-link:hover { color: #111; }

/* In details view, the action row collapses (only Save + back link) */
.sgc-root[data-view="details"] .sgc-btn-accept-all,
.sgc-root[data-view="details"] .sgc-btn-reject-all,
.sgc-root[data-view="details"] .sgc-btn-customize {
  display: none;
}
.sgc-root[data-view="summary"] .sgc-btn-save-prefs,
.sgc-root[data-view="summary"] .sgc-btn-back {
  display: none;
}

/* Mobile */
@media (max-width: 480px) {
  .sgc-root { padding: 0; align-items: flex-end; }
  .sgc-modal {
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    max-height: 90vh;
    animation: sgc-slide-up 240ms cubic-bezier(.2,.9,.3,1.2);
  }
  @keyframes sgc-slide-up {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .sgc-footer { padding: 12px 16px 18px; }
  .sgc-header { padding: 20px 16px 4px; }
  .sgc-body   { padding: 0 16px; }
  .sgc-btn    { flex: 1 1 100%; }
  .sgc-btn-link { flex: 1 1 100%; text-align: center; }
}

/* Footer link to re-open in nav (already styled by site, this is a no-op
   safeguard so the link is always clickable even when JS-only opacity:0.6
   was applied previously). */
#cookie-settings-btn { cursor: pointer; opacity: 1 !important; }
