/* fe-shared-state — consent.css
 *
 * The fitness.ee banner styling, PORTED from turg's
 * ui/src/components/CookieConsentBanner.css so BOTH domains look identical.
 * Self-contained: turg's design tokens (--mf-*) are kept as var() with literal
 * fallbacks, because fitness.ee's WordPress theme won't define them — the
 * fallbacks reproduce turg's actual values. All selectors are prefixed with the
 * banner classes so this can't leak into the WP theme.
 *
 * Source of truth for the look: turg's CookieConsentBanner.css. Keep in sync.
 */

/* Bottom sticky bar */
.cookie-consent-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  animation: feSharedSlideUp 0.4s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@keyframes feSharedSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-consent-banner {
  background: var(--mf-surface, #fff);
  border-top: 3px solid var(--mf-accent, #005db9);
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(15, 18, 24, 0.18);
  box-sizing: border-box;
}

.cookie-consent-banner * { box-sizing: border-box; }

/* Compact dock layout (summary state) */
.consent-dock {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 28px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 20px;
  align-items: center;
}

.consent-dock-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent-dock-body { min-width: 0; }

.consent-dock-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--mf-text-strong, #0f1111);
  line-height: 1.3;
}

.consent-dock-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mf-muted-2, #565959);
}

.consent-dock-link {
  color: var(--mf-info-link, #005db9);
  text-decoration: none;
}
.consent-dock-link:hover {
  color: var(--mf-info-link-hover, #c7511f);
  text-decoration: underline;
}

.consent-dock-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.consent-dock-actions .consent-btn {
  flex: 0 0 auto;
  min-width: 0;
  height: 44px;
  padding: 0 22px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .consent-dock {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 12px 16px;
    padding: 16px 20px;
  }
  .consent-dock-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .consent-dock-actions .consent-btn { flex: 1 1 auto; min-width: 100px; }
}

@media (max-width: 480px) {
  .consent-dock {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 14px 16px;
    gap: 12px;
  }
  .consent-dock-icon { width: 32px; height: 32px; }
  .consent-dock-icon svg { width: 32px; height: 32px; }
  .consent-dock-title { font-size: 14px; }
  .consent-dock-text { font-size: 12px; }
  .consent-dock-actions .consent-btn { flex: 1 1 auto; height: 40px; padding: 0 14px; font-size: 13px; }
}

/* Body (customize view container) */
.consent-body { padding: 2rem; }

.consent-description {
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
  color: #333;
  font-size: 0.938rem;
}

/* Buttons */
.consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.consent-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--mf-radius-lg, 8px);
  font-size: 0.938rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1;
}

.consent-btn-accept {
  background: var(--mf-accent, #005db9);
  color: #fff;
  box-shadow: var(--mf-shadow-primary, 0 2px 5px rgba(0, 93, 185, 0.2));
}
.consent-btn-accept:hover {
  background: var(--mf-accent-hover, #174b80);
  box-shadow: var(--mf-shadow-primary-hi, 0 4px 8px rgba(0, 93, 185, 0.3));
  transform: translateY(-1px);
}

.consent-btn-reject {
  background: var(--mf-surface, #fff);
  color: var(--mf-accent, #005db9);
  border-color: var(--mf-accent, #005db9);
}
.consent-btn-reject:hover { background: var(--mf-accent-tint, #eaf2fb); }

.consent-btn-customize {
  background: #f7f8f8;
  color: #2c3847;
  border: 1px solid var(--mf-border-soft, #d5d9d9);
}
.consent-btn-customize:hover { background: #eef0f2; border-color: #bfc4c4; }

.consent-btn-save {
  background: var(--mf-accent, #005db9);
  color: #fff;
  box-shadow: var(--mf-shadow-primary, 0 2px 5px rgba(0, 93, 185, 0.2));
}
.consent-btn-save:hover {
  background: var(--mf-accent-hover, #174b80);
  box-shadow: var(--mf-shadow-primary-hi, 0 4px 8px rgba(0, 93, 185, 0.3));
  transform: translateY(-1px);
}

.consent-btn-back {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}
.consent-btn-back:hover { background: #e8e8e8; }

.consent-btn:focus {
  outline: 2px solid #005db9;
  outline-offset: 2px;
}

/* Categories (customize view) */
.consent-categories {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.consent-category {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}
.consent-category:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.consent-category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.consent-category-info { flex: 1; }
.consent-category-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #232f3e;
}
.consent-category-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #666;
}

/* Toggle switch */
.consent-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.consent-toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.consent-toggle input:checked + .toggle-slider { background-color: #005db9; }
.consent-toggle input:checked + .toggle-slider::before { transform: translateX(22px); }
.consent-toggle input:disabled + .toggle-slider {
  background-color: #005db9;
  opacity: 0.6;
  cursor: not-allowed;
}
.toggle-slider.disabled { cursor: not-allowed; }
.consent-toggle:focus-within .toggle-slider {
  box-shadow: 0 0 0 3px rgba(0, 93, 185, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
  .cookie-consent-banner { max-height: 80vh; }
  .consent-body { padding: 1.25rem; }
  .consent-actions { flex-direction: column; }
  .consent-btn { width: 100%; min-width: auto; }
  .consent-category-header { gap: 0.75rem; }
  .consent-category { padding: 0.875rem; }
  .consent-category-info h3 { font-size: 0.938rem; }
  .consent-category-desc { font-size: 0.813rem; }
}

@media (max-width: 480px) {
  .cookie-consent-banner { max-height: 90vh; }
  .consent-body { padding: 1rem; }
  .consent-description { font-size: 0.813rem; margin-bottom: 1rem; }
  .consent-categories { gap: 0.75rem; }
}

/* Scrollbar */
.cookie-consent-banner::-webkit-scrollbar { width: 8px; }
.cookie-consent-banner::-webkit-scrollbar-track { background: #f1f1f1; }
.cookie-consent-banner::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.cookie-consent-banner::-webkit-scrollbar-thumb:hover { background: #555; }
