/* ==========================================================================
   FLUID UI SHELL - COMBINED STYLES
   Header and Footer components for Savant Realms applications
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (THEME VARIABLES)
   ========================================================================== */

:root {
  /* Font */
  --sr-font-family: 'Space Grotesk', 'Avenir Next', 'Helvetica Neue', Arial, sans-serif;

  /* Header - Light theme */
  --sr-header-bg: linear-gradient(135deg, #f7f2e8, #f2f7ff);
  --sr-header-surface: #ffffff;
  --sr-header-global-bg: rgba(247, 242, 232, 0.05);
  --sr-header-app-bg: rgba(255, 255, 255, 0.1);
  --sr-header-breadcrumbs-bg: rgba(247, 242, 232, 0.2);
  --sr-header-backdrop: blur(20px) saturate(160%);
  --sr-header-text: #1a1f2b;
  --sr-header-muted: #5b6572;
  --sr-header-accent: #ff6a3d;
  --sr-header-border: rgba(26, 31, 43, 0.12);
  --sr-header-shadow: 0 10px 30px rgba(13, 18, 31, 0.08);
  --sr-card-bg: #ffffff;
  --sr-card-border: rgba(26, 31, 43, 0.12);
  --sr-card-muted: #5b6572;
  --sr-card-shadow: 0 18px 40px rgba(13, 18, 31, 0.12);
  --sr-radius-sm: 10px;
  --sr-radius-md: 16px;
  --sr-global-icon-size: 42px;
  --sr-global-border-height: calc(var(--sr-global-icon-size) * 2 / 3);
  --sr-header-icon-bg: var(--sr-card-bg);
  --sr-header-icon-border: var(--sr-card-border);
  --sr-header-icon-shadow: var(--sr-header-shadow);
  --sr-header-offset: 0px;

  /* Footer - Light theme */
  --sr-footer-bg: linear-gradient(135deg, rgba(247, 242, 232, 0.2), rgba(242, 247, 255, 0.2));
  --sr-footer-backdrop: blur(20px) saturate(160%);
  --sr-footer-surface: rgba(255, 255, 255, 0.18);
  --sr-footer-text: #1a1f2b;
  --sr-footer-text-secondary: #5b6572;
  --sr-footer-muted: #8b95a5;
  --sr-footer-accent: #ff6a3d;
  --sr-footer-border: rgba(26, 31, 43, 0.1);
  --sr-footer-shadow: 0 -4px 24px rgba(13, 18, 31, 0.06);
  --sr-footer-link-hover-bg: rgba(26, 31, 43, 0.05);
  --sr-footer-dropdown-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);

  /* Footer Typography */
  --sr-footer-font-size-xs: 0.6875rem;
  --sr-footer-font-size-sm: 0.75rem;
  --sr-footer-font-size-base: 0.8125rem;

  /* Footer Spacing */
  --sr-footer-spacing-xs: 0.2rem;
  --sr-footer-spacing-sm: 0.375rem;
  --sr-footer-spacing-md: 0.75rem;
  --sr-footer-spacing-lg: 1rem;
  --sr-footer-spacing-xl: 1.25rem;

  /* Footer Radius */
  --sr-footer-radius-sm: 4px;
  --sr-footer-radius-md: 8px;
  --sr-footer-radius-lg: 12px;

  /* Footer Transitions */
  --sr-footer-transition-fast: 150ms ease;
  --sr-footer-transition-normal: 200ms ease;

  /* Footer Height */
  --sr-footer-height: 52px;
  --sr-footer-offset: var(--sr-footer-height);
}

