/* Rams GDPR Cookie Consent - Frontend Banner */

#rams-gdpr-root {
  font-family: var(--rams-gdpr-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#rams-gdpr-root *,
#rams-gdpr-root *::before,
#rams-gdpr-root *::after {
  box-sizing: border-box;
}

/* Strict mode — full site lock */
html.rams-gdpr-locked #rams-gdpr-root {
  pointer-events: auto !important;
}

.rams-gdpr-overlay[data-strict="true"] {
  background: var(--rams-gdpr-overlay, rgba(0, 0, 0, 0.75));
  z-index: var(--rams-gdpr-z);
  opacity: 1;
  pointer-events: auto;
}

.rams-gdpr-modal[data-strict="true"] {
  opacity: 1;
  pointer-events: auto;
}

.rams-gdpr-modal[data-strict="true"] .rams-gdpr-modal__panel {
  transform: none;
  text-align: center;
}

.rams-gdpr-modal[data-strict="true"] .rams-gdpr-modal__footer {
  justify-content: center;
}

.rams-gdpr-modal[data-strict="true"] .rams-gdpr-modal__intro {
  font-size: 0.95rem;
}

.rams-gdpr-modal[data-strict="true"] .rams-gdpr-banner__links {
  margin: 0.5rem 0 1rem;
}

.rams-gdpr-strict-notice {
  display: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  color: #991b1b;
  border-radius: calc(var(--rams-gdpr-radius) * 0.5);
  font-size: 0.85rem;
  text-align: center;
}

.rams-gdpr-strict-notice.is-visible {
  display: block;
}

.rams-gdpr-banner[data-strict="true"] {
  z-index: calc(var(--rams-gdpr-z) + 1);
}

