/* Consent layer for the static Smart Gyms pages — same shape as the layer on
   www.smart-gyms.com: centred card on desktop, bottom sheet on phones. */

.sg-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(2, 7, 6, 0.72);
  backdrop-filter: blur(6px);
}

.sg-consent-layer {
  position: fixed;
  z-index: 999;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(560px, calc(100vw - 40px));
  max-height: min(84vh, 720px);
  padding: 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line, #28534b);
  border-radius: 22px;
  background: #061412;
  box-shadow: var(--shadow, 0 34px 90px rgba(0, 0, 0, 0.36));
  color: var(--white, #f8fbfa);
  font-family: inherit;
}

/* In the settings view only the purposes scroll, so the buttons stay reachable. */
.sg-consent-layer.is-settings {
  width: min(680px, calc(100vw - 40px));
  overflow: hidden;
}

.is-settings .sg-consent-purposes {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sg-consent-layer h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sg-consent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sg-consent-copy {
  margin: 0;
  color: var(--muted-2, #c6d2cf);
  font-size: 15px;
  line-height: 1.55;
}

.sg-consent-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #91a39e);
  font-size: 15px;
  cursor: pointer;
}

.sg-consent-close:hover {
  border-color: var(--mint, #91cec6);
  color: var(--mint, #91cec6);
}

.sg-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Reject and accept carry the same weight, as the law asks for. */
.sg-consent-btn {
  flex: 1 1 160px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.sg-consent-btn.primary {
  border: 0;
  background: var(--mint, #91cec6);
  color: #08110f;
}

.sg-consent-btn.ghost {
  border: 1px solid var(--line, #28534b);
  background: transparent;
  color: var(--white, #f8fbfa);
}

.sg-consent-btn.ghost:hover {
  border-color: var(--mint, #91cec6);
  color: var(--mint, #91cec6);
}

.sg-consent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
}

.sg-consent-links a,
.sg-consent-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted, #91a39e);
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.sg-consent-links a:hover,
.sg-consent-link:hover {
  color: var(--mint, #91cec6);
}

.sg-consent-purposes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sg-consent-purpose {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.sg-purpose-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sg-purpose-copy h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.sg-purpose-copy p {
  margin: 0;
  color: var(--muted, #91a39e);
  font-size: 13px;
  line-height: 1.5;
}

.sg-purpose-toggle {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint, #91cec6);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sg-vendor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}

.sg-vendor-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2, #c6d2cf);
  font-size: 14px;
}

.sg-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.sg-switch.small {
  width: 40px;
  height: 24px;
}

.sg-switch.on {
  border-color: transparent;
  background: var(--mint, #91cec6);
}

.sg-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s;
}

.sg-switch.small .sg-knob {
  width: 16px;
  height: 16px;
}

.sg-switch.on .sg-knob {
  transform: translateX(20px);
}

.sg-switch.small.on .sg-knob {
  transform: translateX(16px);
}

.sg-always-on {
  flex-shrink: 0;
  color: var(--mint, #91cec6);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Phones: a bottom sheet instead of a centred card. */
@media (max-width: 767px) {
  .sg-consent-layer,
  .sg-consent-layer.is-settings {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 88vh;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    transform: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .sg-consent-btn {
    flex: 1 1 100%;
  }

  .is-settings .sg-consent-actions .sg-consent-btn {
    flex: 1 1 calc(50% - 5px);
  }

  .is-settings .sg-consent-actions .sg-consent-btn.save {
    order: 1;
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-knob {
    transition: none;
  }
}

.sg-vendor-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.sg-vendor-name a {
  color: var(--muted, #91a39e);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