/* Explicit light theme (user selected light) */
[data-theme='light'] {
  color-scheme: light;
  /* Same as :root so selection overrides system dark */
  --sr-header-bg: linear-gradient(135deg, #f7f2e8, #f2f7ff);
  --sr-header-surface: #ffffff;
  --sr-header-global-bg: rgba(247, 242, 232, 0.05);
  --sr-header-app-bg: rgba(255, 255, 255, 0.1);
  --sr-header-breadcrumbs-bg: rgba(247, 242, 232, 0.2);
  --sr-header-text: #1a1f2b;
  --sr-header-muted: #5b6572;
  --sr-header-border: rgba(26, 31, 43, 0.12);
  --sr-card-bg: #ffffff;
  --sr-card-border: rgba(26, 31, 43, 0.12);
  --sr-card-muted: #5b6572;
  --sr-header-icon-bg: var(--sr-card-bg);
  --sr-header-icon-border: var(--sr-card-border);
  --sr-footer-bg: linear-gradient(135deg, rgba(247, 242, 232, 0.2), rgba(242, 247, 255, 0.2));
  --sr-footer-surface: rgba(255, 255, 255, 0.18);
  --sr-footer-text: #1a1f2b;
  --sr-footer-text-secondary: #5b6572;
  --sr-footer-muted: #8b95a5;
  --sr-footer-border: rgba(26, 31, 43, 0.1);
  --sr-footer-link-hover-bg: rgba(26, 31, 43, 0.05);
}

/* Dark theme (user selected dark) */
[data-theme='dark'] {
  color-scheme: dark;
  /* Header - Dark */
  --sr-header-bg: linear-gradient(135deg, #0b1020, #0f172a);
  --sr-header-surface: #0f172a;
  --sr-header-global-bg: rgba(11, 16, 32, 0.05);
  --sr-header-app-bg: rgba(15, 23, 42, 0.1);
  --sr-header-breadcrumbs-bg: rgba(11, 16, 32, 0.2);
  --sr-header-text: #f1f5f9;
  --sr-header-muted: #a8b3cc;
  --sr-header-border: rgba(148, 163, 184, 0.24);
  --sr-header-shadow: 0 14px 32px rgba(2, 6, 23, 0.55);
  --sr-card-bg: #111827;
  --sr-card-border: rgba(148, 163, 184, 0.18);
  --sr-card-muted: #94a3b8;
  --sr-card-shadow: 0 20px 44px rgba(2, 6, 23, 0.6);
  --sr-header-icon-bg: #24324a;
  --sr-header-icon-border: rgba(203, 213, 225, 0.4);
  --sr-header-icon-shadow: 0 12px 26px rgba(2, 6, 23, 0.55);

  /* Footer - Dark */
  --sr-footer-bg: linear-gradient(135deg, rgba(11, 16, 32, 0.2), rgba(15, 23, 42, 0.2));
  --sr-footer-surface: rgba(15, 23, 42, 0.18);
  --sr-footer-text: #f1f5f9;
  --sr-footer-text-secondary: #a8b3cc;
  --sr-footer-muted: #64748b;
  --sr-footer-border: rgba(148, 163, 184, 0.14);
  --sr-footer-shadow: 0 -4px 24px rgba(2, 6, 23, 0.3);
  --sr-footer-link-hover-bg: rgba(148, 163, 184, 0.08);
  --sr-footer-dropdown-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

/* System prefers dark and no user override */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --sr-header-bg: linear-gradient(135deg, #0b1020, #0f172a);
    --sr-header-surface: #0f172a;
    --sr-header-global-bg: rgba(11, 16, 32, 0.05);
    --sr-header-app-bg: rgba(15, 23, 42, 0.1);
    --sr-header-breadcrumbs-bg: rgba(11, 16, 32, 0.2);
    --sr-header-text: #f1f5f9;
    --sr-header-muted: #a8b3cc;
    --sr-header-border: rgba(148, 163, 184, 0.24);
    --sr-header-shadow: 0 14px 32px rgba(2, 6, 23, 0.55);
    --sr-card-bg: #111827;
    --sr-card-border: rgba(148, 163, 184, 0.18);
    --sr-card-muted: #94a3b8;
    --sr-card-shadow: 0 20px 44px rgba(2, 6, 23, 0.6);
    --sr-header-icon-bg: #24324a;
    --sr-header-icon-border: rgba(203, 213, 225, 0.4);
    --sr-header-icon-shadow: 0 12px 26px rgba(2, 6, 23, 0.55);
    --sr-footer-bg: linear-gradient(135deg, rgba(11, 16, 32, 0.2), rgba(15, 23, 42, 0.2));
    --sr-footer-surface: rgba(15, 23, 42, 0.18);
    --sr-footer-text: #f1f5f9;
    --sr-footer-text-secondary: #a8b3cc;
    --sr-footer-muted: #64748b;
    --sr-footer-border: rgba(148, 163, 184, 0.14);
    --sr-footer-shadow: 0 -4px 24px rgba(2, 6, 23, 0.3);
    --sr-footer-link-hover-bg: rgba(148, 163, 184, 0.08);
    --sr-footer-dropdown-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ==========================================================================
   BODY OFFSETS
   ========================================================================== */

body {
  padding-top: var(--sr-header-offset, 0px);
  padding-bottom: var(--sr-footer-offset, var(--sr-footer-height));
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.sr-shell__content {
  min-height: calc(100vh - var(--sr-header-offset, 64px) - var(--sr-footer-height, 52px));
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  background: var(--page-bg, var(--sr-header-surface));
  color: var(--ink, var(--sr-header-text));
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */

.sr-header {
  width: 100%;
  color: var(--sr-header-text);
  background: var(--sr-header-bg);
  font-family: var(--sr-font-family);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.sr-header__bar {
  position: relative;
  min-height: var(--sr-bar-height, 64px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sr-header-border);
}

.sr-header__bar--global {
  background: var(--sr-header-global-bg);
  -webkit-backdrop-filter: var(--sr-header-backdrop);
  backdrop-filter: var(--sr-header-backdrop);
  box-shadow: none;
  height: var(--sr-bar-height, var(--sr-global-border-height));
  min-height: var(--sr-bar-height, var(--sr-global-border-height));
  overflow: visible;
  align-items: flex-end;
  position: relative;
  border-bottom: 1px solid var(--sr-header-border);
  z-index: 3;
  padding-top: 0;
}

.sr-header__bar--global .sr-header__bar-inner {
  height: 100%;
  padding: 0 24px;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: flex-end;
}

.sr-header__left--global {
  max-width: 55%;
  min-width: 0;
  flex: 1 1 auto;
}

.sr-header__left--global .sr-brand__text {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Top header (Savant Realms) logo: ensure correct size and display */
.sr-header__left--global .sr-brand__logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}

.sr-header__right--global {
  justify-content: flex-end;
  flex: 0 0 auto;
  position: static;
  transform: none;
}

.sr-header__bar--global .sr-header__left,
.sr-header__bar--global .sr-header__right {
  align-items: flex-end;
}

.sr-header__stack--global {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-width: 0;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.sr-header__stack--global .sr-header__slot {
  display: inline-flex;
}

.sr-header__bar--global .sr-header__stack--global {
  position: relative;
  z-index: 6;
  transform: translateY(50%);
}

/* Align theme toggle with directory/auth icons: pull up by half icon height */
.sr-header__bar--global .sr-header__theme-toggle {
  position: relative;
  z-index: 6;
}

.sr-header__bar--global .sr-global-icon {
  box-shadow: var(--sr-header-icon-shadow);
}

.sr-header__bar--app {
  background: var(--sr-header-app-bg);
  -webkit-backdrop-filter: var(--sr-header-backdrop);
  backdrop-filter: var(--sr-header-backdrop);
  box-shadow: var(--sr-header-shadow);
  z-index: 1;
  flex-direction: column;
  align-items: stretch;
}

.sr-header__bar--app .sr-header__bar-inner {
  padding: 14px 24px 10px;
}

.sr-header__bar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.sr-header__left,
.sr-header__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sr-header__bar--global .sr-header__left,
.sr-header__bar--global .sr-header__right {
  gap: 12px;
}

.sr-header__left {
  flex: 1 1 auto;
}

.sr-header__right {
  flex: 0 0 auto;
}

.sr-header__stack {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sr-header__breadcrumbs {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 4px 24px 10px;
  border-top: 1px solid var(--sr-header-border);
  color: var(--sr-header-muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: var(--sr-header-breadcrumbs-bg);
  -webkit-backdrop-filter: var(--sr-header-backdrop);
  backdrop-filter: var(--sr-header-backdrop);
}

/* Brand */
.sr-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sr-brand__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.sr-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-brand__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sr-brand__subtitle {
  font-size: 0.74rem;
  color: var(--sr-header-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-header__bar--global .sr-brand__title {
  font-size: 0.9rem;
  line-height: 1;
}

.sr-header__bar--global .sr-brand__subtitle {
  display: none;
}

/* Menu */
.sr-menu {
  display: inline-flex;
  align-items: center;
}

.sr-menu__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.sr-menu__list--panel {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.sr-menu__item {
  display: flex;
}

.sr-menu__list--panel .sr-menu__item {
  width: 100%;
}

.sr-menu__link,
.sr-menu__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--sr-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.sr-menu__list--panel .sr-menu__link,
.sr-menu__list--panel .sr-menu__button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid var(--sr-card-border);
}

.sr-menu__list--panel .sr-menu__item:last-child .sr-menu__link,
.sr-menu__list--panel .sr-menu__item:last-child .sr-menu__button {
  border-bottom: none;
}

.sr-menu__link:hover,
.sr-menu__button:hover {
  background: rgba(255, 106, 61, 0.12);
  border-color: rgba(255, 106, 61, 0.25);
  color: var(--sr-header-text);
}

.sr-menu__icon,
.sr-popover__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sr-menu__label {
  white-space: nowrap;
}

/* Popover */
.sr-popover {
  position: relative;
  display: inline-flex;
}

.sr-popover__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--sr-radius-sm);
  border: 1px solid var(--sr-header-border);
  background: var(--sr-card-bg);
  color: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.sr-popover__trigger:hover {
  border-color: rgba(255, 106, 61, 0.4);
  box-shadow: 0 8px 16px rgba(255, 106, 61, 0.15);
}

.sr-popover__trigger--icon {
  height: 40px;
  width: 40px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  gap: 0;
}

.sr-header__bar--global .sr-popover__trigger--icon {
  height: var(--sr-global-icon-size);
  width: var(--sr-global-icon-size);
}

/* Theme toggle */
.sr-header__theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--sr-header-border);
  background: var(--sr-header-surface);
  box-shadow: var(--sr-header-shadow);
}

.sr-header__theme-button {
  height: 28px;
  width: 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sr-header-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.sr-header__theme-button:hover {
  color: var(--sr-header-text);
}

.sr-header__theme-button.is-active {
  background: rgba(255, 106, 61, 0.12);
  border-color: rgba(255, 106, 61, 0.35);
  color: var(--sr-header-text);
}

.sr-header__theme-icon {
  width: 14px;
  height: 14px;
}

/* Directory trigger */
.sr-directory-trigger {
  border: 1px solid var(--sr-header-icon-border);
  background: var(--sr-header-icon-bg);
}

/* Profile trigger */
.sr-profile-trigger {
  border: 2px solid var(--sr-header-icon-border);
  background: var(--sr-header-icon-bg);
  overflow: hidden;
}

.sr-header__bar--global .sr-header__stack--global {
  position: relative;
  z-index: 6;
  transform: translateY(50%);
}

.sr-header__bar--global .sr-header__theme-toggle {
  position: relative;
  z-index: 6;
}

.sr-header__bar--global .sr-global-icon {
  box-shadow: var(--sr-header-icon-shadow);
}

.sr-popover.is-open .sr-profile-trigger,
.sr-popover.is-open .sr-directory-trigger {
  border-color: rgba(255, 106, 61, 0.6);
  background: var(--sr-header-icon-bg);
  box-shadow:
    0 0 0 2px rgba(255, 106, 61, 0.2),
    var(--sr-header-icon-shadow);
}

/* Dot grid icon */
.sr-dot-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sr-dot-grid__row {
  display: flex;
  gap: 3px;
}

.sr-dot-grid__dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

/* User icon */
.sr-user-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  gap: 2px;
}

.sr-user-icon__head {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.sr-user-icon__body {
  width: 14px;
  height: 10px;
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
  background: currentColor;
}

.sr-popover__label {
  white-space: nowrap;
}

/* Popover backdrop: click outside to close */
.sr-popover__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: transparent;
  cursor: default;
}

/* Popover panel */
.sr-popover__panel {
  position: absolute;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 12px;
  border-radius: var(--sr-radius-md);
  background: var(--sr-card-bg);
  border: 1px solid var(--sr-card-border);
  box-shadow: var(--sr-card-shadow);
  z-index: 101;
}

.sr-popover__panel--start {
  left: 0;
}

.sr-popover__panel--end {
  right: 0;
}

.sr-profile-panel {
  padding: 0;
  overflow: hidden;
}

/* Directory: scroll when content exceeds viewport height */
.sr-directory {
  display: grid;
  gap: 14px;
  min-width: 260px;
  width: min(720px, 90vw);
  max-height: min(70vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sr-directory__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sr-header-text);
  margin-bottom: 6px;
}

.sr-directory__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--sr-card-border);
  background: var(--sr-card-bg);
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sr-header-text);
  text-decoration: none;
}

.sr-directory__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.sr-directory__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  border: 1px solid var(--sr-card-border);
  background: var(--sr-card-bg);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
  cursor: pointer;
}

.sr-directory__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
  border-color: rgba(31, 157, 139, 0.35);
}

.sr-directory__tile-logo {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--sr-card-border);
  overflow: hidden;
}

[data-theme='dark'] .sr-directory__tile-logo {
  background: rgba(226, 232, 240, 0.18);
  border-color: rgba(203, 213, 225, 0.35);
}

.sr-directory__tile-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.sr-directory__tile-placeholder {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sr-header-text);
}

.sr-directory__tile-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
}

.sr-directory__tile-description {
  display: block;
  font-size: 0.72rem;
  color: var(--sr-card-muted);
}

.sr-directory__empty {
  font-size: 0.82rem;
  color: var(--sr-card-muted);
}

.sr-directory__loading {
  font-size: 0.82rem;
  color: var(--sr-card-muted);
}

/* Avatar */
.sr-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  background: transparent;
  color: var(--sr-header-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
}

.sr-avatar__initial {
  font-size: 0.7rem;
  font-weight: 700;
  color: inherit;
}

.sr-icon {
  width: 18px;
  height: 18px;
}

.sr-popover__chevron {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

.sr-footer {
  font-family: var(--sr-font-family);
  font-size: var(--sr-footer-font-size-base);
  color: var(--sr-footer-text);
  background: var(--sr-footer-bg);
  -webkit-backdrop-filter: var(--sr-footer-backdrop);
  backdrop-filter: var(--sr-footer-backdrop);
  border-top: 1px solid var(--sr-footer-border);
  box-shadow: var(--sr-footer-shadow);
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  min-height: var(--sr-footer-height);
  padding: var(--sr-footer-spacing-sm) 0;
}

.sr-footer *,
.sr-footer *::before,
.sr-footer *::after {
  box-sizing: border-box;
}

.sr-footer__container {
  max-width: 1400px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--sr-footer-spacing-xl);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.sr-footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sr-footer-spacing-lg);
  width: 100%;
  flex-wrap: wrap;
  min-height: 0;
}