/* Overlay */
.rams-gdpr-overlay {
  position: fixed;
  inset: 0;
  background: var(--rams-gdpr-overlay);
  z-index: calc(var(--rams-gdpr-z) - 1);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rams-gdpr-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Banner container */
.rams-gdpr-banner {
  position: fixed;
  z-index: var(--rams-gdpr-z);
  background: var(--rams-gdpr-bg);
  color: var(--rams-gdpr-text);
  border-radius: var(--rams-gdpr-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.5rem;
  max-width: var(--rams-gdpr-max-width);
  width: calc(100% - 2rem);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.rams-gdpr-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.rams-gdpr-banner[data-animation="fade"] {
  transform: none;
}

.rams-gdpr-banner[data-animation="none"] {
  transition: none;
  transform: none;
}

/* Positions */
.rams-gdpr-banner[data-position="bottom"] {
  bottom: 1rem;
  left: 50%;
  margin-left: calc(var(--rams-gdpr-max-width) / -2);
  max-width: min(var(--rams-gdpr-max-width), calc(100% - 2rem));
  width: min(var(--rams-gdpr-max-width), calc(100% - 2rem));
}

@media (max-width: 520px) {
  .rams-gdpr-banner[data-position="bottom"] {
    left: 1rem;
    margin-left: 0;
    width: calc(100% - 2rem);
    max-width: none;
  }
}

.rams-gdpr-banner[data-position="top"] {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: min(var(--rams-gdpr-max-width), calc(100% - 2rem));
}

.rams-gdpr-banner[data-position="top"].is-visible {
  transform: translateX(-50%) translateY(0);
}

.rams-gdpr-banner[data-position="bottom-left"] {
  bottom: 1rem;
  left: 1rem;
}

.rams-gdpr-banner[data-position="bottom-right"] {
  bottom: 1rem;
  right: 1rem;
}

/* Bar layout - full width */
.rams-gdpr-banner[data-layout="bar"] {
  border-radius: 0;
  width: 100%;
  max-width: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__content {
  flex: 1;
  min-width: 200px;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__actions {
  flex-shrink: 0;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__actions--left {
  flex-shrink: 0;
  order: -1;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__content {
  order: 0;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__actions:not(.rams-gdpr-banner__actions--left) {
  order: 1;
}

/* Typography */
.rams-gdpr-banner__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rams-gdpr-text);
}

.rams-gdpr-banner__message {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--rams-gdpr-text);
  opacity: 0.85;
}

.rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__message {
  margin-bottom: 0;
}

.rams-gdpr-banner__links {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.rams-gdpr-banner__links a,
.rams-gdpr-policy-link {
  color: var(--rams-gdpr-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rams-gdpr-policy-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.rams-gdpr-policy-link:hover {
  opacity: 0.8;
}

.rams-gdpr-banner__links a:hover {
  opacity: 0.8;
}

.rams-gdpr-banner__links span {
  margin: 0 0.4rem;
  opacity: 0.4;
}

/* Buttons */
.rams-gdpr-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rams-gdpr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: calc(var(--rams-gdpr-radius) * 0.75);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}

.rams-gdpr-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.rams-gdpr-btn:active {
  transform: translateY(0);
}

.rams-gdpr-btn--primary {
  background: var(--rams-gdpr-primary);
  color: var(--rams-gdpr-primary-text);
}

.rams-gdpr-btn--secondary {
  background: var(--rams-gdpr-secondary);
  color: var(--rams-gdpr-secondary-text);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.rams-gdpr-btn--ghost {
  background: transparent;
  color: var(--rams-gdpr-text);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Policy document modal */
.rams-gdpr-doc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: calc(var(--rams-gdpr-z) + 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rams-gdpr-doc-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rams-gdpr-doc-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--rams-gdpr-z) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rams-gdpr-doc-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rams-gdpr-doc-modal__panel {
  background: var(--rams-gdpr-bg);
  color: var(--rams-gdpr-text);
  border-radius: var(--rams-gdpr-radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  width: 100%;
  max-width: 720px;
  max-height: min(90vh, 860px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.3s ease;
}

.rams-gdpr-doc-modal.is-visible .rams-gdpr-doc-modal__panel {
  transform: scale(1) translateY(0);
}

.rams-gdpr-doc-modal__header {
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.rams-gdpr-doc-modal__header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.rams-gdpr-doc-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--rams-gdpr-text);
  opacity: 0.5;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.rams-gdpr-doc-modal__close:hover {
  opacity: 1;
  background: var(--rams-gdpr-secondary);
}

.rams-gdpr-doc-modal__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

.rams-gdpr-doc-modal__body h1,
.rams-gdpr-doc-modal__body h2,
.rams-gdpr-doc-modal__body h3,
.rams-gdpr-doc-modal__body h4 {
  margin: 1.25rem 0 0.75rem;
  line-height: 1.3;
}

.rams-gdpr-doc-modal__body h1:first-child,
.rams-gdpr-doc-modal__body h2:first-child,
.rams-gdpr-doc-modal__body h3:first-child {
  margin-top: 0;
}

.rams-gdpr-doc-modal__body p,
.rams-gdpr-doc-modal__body ul,
.rams-gdpr-doc-modal__body ol {
  margin: 0 0 1rem;
}

.rams-gdpr-doc-modal__body a {
  color: var(--rams-gdpr-accent);
}

.rams-gdpr-doc-modal__body iframe {
  width: 100%;
  min-height: 60vh;
  border: 0;
  border-radius: calc(var(--rams-gdpr-radius) * 0.5);
}

.rams-gdpr-doc-modal__loading {
  text-align: center;
  opacity: 0.6;
  padding: 2rem 0;
  margin: 0;
}

.rams-gdpr-doc-modal__footer {
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Modal */
.rams-gdpr-modal {
  position: fixed;
  inset: 0;
  z-index: var(--rams-gdpr-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rams-gdpr-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.rams-gdpr-modal__panel {
  background: var(--rams-gdpr-bg);
  color: var(--rams-gdpr-text);
  border-radius: var(--rams-gdpr-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s ease;
}

.rams-gdpr-modal.is-visible .rams-gdpr-modal__panel {
  transform: scale(1) translateY(0);
}

.rams-gdpr-modal__header {
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.rams-gdpr-modal__header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.rams-gdpr-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--rams-gdpr-text);
  opacity: 0.5;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.rams-gdpr-modal__close:hover {
  opacity: 1;
  background: var(--rams-gdpr-secondary);
}

.rams-gdpr-modal__intro {
  padding: 0 1.5rem 1rem;
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0;
}

.rams-gdpr-modal__links {
  padding: 0 1.5rem 1rem;
  margin-top: -0.25rem;
}

.rams-gdpr-modal__body {
  padding: 0 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.rams-gdpr-modal__footer {
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Category toggles */
.rams-gdpr-category {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.rams-gdpr-category:last-child {
  border-bottom: none;
}

.rams-gdpr-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rams-gdpr-category__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.rams-gdpr-category__desc {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

.rams-gdpr-category__badge {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rams-gdpr-accent);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Toggle switch */
.rams-gdpr-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.rams-gdpr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.rams-gdpr-toggle__track {
  position: absolute;
  inset: 0;
  background: var(--rams-gdpr-toggle-off);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.rams-gdpr-toggle__track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rams-gdpr-toggle input:checked + .rams-gdpr-toggle__track {
  background: var(--rams-gdpr-toggle-on);
}

.rams-gdpr-toggle input:checked + .rams-gdpr-toggle__track::after {
  transform: translateX(20px);
}

.rams-gdpr-toggle input:disabled + .rams-gdpr-toggle__track {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Floating reopen button */
.rams-gdpr-reopen {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: calc(var(--rams-gdpr-z) - 2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rams-gdpr-primary);
  color: var(--rams-gdpr-primary-text);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
}

.rams-gdpr-reopen:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.rams-gdpr-reopen svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Shortcode link */
.rams-gdpr-preferences-link {
  background: none;
  border: none;
  color: var(--rams-gdpr-accent, inherit);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rams-gdpr-banner,
  .rams-gdpr-overlay,
  .rams-gdpr-doc-overlay,
  .rams-gdpr-doc-modal,
  .rams-gdpr-doc-modal__panel,
  .rams-gdpr-modal,
  .rams-gdpr-modal__panel,
  .rams-gdpr-btn,
  .rams-gdpr-reopen {
    transition: none !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .rams-gdpr-banner__actions {
    flex-direction: column;
  }

  .rams-gdpr-btn {
    width: 100%;
  }

  .rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .rams-gdpr-banner[data-layout="bar"] .rams-gdpr-banner__message {
    margin-bottom: 0.75rem;
  }
}