.sr-footer__main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sr-footer-spacing-lg);
  flex-shrink: 0;
  min-width: 0;
}

/* Company info */
.sr-footer__company {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sr-footer-spacing-md);
  flex-shrink: 0;
  min-width: 0;
}

.sr-footer__company-legal {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sr-footer-spacing-md);
}

.sr-footer__company-name {
  font-weight: 600;
  font-size: var(--sr-footer-font-size-sm);
  color: var(--sr-footer-text);
}

.sr-footer__company-vat {
  font-size: var(--sr-footer-font-size-xs);
  color: var(--sr-footer-muted);
}

.sr-footer__company-contact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sr-footer-spacing-md);
}

.sr-footer__company-address,
.sr-footer__company-info {
  font-size: var(--sr-footer-font-size-xs);
  color: var(--sr-footer-muted);
}

/* Links */
.sr-footer__link {
  color: var(--sr-footer-muted);
  text-decoration: none;
  font-size: var(--sr-footer-font-size-xs);
  transition: color var(--sr-footer-transition-fast);
}

.sr-footer__link:hover {
  color: var(--sr-footer-accent);
}

/* Standalone links */
.sr-footer__standalone-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sr-footer-spacing-md);
  flex-shrink: 0;
}

.sr-footer__standalone-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sr-footer-spacing-md);
}

.sr-footer__standalone-link {
  color: var(--sr-footer-text-secondary);
  text-decoration: none;
  font-size: var(--sr-footer-font-size-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--sr-footer-transition-fast);
}

.sr-footer__standalone-link:hover {
  color: var(--sr-footer-accent);
}

/* Language selector */
.sr-footer__language-selector {
  position: relative;
  flex-shrink: 0;
}

.sr-footer__language-trigger {
  display: flex;
  align-items: center;
  gap: var(--sr-footer-spacing-sm);
  padding: 3px var(--sr-footer-spacing-sm);
  background: var(--sr-footer-surface);
  border: 1px solid var(--sr-footer-border);
  border-radius: var(--sr-footer-radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--sr-footer-font-size-xs);
  color: var(--sr-footer-text);
  height: 28px;
  transition:
    border-color var(--sr-footer-transition-fast),
    box-shadow var(--sr-footer-transition-fast);
}

.sr-footer__language-trigger:hover {
  border-color: var(--sr-footer-accent);
}

.sr-footer__language-trigger:focus {
  outline: none;
  border-color: var(--sr-footer-accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 61, 0.15);
}

.sr-footer__language-trigger--single {
  cursor: default;
  pointer-events: none;
}

.sr-footer__language-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.sr-footer__language-code {
  font-weight: 600;
  font-size: 0.6875rem;
  min-width: 20px;
  text-align: center;
}

.sr-footer__language-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sr-footer-muted);
  transition: transform var(--sr-footer-transition-fast);
}

.sr-footer__language-chevron--open {
  transform: rotate(180deg);
}

/* Language dropdown */
.sr-footer__language-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--sr-footer-border);
  border-radius: var(--sr-footer-radius-lg);
  box-shadow: var(--sr-footer-dropdown-shadow);
  z-index: 200;
  padding: var(--sr-footer-spacing-xs);
  background: #ffffff;
}

[data-theme='dark'] .sr-footer__language-dropdown {
  background: #1e293b;
}

.sr-footer__language-option {
  display: flex;
  align-items: center;
  gap: var(--sr-footer-spacing-sm);
  width: 100%;
  padding: var(--sr-footer-spacing-xs) var(--sr-footer-spacing-sm);
  background: transparent;
  border: none;
  border-radius: var(--sr-footer-radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--sr-footer-font-size-xs);
  color: var(--sr-footer-text);
  text-align: left;
  transition: background-color var(--sr-footer-transition-fast);
}

.sr-footer__language-option:hover {
  background: var(--sr-footer-link-hover-bg);
}

.sr-footer__language-option--selected {
  background: rgba(255, 106, 61, 0.1);
  color: var(--sr-footer-accent);
}

.sr-footer__language-option--selected:hover {
  background: rgba(255, 106, 61, 0.15);
}

.sr-footer__language-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Social links */
.sr-footer__bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sr-footer-spacing-md);
  flex: 1;
  min-width: 0;
}

.sr-footer__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.sr-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--sr-footer-border);
  border-radius: var(--sr-footer-radius-sm);
  color: var(--sr-footer-text-secondary);
  text-decoration: none;
  transition:
    color var(--sr-footer-transition-fast),
    border-color var(--sr-footer-transition-fast);
}

.sr-footer__social-link:hover {
  color: var(--sr-footer-accent);
  border-color: var(--sr-footer-accent);
}

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

.sr-footer__social-icon svg {
  width: 12px;
  height: 12px;
}

.sr-footer__social-label {
  display: none;
}

/* ==========================================================================
   RESPONSIVE - HEADER
   ========================================================================== */

@media (max-width: 900px) {
  .sr-header__left--global {
    max-width: 50%;
  }
}

@media (max-width: 720px) {
  .sr-header__left--global {
    max-width: 42%;
  }

  .sr-header__bar--global .sr-brand__subtitle {
    display: none;
  }

  .sr-header__bar--global .sr-header__bar-inner {
    padding: 0 16px;
  }
}

@media (max-width: 560px) {
  .sr-header__bar--global .sr-brand__title {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .sr-header__bar--global .sr-header__bar-inner {
    padding: 0 12px;
  }

  .sr-header__bar--global .sr-brand__text {
    display: none;
  }
}

@media (max-width: 960px) {
  .sr-header__bar-inner {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .sr-menu__list {
    flex-wrap: wrap;
  }

  .sr-header__right {
    width: 100%;
    justify-content: space-between;
  }

  .sr-header__bar--global .sr-header__bar-inner {
    flex-wrap: nowrap;
  }

  .sr-header__bar--global .sr-header__right {
    width: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .sr-header__bar-inner {
    padding: 0 16px;
  }

  .sr-header__left,
  .sr-header__right {
    gap: 12px;
  }

  .sr-menu__link,
  .sr-menu__button,
  .sr-popover__trigger {
    padding: 6px 8px;
  }
}

/* ==========================================================================
   RESPONSIVE - FOOTER
   ========================================================================== */

@media (max-width: 960px) {
  .sr-footer__company {
    flex-direction: column;
    align-items: flex-start;
  }

  .sr-footer__company-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__company-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__standalone-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sr-footer-spacing-xs);
  }
}

@media (max-width: 768px) {
  .sr-footer__top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sr-footer-spacing-md);
  }

  .sr-footer__bottom {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .sr-footer__company {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__company-legal {
    flex-direction: column;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__standalone-links {
    flex-direction: column;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__standalone-group {
    flex-direction: column;
    gap: var(--sr-footer-spacing-xs);
  }

  .sr-footer__container {
    padding: 0 var(--sr-footer-spacing-md);
  }
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

.sr-footer__language-dropdown::-webkit-scrollbar {
  width: 4px;
}

.sr-footer__language-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.sr-footer__language-dropdown::-webkit-scrollbar-thumb {
  background: var(--sr-footer-border);
  border-radius: 2px;
}

.sr-footer__language-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--sr-footer-muted);
}

.sr-footer__language-dropdown {
  scrollbar-width: thin;
  scrollbar-color: var(--sr-footer-border) transparent;
}

/* ==========================================================================
   FOCUS VISIBLE
   ========================================================================== */

.sr-footer__link:focus-visible,
.sr-footer__standalone-link:focus-visible,
.sr-footer__social-link:focus-visible,
.sr-footer__language-option:focus-visible {
  outline: 2px solid var(--sr-footer-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .sr-footer,
  .sr-footer__link,
  .sr-footer__standalone-link,
  .sr-footer__social-link,
  .sr-footer__language-trigger,
  .sr-footer__language-option,
  .sr-footer__language-chevron,
  .sr-menu__link,
  .sr-menu__button,
  .sr-popover__trigger,
  .sr-header__theme-button,
  .sr-directory__tile {
    transition: none;
  }
}
