﻿/* ============================================================
   UI ELEMENTS — Template Factory
   ============================================================
   
   СОДЕРЖАНИЕ:
   1. BADGES (5 вариантов)
   2. TRUST BADGES (6 вариантов)
   3. ALERTS (4 варианта)
   4. ACCORDIONS (4 варианта)
   5. TABS (4 варианта)
   6. MODALS
   7. TOOLTIPS
   8. PROGRESS BARS
   9. STATS/COUNTERS (6 вариантов)
   10. DIVIDERS (5 вариантов)
   11. RATINGS
   12. STEP INDICATORS
   13. TOASTS
   14. AVATARS
   15. SKELETONS
   16. QUOTES/BLOCKQUOTES
   17. LISTS (enhanced)
   18. TABLES
   19. CODE BLOCKS
   20. MISCELLANEOUS UI
   21. VIDEO (3 варианта)
   22. GALLERY (3 варианта)
   23. CAROUSEL (3 варианта)

   ============================================================ */


/* ============================================================
   1. BADGES
   ============================================================ */

/* Base Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375em;
  padding: 0.25em 0.75em;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
  background-color: var(--badge-bg, var(--primary-soft));
  color: var(--badge-fg, var(--on-primary-soft));
  border: 1px solid var(--badge-border, transparent);
  border-radius: var(--radius-full); /* pill by default */
  transition: all var(--duration-fast) ease;
}

.badge i,
.badge svg {
  font-size: 1em;
  flex-shrink: 0;
}

/* Badge Sizes */
.badge--xs {
  padding: 0.125em 0.5em;
  font-size: 10px;
}

.badge--sm {
  padding: 0.2em 0.6em;
  font-size: 11px;
}

.badge--md {
  padding: 0.25em 0.75em;
  font-size: var(--text-xs);
}

.badge--lg {
  padding: 0.375em 1em;
  font-size: var(--text-sm);
}

/* bdg-01: Pill (default) */
.badge--pill,
.bdg-01 {
  border-radius: var(--radius-full);
}

/* bdg-02: Square */
.badge--square,
.bdg-02 {
  border-radius: var(--radius-sm, 4px);
}

/* bdg-03: Outlined */
.badge--outlined,
.bdg-03 {
  background-color: transparent;
  border-color: currentColor;
}

/* bdg-04: With Icon - handled by default gap */
.badge--icon,
.bdg-04 {
  gap: 0.4em;
}

/* bdg-05: Dot Indicator */
.badge--dot,
.bdg-05 {
  padding-left: 0.5em;
}

.badge--dot::before,
.bdg-05::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

/* Badge Variants */
.badge--primary {
  background-color: var(--badge-bg, var(--primary-soft));
  color: var(--badge-fg, var(--on-primary-soft));
}

.badge--secondary {
  background-color: var(--bg-surface-alt);
  color: var(--text-secondary);
}

.badge--success {
  background-color: var(--badge-success-bg, var(--success-soft));
  color: var(--badge-success-fg, var(--on-success-soft));
}

.badge--warning {
  background-color: var(--badge-warning-bg, var(--warning-soft));
  color: var(--badge-warning-fg, var(--on-warning-soft));
}

.badge--error,
.badge--danger {
  background-color: var(--badge-error-bg, var(--error-soft));
  color: var(--badge-error-fg, var(--on-error-soft));
}

.badge--info {
  background-color: var(--badge-info-bg, var(--info-soft));
  color: var(--badge-info-fg, var(--on-info-soft));
}

/* Solid variants */
.badge--primary-solid {
  background-color: var(--primary);
  color: var(--on-primary);
}

.badge--success-solid {
  background-color: var(--success);
  color: var(--on-success);
}

.badge--warning-solid {
  background-color: var(--warning);
  color: var(--on-warning);
}

.badge--error-solid,
.badge--danger-solid {
  background-color: var(--error);
  color: var(--on-error);
}

/* Badge with close button */
.badge--closable {
  padding-right: 0.375em;
}

.badge__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.125em;
  font-size: 0.9em;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
}

.badge__close:hover {
  opacity: 1;
}


/* ============================================================
   2. TRUST BADGES
   ============================================================ */

/* trst-01: Icons Row */
.trust-badges,
.trst-01 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.trust-badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 24px;
  color: var(--primary);
}

.trust-badge__text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

/* trst-02: Cards */
.trust-badges--cards,
.trst-02 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
}

.trust-badges--cards .trust-badge,
.trst-02 .trust-badge {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  gap: var(--space-3);
}

/* trst-03: With Text (horizontal) */
.trust-badges--horizontal,
.trst-03 {
  gap: var(--space-6);
}

.trust-badges--horizontal .trust-badge,
.trst-03 .trust-badge {
  flex-direction: row;
  gap: var(--space-3);
  text-align: left;
}

.trust-badges--horizontal .trust-badge__icon,
.trst-03 .trust-badge__icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

/* trst-04: Minimal */
.trust-badges--minimal,
.trst-04 {
  gap: var(--space-6);
}

.trust-badges--minimal .trust-badge__icon,
.trst-04 .trust-badge__icon {
  width: auto;
  height: auto;
  font-size: 32px;
  color: var(--text-muted);
}

.trust-badges--minimal .trust-badge__text,
.trst-04 .trust-badge__text {
  display: none;
}

/* trst-05: Banner Style */
.trust-badges--banner,
.trst-05 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
}

.trust-badges--banner .trust-badge,
.trst-05 .trust-badge {
  flex-direction: row;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  border-right: 1px solid var(--border);
}

.trust-badges--banner .trust-badge:last-child,
.trst-05 .trust-badge:last-child {
  border-right: none;
}

.trust-badges--banner .trust-badge__icon,
.trst-05 .trust-badge__icon {
  width: auto;
  height: auto;
  font-size: 20px;
}

/* trst-06: Floating */
.trust-badges--floating,
.trst-06 {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
}

.trust-badges--floating .trust-badge,
.trst-06 .trust-badge {
  flex-direction: row;
  gap: var(--space-2);
}

.trust-badges--floating .trust-badge__icon,
.trst-06 .trust-badge__icon {
  width: auto;
  height: auto;
  font-size: 18px;
}

.trust-badges--floating .trust-badge__text,
.trst-06 .trust-badge__text {
  font-size: var(--text-xs);
}


/* ============================================================
   3. ALERTS
   ============================================================ */

/* Base Alert */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background-color: var(--alert-info-bg, var(--info-soft));
  border: 1px solid var(--alert-info-border, var(--info));
}

.alert__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 20px;
  color: var(--alert-info-icon, var(--info));
  flex-shrink: 0;
}

.alert__content {
  flex: 1;
  min-width: 0;
}

.alert__title {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.alert__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.alert__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

.alert__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

/* Alert Variants */
.alert--success {
  background-color: var(--alert-success-bg, var(--success-soft));
  border-color: var(--alert-success-border, var(--success));
}

.alert--success .alert__icon {
  color: var(--alert-success-icon, var(--success));
}

.alert--warning {
  background-color: var(--alert-warning-bg, var(--warning-soft));
  border-color: var(--alert-warning-border, var(--warning));
}

.alert--warning .alert__icon {
  color: var(--alert-warning-icon, var(--warning));
}

.alert--error,
.alert--danger {
  background-color: var(--alert-error-bg, var(--error-soft));
  border-color: var(--alert-error-border, var(--error));
}

.alert--error .alert__icon,
.alert--danger .alert__icon {
  color: var(--alert-error-icon, var(--error));
}

.alert--info {
  background-color: var(--alert-info-bg, var(--info-soft));
  border-color: var(--alert-info-border, var(--info));
}

.alert--info .alert__icon {
  color: var(--alert-info-icon, var(--info));
}

/* Alert Styles */

/* alt-01: Standard (default with icon) */
.alert--standard,
.alt-01 {
  /* default style */
}

/* alt-02: Minimal (no icon, subtle) */
.alert--minimal,
.alt-02 {
  border: none;
  background-color: var(--bg-surface-alt);
}

.alert--minimal .alert__icon,
.alt-02 .alert__icon {
  display: none;
}

/* alt-03: Border left accent */
.alert--accent,
.alt-03 {
  border: none;
  border-left: 4px solid var(--alert-info-border, var(--info));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.alert--accent.alert--success,
.alt-03.alert--success {
  border-left-color: var(--alert-success-border, var(--success));
}

.alert--accent.alert--warning,
.alt-03.alert--warning {
  border-left-color: var(--alert-warning-border, var(--warning));
}

.alert--accent.alert--error,
.alt-03.alert--error {
  border-left-color: var(--alert-error-border, var(--error));
}

/* alt-04: Banner (full width, top of page style) */
.alert--banner,
.alt-04 {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--alert-info-border, var(--info));
  padding: var(--space-3) var(--space-6);
  justify-content: center;
  text-align: center;
}

.alert--banner .alert__content,
.alt-04 .alert__content {
  flex: none;
}

/* Alert Actions */
.alert__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Dismissible Alert */
.alert--dismissible {
  padding-right: var(--space-12);
  position: relative;
}

.alert--dismissible .alert__close {
  position: absolute;
  top: 12px;
  right: 12px;
}


/* ============================================================
   4. ACCORDIONS
   ============================================================ */

/* Base Accordion */
.accordion {
  width: 100%;
  border: 1px solid var(--accordion-border, var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion__item {
  width: 100%;
  border-bottom: 1px solid var(--accordion-border, var(--border));
}

.accordion__item:last-child {
  border-bottom: none;
}

.accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background-color: var(--accordion-header-bg, var(--bg-surface));
  border: none;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

.accordion__header:hover {
  background-color: var(--accordion-header-hover-bg, var(--bg-surface-alt));
}

.accordion__header:focus {
  outline: none;
}

.accordion__header:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.accordion__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.accordion__title i {
  font-size: 18px;
  color: var(--primary);
}

.accordion__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 16px;
  color: var(--accordion-icon, var(--text-muted));
  transition: transform var(--duration-normal) ease;
  flex-shrink: 0;
}

.accordion__item.is-open .accordion__icon {
  transform: rotate(180deg);
}

.accordion__content {
  display: none;
  width: 100%;
  padding: 0 var(--space-5) var(--space-5);
  background-color: var(--accordion-content-bg, var(--bg-surface));
  box-sizing: border-box;
}

.accordion__item.is-open .accordion__content {
  display: block;
}

.accordion__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* acc-01: Bordered (default) */
.accordion--bordered,
.acc-01 {
  /* default style */
}

/* acc-02: Separated items */
.accordion--separated,
.acc-02 {
  border: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.accordion--separated .accordion__item,
.acc-02 .accordion__item {
  border: 1px solid var(--accordion-border, var(--border));
  border-radius: var(--radius-lg);
}

/* acc-03: Minimal (no borders) */
.accordion--minimal,
.acc-03 {
  border: none;
}

.accordion--minimal .accordion__item,
.acc-03 .accordion__item {
  border-bottom: 1px solid var(--border);
}

.accordion--minimal .accordion__header,
.acc-03 .accordion__header {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.accordion--minimal .accordion__content,
.acc-03 .accordion__content {
  padding-left: 0;
  padding-right: 0;
}

/* acc-04: With icons */
.accordion--icons,
.acc-04 {
  /* same as default, icons in title */
}

.accordion--icons .accordion__header,
.acc-04 .accordion__header {
  gap: var(--space-3);
}

/* Accordion Sizes */
.accordion--sm .accordion__header {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.accordion--sm .accordion__content {
  padding: 0 var(--space-4) 16px;
}

.accordion--lg .accordion__header {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
}

.accordion--lg .accordion__content {
  padding: 0 var(--space-6) var(--space-6);
}


/* ============================================================
   5. TABS
   ============================================================ */

/* Base Tabs */
.tabs {
  display: flex;
  flex-direction: column;
}

.tabs__list {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.tabs__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--tab-bg, transparent);
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--tab-fg, var(--text-secondary));
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.tabs__trigger:hover {
  background: var(--tab-hover-bg, var(--bg-surface-alt));
  color: var(--text-primary);
}

.tabs__trigger:focus {
  outline: none;
}

.tabs__trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.tabs__trigger.is-active {
  background: var(--tab-active-bg, var(--bg-surface));
  color: var(--tab-active-fg, var(--text-primary));
  border-bottom-color: var(--tab-active-border, var(--primary));
}

.tabs__trigger i {
  font-size: 16px;
}

.tabs__panel {
  display: none;
  padding: var(--space-5) 0;
}

.tabs__panel.is-active {
  display: block;
}

/* tab-01: Underlined (default) */
.tabs--underlined,
.tab-01 {
  /* default style */
}

/* tab-02: Boxed/Contained */
.tabs--boxed,
.tab-02 {
  background: var(--bg-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
}

.tabs--boxed .tabs__list,
.tab-02 .tabs__list {
  border-bottom: none;
  gap: var(--space-1);
}

.tabs--boxed .tabs__trigger,
.tab-02 .tabs__trigger {
  border-bottom: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.tabs--boxed .tabs__trigger.is-active,
.tab-02 .tabs__trigger.is-active {
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.tabs--boxed .tabs__panel,
.tab-02 .tabs__panel {
  padding: var(--space-4);
}

/* tab-03: Pills */
.tabs--pills,
.tab-03 {
  /* No container background */
}

.tabs--pills .tabs__list,
.tab-03 .tabs__list {
  border-bottom: none;
  gap: var(--space-2);
}

.tabs--pills .tabs__trigger,
.tab-03 .tabs__trigger {
  border-bottom: none;
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5);
  background: var(--bg-surface-alt);
}

.tabs--pills .tabs__trigger.is-active,
.tab-03 .tabs__trigger.is-active {
  background: var(--primary);
  color: var(--on-primary);
}

/* tab-04: Vertical */
.tabs--vertical,
.tab-04 {
  flex-direction: row;
  gap: var(--space-6);
}

.tabs--vertical .tabs__list,
.tab-04 .tabs__list {
  flex-direction: column;
  border-bottom: none;
  border-right: 1px solid var(--border);
  padding-right: var(--space-4);
  min-width: 180px;
}

.tabs--vertical .tabs__trigger,
.tab-04 .tabs__trigger {
  justify-content: flex-start;
  border-bottom: none;
  border-right: 2px solid transparent;
  text-align: left;
  padding: var(--space-3) var(--space-4);
}

.tabs--vertical .tabs__trigger.is-active,
.tab-04 .tabs__trigger.is-active {
  border-right-color: var(--tab-active-border, var(--primary));
  border-bottom-color: transparent;
}

.tabs--vertical .tabs__panel,
.tab-04 .tabs__panel {
  flex: 1;
  padding: 0;
}

/* Responsive Tabs */
@media (max-width: 640px) {
  .tabs--vertical,
  .tab-04 {
    flex-direction: column;
  }
  
  .tabs--vertical .tabs__list,
  .tab-04 .tabs__list {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 0;
    min-width: auto;
    overflow-x: auto;
  }
  
  .tabs--vertical .tabs__trigger,
  .tab-04 .tabs__trigger {
    border-right: none;
    border-bottom: 2px solid transparent;
  }
  
  .tabs--vertical .tabs__trigger.is-active,
  .tab-04 .tabs__trigger.is-active {
    border-right-color: transparent;
    border-bottom-color: var(--tab-active-border, var(--primary));
  }
  
  .tabs__list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ============================================================
   6. MODALS
   ============================================================ */

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) ease,
              visibility var(--duration-normal) ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--modal-bg, var(--bg-elevated));
  border: 1px solid var(--modal-border, var(--border));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: calc(var(--z-modal) + 1);
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity var(--duration-normal) ease,
              visibility var(--duration-normal) ease,
              transform var(--duration-normal) ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Modal Sizes */
.modal--sm {
  max-width: 400px;
}

.modal--md {
  max-width: 500px;
}

.modal--lg {
  max-width: 700px;
}

.modal--xl {
  max-width: 900px;
}

.modal--full {
  max-width: 95%;
  max-height: 95vh;
}

/* Modal Header */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--modal-header-bg, var(--bg-surface-alt));
  flex-shrink: 0;
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.modal__close:hover {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
}

/* Modal Body */
.modal__body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer */
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--modal-footer-bg, var(--bg-surface-alt));
  flex-shrink: 0;
}

.modal__footer--between {
  justify-content: space-between;
}

.modal__footer--center {
  justify-content: center;
}

/* Modal Variants */
.modal--centered .modal__body {
  text-align: center;
}

.modal--no-header .modal__header {
  display: none;
}

.modal--no-footer .modal__footer {
  display: none;
}


/* ============================================================
   7. TOOLTIPS
   ============================================================ */

/* Tooltip Wrapper */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease,
              visibility var(--duration-fast) ease,
              transform var(--duration-fast) ease;
  z-index: var(--z-tooltip);
}

/* Tooltip Arrow */
[data-tooltip]::before {
  content: '';
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

/* Tooltip Content */
[data-tooltip]::after {
  content: attr(data-tooltip);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--tooltip-bg, var(--bg-elevated));
  color: var(--tooltip-fg, var(--text-inverted));
  border: 1px solid var(--tooltip-border, transparent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Show on hover/focus */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus::before,
[data-tooltip]:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Tooltip Positions */

/* Top (default) */
[data-tooltip]::before {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--tooltip-bg, var(--bg-elevated));
  margin-bottom: -6px;
}

[data-tooltip]::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  margin-bottom: 6px;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  transform: translateX(-50%) translateY(0);
}

/* Bottom */
[data-tooltip-position="bottom"]::before {
  top: 100%;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: var(--tooltip-bg, var(--bg-elevated));
  margin-top: -6px;
  margin-bottom: 0;
}

[data-tooltip-position="bottom"]::after {
  top: 100%;
  bottom: auto;
  transform: translateX(-50%) translateY(8px);
  margin-top: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="bottom"]:hover::after,
[data-tooltip-position="bottom"]:focus::after {
  transform: translateX(-50%) translateY(0);
}

/* Left */
[data-tooltip-position="left"]::before {
  right: 100%;
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: var(--tooltip-bg, var(--bg-elevated));
  margin-right: -6px;
  margin-bottom: 0;
}

[data-tooltip-position="left"]::after {
  right: 100%;
  left: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) translateX(-8px);
  margin-right: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="left"]:hover::after,
[data-tooltip-position="left"]:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Right */
[data-tooltip-position="right"]::before {
  left: 100%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: var(--tooltip-bg, var(--bg-elevated));
  margin-left: -6px;
  margin-bottom: 0;
}

[data-tooltip-position="right"]::after {
  left: 100%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) translateX(8px);
  margin-left: 6px;
  margin-bottom: 0;
}

[data-tooltip-position="right"]:hover::after,
[data-tooltip-position="right"]:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Multiline Tooltip */
[data-tooltip-multiline]::after {
  white-space: normal;
  width: 200px;
  text-align: center;
}

/* Tooltip Component (alternative to data attribute) */
.tooltip {
  position: absolute;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
  background: var(--tooltip-bg, var(--bg-elevated));
  color: var(--tooltip-fg, var(--text-inverted));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-tooltip);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast) ease;
}

.tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}


/* ============================================================
   8. PROGRESS BARS
   ============================================================ */

/* Base Progress */
.progress {
  width: 100%;
  height: 8px;
  background: var(--progress-bg, var(--bg-surface-alt));
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--progress-fill, var(--primary));
  border-radius: inherit;
  transition: width var(--duration-slow) ease;
}

/* Progress Sizes */
.progress--xs {
  height: 4px;
}

.progress--sm {
  height: 6px;
}

.progress--md {
  height: 8px;
}

.progress--lg {
  height: 12px;
}

.progress--xl {
  height: 16px;
}

/* Progress Variants */
.progress--success .progress__bar {
  background: var(--progress-success-fill, var(--success));
}

.progress--warning .progress__bar {
  background: var(--progress-warning-fill, var(--warning));
}

.progress--error .progress__bar {
  background: var(--progress-error-fill, var(--error));
}

/* Progress with Label */
.progress-labeled {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-labeled__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-labeled__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.progress-labeled__value {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Progress with Text Inside */
.progress--with-text {
  height: 24px;
  position: relative;
}

.progress--with-text .progress__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
}

/* Striped Progress */
.progress--striped .progress__bar {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

/* Animated Striped Progress */
.progress--animated .progress__bar {
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Indeterminate Progress */
.progress--indeterminate .progress__bar {
  width: 30% !important;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* Circular Progress */
.progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-circle__svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-circle__track {
  fill: none;
  stroke: var(--progress-bg, var(--bg-surface-alt));
  stroke-width: 8;
}

.progress-circle__fill {
  fill: none;
  stroke: var(--progress-fill, var(--primary));
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray var(--duration-slow) ease;
}

.progress-circle__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

/* Progress Circle Label (под кругом) */
.progress-circle__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-2);
}

/* Progress Multi-bar (список навыков / skill bars) */
.progress-multi {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Progress Circle Sizes */
.progress-circle--sm {
  width: 48px;
  height: 48px;
}

.progress-circle--sm .progress-circle__text {
  font-size: var(--text-sm);
}

.progress-circle--lg {
  width: 120px;
  height: 120px;
}

.progress-circle--lg .progress-circle__text {
  font-size: var(--text-2xl);
}


/* ============================================================
   9. STATS / COUNTERS
   ============================================================ */

/* Base Stat */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  font-family: var(--font-heading);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.stat__change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
}

.stat__change--up {
  color: var(--success);
}

.stat__change--down {
  color: var(--error);
}

/* stat-01: Large Numbers (default) */
.stat--large,
.stat-01 {
  text-align: center;
}

.stat--large .stat__value,
.stat-01 .stat__value {
  font-size: var(--text-4xl);
}

/* stat-02: With Icons */
.stat--icon,
.stat-02 {
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
}

.stat--icon .stat__icon,
.stat-02 .stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 24px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.stat--icon .stat__content,
.stat-02 .stat__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* stat-03: Animated Counter */
.stat--animated,
.stat-03 {
  /* Animation handled by JS */
}

/* stat-04: In Cards */
.stat--card,
.stat-04 {
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

/* stat-05: Inline */
.stat--inline,
.stat-05 {
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-2);
}

.stat--inline .stat__value,
.stat-05 .stat__value {
  font-size: var(--text-2xl);
}

/* stat-06: Progress Bars */
.stat--progress,
.stat-06 {
  gap: var(--space-3);
}

.stat--progress .stat__header,
.stat-06 .stat__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stat--progress .stat__value,
.stat-06 .stat__value {
  font-size: var(--text-lg);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  gap: var(--space-6);
}

.stats-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.stats-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .stats-grid--3,
  .stats-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid--2,
  .stats-grid--3,
  .stats-grid--4 {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   10. DIVIDERS
   ============================================================ */

/* Base Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider, var(--border));
}

/* div-01: Simple Line */
.divider--simple,
.div-01 {
  display: block;
  height: 1px;
  background: var(--divider, var(--border));
}

.divider--simple::before,
.divider--simple::after,
.div-01::before,
.div-01::after {
  display: none;
}

/* div-02: With Icon/Text */
.divider--icon,
.divider--text,
.div-02 {
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.divider__icon,
.divider__text {
  flex-shrink: 0;
}

.divider__icon {
  font-size: 16px;
}

/* div-03: Gradient */
.divider--gradient,
.div-03 {
  display: block;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary),
    transparent
  );
  border: none;
}

.divider--gradient::before,
.divider--gradient::after,
.div-03::before,
.div-03::after {
  display: none;
}

/* div-04: Wave */
.divider--wave,
.div-04 {
  display: block;
  height: 20px;
  background: none;
  position: relative;
  overflow: hidden;
}

.divider--wave::before,
.div-04::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  clip-path: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CclipPath id='wave'%3E%3Cpath d='M0,2 Q5,0 10,2 T20,2 T30,2 T40,2 T50,2 T60,2 T70,2 T80,2 T90,2 T100,2 V4 H0 Z' /%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E#wave");
}

.divider--wave::after,
.div-04::after {
  display: none;
}

/* div-05: Angled / Diagonal */
.divider--angled,
.div-05 {
  display: block;
  height: 40px;
  background: linear-gradient(
    to bottom right,
    transparent 49.5%,
    var(--border) 49.5%,
    var(--border) 50.5%,
    transparent 50.5%
  );
}

.divider--angled::before,
.divider--angled::after,
.div-05::before,
.div-05::after {
  display: none;
}

/* Divider Variants */
.divider--thick {
  height: 2px;
}

.divider--thick::before,
.divider--thick::after {
  height: 2px;
}

.divider--dashed::before,
.divider--dashed::after {
  background: none;
  border-top: 1px dashed var(--divider, var(--border));
}

.divider--dotted::before,
.divider--dotted::after {
  background: none;
  border-top: 1px dotted var(--divider, var(--border));
}

.divider--primary::before,
.divider--primary::after {
  background: var(--primary);
}

/* Vertical Divider */
.divider--vertical {
  flex-direction: column;
  width: 1px;
  height: auto;
  min-height: 24px;
  margin: 0 16px;
}

.divider--vertical::before,
.divider--vertical::after {
  width: 1px;
  height: auto;
  flex: 1;
}


/* ============================================================
   11. RATINGS
   ============================================================ */

/* Base Rating */
.rating {
  display: inline-flex;
  gap: 2px;
}

.rating__star {
  font-size: 20px;
  color: var(--rating-empty, var(--border));
  cursor: pointer;
  transition: color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}

.rating__star.is-filled {
  color: var(--rating-filled, #FBBF24);
}

.rating__star.is-half {
  color: var(--rating-filled, #FBBF24);
}

.rating:not(.rating--readonly) .rating__star:hover {
  color: var(--rating-hover, #F59E0B);
  transform: scale(1.1);
}

.rating--readonly .rating__star {
  cursor: default;
}

/* Rating Sizes */
.rating--sm .rating__star {
  font-size: 14px;
}

.rating--lg .rating__star {
  font-size: 28px;
}

.rating--xl .rating__star {
  font-size: 36px;
}

/* Rating with Value */
.rating-display {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: nowrap;
  width: fit-content;
}

.rating-display__value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.rating-display__count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Rating Bar */
.rating-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.rating-bar__label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 60px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.rating-bar__progress {
  flex: 1;
  height: 8px;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rating-bar__fill {
  height: 100%;
  background: var(--rating-filled, #FBBF24);
  border-radius: inherit;
}

.rating-bar__count {
  min-width: 40px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: right;
}


/* ============================================================
   12. STEP INDICATORS
   ============================================================ */

/* Base Steps */
.steps {
  display: flex;
  align-items: flex-start;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

/* Connector Line */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--step-connector, var(--border));
}

.step.is-complete:not(:last-child)::after {
  background: var(--step-connector-complete, var(--success));
}

/* Step Number/Icon */
.step__indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--step-pending-bg, var(--bg-surface-alt));
  color: var(--step-pending-fg, var(--text-muted));
  border-radius: 50%;
  position: relative;
  z-index: 1;
  transition: all var(--duration-normal) ease;
}

.step.is-active .step__indicator {
  background: var(--step-active-bg, var(--primary));
  color: var(--step-active-fg, var(--on-primary));
}

.step.is-complete .step__indicator {
  background: var(--step-complete-bg, var(--success));
  color: var(--step-complete-fg, var(--on-success));
}

/* Step Content */
.step__content {
  margin-top: var(--space-3);
  text-align: center;
}

.step__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.step__description {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Vertical Steps */
.steps--vertical {
  flex-direction: column;
  gap: 0;
}

.steps--vertical .step {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-4);
}

.steps--vertical .step:not(:last-child)::after {
  top: 32px;
  left: 15px;
  right: auto;
  width: 2px;
  height: calc(100% - 16px);
}

.steps--vertical .step__content {
  margin-top: var(--space-1);
  text-align: left;
  padding-bottom: var(--space-6);
}

/* Steps Sizes */
.steps--lg .step__indicator {
  width: 40px;
  height: 40px;
  font-size: var(--text-base);
}

.steps--lg .step:not(:last-child)::after {
  top: 20px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
}

.steps--sm .step__indicator {
  width: 24px;
  height: 24px;
  font-size: var(--text-xs);
}

.steps--sm .step:not(:last-child)::after {
  top: 12px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
}

/* Steps Responsive */
@media (max-width: 640px) {
  .steps:not(.steps--vertical) {
    flex-direction: column;
    align-items: stretch;
  }
  
  .steps:not(.steps--vertical) .step {
    flex-direction: row;
    gap: var(--space-4);
  }
  
  .steps:not(.steps--vertical) .step:not(:last-child)::after {
    top: 32px;
    left: 15px;
    right: auto;
    width: 2px;
    height: calc(100% - 16px);
  }
  
  .steps:not(.steps--vertical) .step__content {
    margin-top: var(--space-1);
    text-align: left;
    padding-bottom: var(--space-6);
  }
}


/* ============================================================
   13. TOASTS
   ============================================================ */

/* Toast Container */
.toast-container {
  position: fixed;
  z-index: var(--z-toast, 9999);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  padding: var(--space-4);
}

.toast-container--top-right {
  top: 0;
  right: 0;
}

.toast-container--top-left {
  top: 0;
  left: 0;
}

.toast-container--top-center {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.toast-container--bottom-right {
  bottom: 0;
  right: 0;
}

.toast-container--bottom-left {
  bottom: 0;
  left: 0;
}

.toast-container--bottom-center {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Base Toast */
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 400px;
  padding: var(--space-4);
  background: var(--toast-bg, var(--bg-elevated));
  border: 1px solid var(--toast-border, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in var(--duration-normal) var(--ease-in-out);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.is-leaving {
  animation: toast-out var(--duration-normal) var(--ease-in-out) forwards;
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 18px;
  flex-shrink: 0;
  color: var(--info);
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--toast-fg, var(--text-primary));
  margin: 0;
}

.toast__message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--toast-close-icon, var(--text-muted));
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) ease;
}

.toast__close:hover {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
}

/* Toast Variants */
.toast--success .toast__icon {
  color: var(--success);
}

.toast--warning .toast__icon {
  color: var(--warning);
}

.toast--error .toast__icon {
  color: var(--error);
}

.toast--info .toast__icon {
  color: var(--info);
}

/* Toast with Progress */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transform-origin: left;
  animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast--with-progress {
  position: relative;
  overflow: hidden;
  padding-bottom: 19px;
}


/* ============================================================
   14. AVATARS
   ============================================================ */

/* Base Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--avatar-bg, var(--primary-soft));
  color: var(--avatar-fg, var(--on-primary-soft));
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar Sizes */
.avatar--xs {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.avatar--xl {
  width: 80px;
  height: 80px;
  font-size: 28px;
}

.avatar--2xl {
  width: 120px;
  height: 120px;
  font-size: 40px;
}

/* Avatar Shapes */
.avatar--square {
  border-radius: var(--radius-md);
}

.avatar--rounded {
  border-radius: var(--radius-lg);
}

/* Avatar with Status */
.avatar-status {
  position: relative;
  display: inline-block;
}

.avatar-status__indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.avatar-status__indicator--offline {
  background: var(--text-muted);
}

.avatar-status__indicator--busy {
  background: var(--error);
}

.avatar-status__indicator--away {
  background: var(--warning);
}

/* Avatar Group */
.avatar-group {
  display: flex;
  flex-direction: row-reverse;
}

.avatar-group .avatar {
  border: 2px solid var(--bg-surface);
  margin-left: -12px;
}

.avatar-group .avatar:last-child {
  margin-left: 0;
}

.avatar-group--sm .avatar {
  margin-left: -8px;
}

.avatar-group--lg .avatar {
  margin-left: -16px;
}

/* Avatar with Count */
.avatar--count {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 12px;
}

/* Avatar with Initials (нет фото) */
.avatar--initials {
  background-color: var(--primary-soft);
  color: var(--on-primary-soft);
  font-size: 0.4em;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}


/* ============================================================
   15. SKELETONS
   ============================================================ */

/* Base Skeleton */
.skeleton {
  background: var(--skeleton-bg, var(--bg-surface-alt));
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Skeleton Types */
.skeleton--text {
  height: 1em;
  width: 100%;
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton--avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton--image {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton--image-square {
  width: 100%;
  aspect-ratio: 1;
}

.skeleton--button {
  height: 40px;
  width: 120px;
  border-radius: var(--radius-lg);
}

/* Skeleton Card */
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Wave animation variant */
.skeleton--wave {
  position: relative;
  overflow: hidden;
  animation: none;
}

.skeleton--wave::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}


/* ============================================================
   16. QUOTES / BLOCKQUOTES
   ============================================================ */

/* Base Quote */
.quote,
blockquote {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  background: var(--quote-bg, var(--bg-surface-alt));
  border-left: 4px solid var(--quote-border, var(--primary));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.quote__text,
blockquote p {
  font-size: var(--text-lg);
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.quote__author,
blockquote cite,
blockquote footer {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--text-muted);
}

/* Quote with Icon */
.quote--icon {
  position: relative;
  padding-left: 56px;
}

.quote--icon::before {
  content: '\F6B0'; /* bi-quote */
  font-family: 'bootstrap-icons';
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 24px;
  color: var(--primary);
  opacity: 0.3;
}

/* Quote Centered */
.quote--centered {
  text-align: center;
  border-left: none;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.quote--centered::before {
  left: 50%;
  transform: translateX(-50%);
  top: 24px;
}

/* Quote Large */
.quote--large .quote__text,
.quote--large p {
  font-size: var(--text-2xl);
}


/* ============================================================
   17. LISTS (Enhanced)
   ============================================================ */

/* Check List */
.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-check li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.list-check li::before {
  content: '\F26E'; /* bi-check-lg */
  font-family: 'bootstrap-icons';
  color: var(--success);
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.5;
}

/* Cross List */
.list-cross {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-cross li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.list-cross li::before {
  content: '\F62A'; /* bi-x-lg */
  font-family: 'bootstrap-icons';
  color: var(--error);
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.5;
}

/* Circle List */
.list-circle {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-circle li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.list-circle li::before {
  content: '\F287'; /* bi-circle-fill */
  font-family: 'bootstrap-icons';
  font-size: 8px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: var(--space-2);
}

/* Arrow List */
.list-arrow {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-arrow li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.list-arrow li::before {
  content: '\F138'; /* bi-arrow-right */
  font-family: 'bootstrap-icons';
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.5;
}

/* Numbered List Enhanced */
.list-numbered {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: list-counter;
}

.list-numbered li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  counter-increment: list-counter;
}

.list-numbered li::before {
  content: counter(list-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Feature List */
.list-features {
  display: grid;
  gap: var(--space-4);
}

.list-features li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.list-features li i {
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Inline List */
.list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Auto-center list-inline when inside a centered slot */
.slot--center .list-inline {
  justify-content: center;
}

/* Nav List (footer columns, sidebar menus) — clean links, no decorators */
.list-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-nav li {
  padding: var(--space-1) 0;
}

.list-nav li a {
  opacity: 0.8;
  transition: opacity var(--duration-fast);
  text-decoration: none;
}

.list-nav li a:hover {
  opacity: 1;
  text-decoration: underline;
}


/* ============================================================
   18. TABLES
   ============================================================ */

/* Base Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--table-border, var(--border));
}

.table th {
  font-weight: 600;
  color: var(--table-header-fg, var(--text-primary));
  background: var(--table-header-bg, var(--bg-surface-alt));
}

.table td {
  color: var(--text-secondary);
}

.table tbody tr:hover {
  background: var(--bg-surface-alt);
}

/* Table Variants */
.table--bordered {
  border: 1px solid var(--table-border, var(--border));
}

.table--bordered th,
.table--bordered td {
  border: 1px solid var(--table-border, var(--border));
}

.table--striped tbody tr:nth-child(odd) {
  background: var(--table-row-bg, var(--bg-surface));
}

.table--striped tbody tr:nth-child(even) {
  background: var(--table-row-alt-bg, var(--bg-surface-alt));
}

.table--compact th,
.table--compact td {
  padding: var(--space-2) var(--space-3);
}

.table--spacious th,
.table--spacious td {
  padding: var(--space-4) var(--space-5);
}

/* Responsive Table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .table--responsive-stack {
    display: block;
  }
  
  .table--responsive-stack thead {
    display: none;
  }
  
  .table--responsive-stack tbody,
  .table--responsive-stack tr,
  .table--responsive-stack td {
    display: block;
  }
  
  .table--responsive-stack tr {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
  }
  
  .table--responsive-stack td {
    padding: var(--space-2) 0;
    border: none;
  }
  
  .table--responsive-stack td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
  }
}


/* ============================================================
   19. CODE BLOCKS
   ============================================================ */

/* Inline Code */
code:not([class*="language-"]) {
  padding: 0.2em 0.4em;
  font-size: 0.85em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--code-bg, var(--bg-surface-alt));
  color: var(--code-fg, var(--text-primary));
  border: 1px solid var(--code-border, var(--border));
  border-radius: var(--radius-sm);
}

/* Code Block */
pre {
  margin: 0;
  padding: var(--space-5);
  font-size: var(--text-sm);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--code-block-bg, var(--bg-surface-alt));
  border: 1px solid var(--code-border, var(--border));
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: transparent;
  border: none;
  font-size: inherit;
}

/* Code Block with Header */
.code-block {
  border: 1px solid var(--code-border, var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--code-border, var(--border));
}

.code-block__language {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.code-block__copy {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) ease;
}

.code-block__copy:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
}


/* ============================================================
   20. MISCELLANEOUS UI
   ============================================================ */

/* Chip / Tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  cursor: default;
}

.chip--clickable {
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.chip--clickable:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.chip--active {
  background: var(--primary);
  color: var(--on-primary);
}

.chip i {
  font-size: 14px;
}

.chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  margin-right: -4px;
  font-size: 12px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.7;
  cursor: pointer;
}

.chip__remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

/* Separator */
.separator {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Callout */
.callout {
  padding: var(--space-5);
  background: var(--primary-soft);
  border-radius: var(--radius-lg);
}

.callout__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-3);
  font-size: 20px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 50%;
}

.callout__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.callout__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state__icon {
  font-size: 64px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: var(--space-6);
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.empty-state__text {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 400px;
}

/* Kbd (Keyboard) */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--space-2);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Mark (Highlight) */
mark {
  padding: 0.1em 0.3em;
  background: var(--warning-soft);
  color: inherit;
  border-radius: var(--radius-xs, 2px);
}

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--duration-normal) ease;
  z-index: var(--z-sticky);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-hover);
  transform: translateY(-4px);
}

/* Notice Banner */
.notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
}

.notice a {
  color: inherit;
  text-decoration: underline;
}

.notice__close {
  padding: var(--space-1);
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
}

.notice__close:hover {
  opacity: 1;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Countdown */
.countdown {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.countdown__value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 64px;
  font-size: var(--text-3xl);
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Подпись под всем таймером */
.countdown__caption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-3);
}

/* ctd-01: Default (базовый стиль — см. .countdown выше) */

/* ctd-02: Compact — только числа, без подписей, меньший размер */
.ctd-02 .countdown__value {
  min-width: 48px;
  height: 48px;
  font-size: var(--text-2xl);
}

/* ctd-03: Boxed — акцентированная карточка для каждого блока */
.ctd-03 .countdown__value {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  border-radius: var(--radius-xl);
  min-width: 72px;
  height: 72px;
  font-size: var(--text-3xl);
}

.ctd-03 .countdown__label {
  color: var(--text-secondary);
}

/* Price Display */
.price {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
}

.price__currency {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--text-muted);
}

.price__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.price__period {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
}

.price--old {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.7em;
}

.price--sale .price__value {
  color: var(--error);
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton--wave::after,
  .progress--animated .progress__bar,
  .progress--indeterminate .progress__bar,
  .toast,
  .toast.is-leaving,
  .loading-spinner,
  [data-tooltip]::before,
  [data-tooltip]::after {
    animation: none;
    transition: none;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .badge,
  .alert,
  .toast {
    border-width: 2px;
  }
  
  .progress {
    border: 1px solid var(--border);
  }
}


/* ============================================================
   21. VIDEO (3 варианта)
   ============================================================ */

/* Base Video wrapper */
.video {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-invert);
}

/* vid-01: Embed (iframe — YouTube, Vimeo, etc.) */
.vid-01 .video__embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.vid-01 .video__embed--4x3 {
  padding-bottom: 75%;
}

.vid-01 .video__embed--1x1 {
  padding-bottom: 100%;
}

.vid-01 .video__embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* vid-02: Native HTML5 video */
.vid-02 .video__player {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* vid-03: Thumbnail with play button overlay */
.vid-03 .video__thumbnail {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.vid-03 .video__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-base) ease;
}

.vid-03 .video__thumbnail:hover img {
  transform: scale(1.03);
}

.vid-03 .video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: var(--primary);
  font-size: 28px;
  transition: all var(--duration-fast) ease;
  box-shadow: var(--shadow-lg);
}

.vid-03 .video__thumbnail:hover .video__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: #fff;
  box-shadow: 0 0 0 8px rgba(var(--primary-rgb, 99, 102, 241), 0.2);
}

/* Optional caption below any video variant */
.video__caption {
  padding: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}


/* ============================================================
   22. GALLERY (3 варианта)
   ============================================================ */

/* Base Gallery */
.gallery {
  width: 100%;
}

.gallery__item {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
}

.gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-base) ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

/* gal-01: Uniform grid */
.gal-01 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
}

.gal-01 .gallery__item {
  aspect-ratio: 1 / 1;
}

@media (max-width: 768px) {
  .gal-01 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gal-01 {
    grid-template-columns: 1fr;
  }
}

/* gal-02: Masonry-style (CSS columns) */
.gal-02 {
  column-count: var(--gallery-cols, 3);
  column-gap: var(--space-4);
}

.gal-02 .gallery__item {
  break-inside: avoid;
  margin-bottom: var(--space-4);
  aspect-ratio: unset;
}

@media (max-width: 768px) {
  .gal-02 {
    column-count: 2;
  }
}

@media (max-width: 480px) {
  .gal-02 {
    column-count: 1;
  }
}

/* gal-03: Horizontal scroll strip */
.gal-03 {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-1); /* space for scrollbar */
}

.gal-03 .gallery__item {
  flex: 0 0 auto;
  width: var(--gallery-item-width, 280px);
  aspect-ratio: 4 / 3;
  scroll-snap-align: start;
}

/* Caption inside gallery item (optional) */
.gallery__caption {
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

/* ── Lightbox overlay (created by 13-gallery.js) ─────────────── */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
  display: block;
}

.gallery-lightbox__caption {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: var(--text-sm);
  background: rgba(0, 0, 0, .5);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-lightbox__close,
.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: absolute;
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: var(--radius-full);
  line-height: 1;
  transition: background var(--duration-fast, .15s);
}

.gallery-lightbox__close:hover,
.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
  background: rgba(255, 255, 255, .3);
}

.gallery-lightbox__close {
  top: var(--space-4);
  right: var(--space-4);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox__prev { left: var(--space-4); }
.gallery-lightbox__next { right: var(--space-4); }

@media (max-width: 640px) {
  .gallery-lightbox__prev,
  .gallery-lightbox__next {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.5rem;
  }
}


/* ============================================================
   23. CAROUSEL (3 варианта)
   ============================================================

   Чисто CSS-решение. Нет JS-зависимостей для базового отображения.
   Для автоплея и кнопок nav — JS на стороне клиента (data-атрибуты).

   car-01: Slide          — один слайд в поле зрения, стрелки, dots
   car-02: Multi-Slide    — несколько слайдов (2–4), gap между ними
   car-03: Fade           — затухание между слайдами (через JS-классы)

   Принцип:
   - .carousel — контейнер (overflow hidden, relative)
   - .carousel__track — flex-лента слайдов (transform через JS)
   - .carousel__slide — один слайд (flex-shrink: 0)
   - .carousel__prev, .carousel__next — навигационные кнопки
   - .carousel__dots — пагинация точками
   - .carousel__dot — одна точка, .is-active → primary
   ============================================================ */

/* Base Carousel */
.carousel {
  position: relative;
  width: 100%;
  /* overflow-x обрезает слайды, overflow-y оставляем visible для dots со scale() */
  overflow-x: clip;
  overflow-y: visible;
}

/* Track — горизонтальная лента слайдов */
.carousel__track {
  display: flex;
  transition: transform var(--duration-normal) var(--ease-in-out);
  will-change: transform;
}

/* Single slide */
.carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
}

/* Navigation arrows */
.carousel__prev,
.carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.25rem;
  transition: background-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
  box-shadow: var(--shadow-sm);
}

.carousel__prev:hover,
.carousel__next:hover {
  background-color: var(--bg-surface-alt);
  box-shadow: var(--shadow-md);
}

.carousel__prev:disabled,
.carousel__next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.carousel__prev {
  left: 12px;
}

.carousel__next {
  right: 12px;
}

/* Dots pagination */
.carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  /* padding вместо margin чтобы scale(1.3) не обрезался overflow:hidden родителя */
  padding: 4px 0 6px;
  list-style: none;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border);
  border: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
  padding: 0;
}

.carousel__dot:hover {
  background-color: var(--text-muted);
}

.carousel__dot.is-active {
  background-color: var(--primary);
  transform: scale(1.3);
}

/* car-01: Single Slide (default) */
.car-01 .carousel__slide {
  flex: 0 0 100%;
  /* Отступы по бокам чтобы текст не налезал на стрелки (44px кнопка + 12px отступ + 8px зазор) */
  padding-left: 64px;
  padding-right: 64px;
}

@media (max-width: 480px) {
  .car-01 .carousel__slide {
    padding-left: 48px;
    padding-right: 48px;
  }
}

/* car-02: Multi-Slide — несколько слайдов в поле зрения */
.car-02 .carousel__track {
  gap: var(--space-5);
}

.car-02 .carousel__slide {
  flex: 0 0 calc(50% - var(--space-3));
}

@media (min-width: 768px) {
  .car-02 .carousel__slide {
    flex: 0 0 calc(33.333% - var(--space-4));
  }
}

@media (min-width: 1024px) {
  .car-02 .carousel__slide {
    /* Количество видимых слайдов управляется через --carousel-visible */
    flex: 0 0 calc((100% / var(--carousel-visible, 3)) - var(--space-4));
  }
}

/* car-03: Fade — opacity-based (JS переключает .is-active) */
.car-03 {
  position: relative;
}

.car-03 .carousel__track {
  display: block; /* отключаем flex для fade-варианта */
}

.car-03 .carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-slow) ease,
              visibility var(--duration-slow) ease;
}

.car-03 .carousel__slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

/* Carousel sizes */
.carousel--sm .carousel__prev,
.carousel--sm .carousel__next {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.carousel--lg .carousel__prev,
.carousel--lg .carousel__next {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

/* Arrows inside (поверх слайдов) */
.carousel--arrows-inside .carousel__prev,
.carousel--arrows-inside .carousel__next {
  background-color: rgba(var(--shadow-color), 0.4);
  color: var(--text-inverted);
  border-color: transparent;
  backdrop-filter: blur(4px);
}

/* Arrows hidden on mobile */
@media (max-width: 639px) {
  .carousel--arrows-hide-mobile .carousel__prev,
  .carousel--arrows-hide-mobile .carousel__next {
    display: none;
  }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  .toast-container,
  .modal-backdrop,
  .modal,
  .scroll-top,
  .notice,
  .loading-overlay,
  .trust-badges--floating {
    display: none !important;
  }
  
  .accordion__content {
    display: block !important;
  }
  
  .tabs__panel {
    display: block !important;
  }
}


/* ============================================================
   24. HEADING ACCENT + DECORATORS
   ============================================================

   heading-accent — inline span для {curly brace} синтаксиса.
   Цвет контролируется CSS-переменной --heading-accent-color,
   которая берёт значение из текущей цветовой схемы (--primary).

   heading-decorated — обёртка с декоративным элементом вокруг заголовка.
   8 вариантов: lines / lines-short / underline / underline-accent /
                overline / bracket / badge-line / shadow-text
   ============================================================ */


/* --- Accent span --- */

.heading-accent {
  color: var(--heading-accent-color, var(--primary));
  font-style: inherit;
  font-weight: inherit;
}

/* На тёмных фонах акцент ярче */
.text-on-dark .heading-accent,
[data-scheme] .heading-accent {
  color: var(--heading-accent-color, var(--primary-light, var(--primary)));
}


/* --- Decorator wrapper base --- */

.heading-decorated {
  display: block;
}

/* Alignment modifiers на wrapper */
.heading-decorated--center {
  text-align: center;
}
.heading-decorated--right {
  text-align: right;
}


/* ============================================================
   Decorator 1: lines
   Горизонтальные линии по обе стороны текста (как в референсе).
   Работает через flex + ::before/::after.
   ============================================================ */

.heading-decorated--lines {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  white-space: nowrap;
}

.heading-decorated--lines::before,
.heading-decorated--lines::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.25;
  min-width: var(--space-6);
}

/* left-align: линия только справа */
.heading-decorated--lines:not(.heading-decorated--center):not(.heading-decorated--right)::before {
  display: none;
}


/* ============================================================
   Decorator 2: lines-short
   Короткие линии фиксированной длины по бокам.
   Лучше смотрится на центрированных заголовках.
   ============================================================ */

.heading-decorated--lines-short {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.heading-decorated--lines-short::before,
.heading-decorated--lines-short::after {
  content: '';
  width: 3rem;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.heading-decorated--lines-short.heading-decorated--left::before {
  display: none;
}

.heading-decorated--lines-short.heading-decorated--right::after {
  display: none;
}


/* ============================================================
   Decorator 3: underline
   Простая линия под заголовком — через border-bottom.
   ============================================================ */

.heading-decorated--underline {
  display: inline-block;
  padding-bottom: var(--space-3);
  border-bottom: 2px solid currentColor;
  opacity: 0.7;
}

.heading-decorated--center.heading-decorated--underline {
  display: block;
  text-align: center;
}


/* ============================================================
   Decorator 4: underline-accent
   Цветная акцентная черта под заголовком — через ::after.
   Ширина 40% по центру или 3rem слева.
   ============================================================ */

.heading-decorated--underline-accent {
  position: relative;
  padding-bottom: var(--space-4);
}

.heading-decorated--underline-accent::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3rem;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.heading-decorated--underline-accent.heading-decorated--center::after {
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
}

.heading-decorated--underline-accent.heading-decorated--right::after {
  left: auto;
  right: 0;
}


/* ============================================================
   Decorator 5: overline
   Тонкая линия НАД заголовком.
   Элегантно для section headers.
   ============================================================ */

.heading-decorated--overline {
  position: relative;
  padding-top: var(--space-4);
}

.heading-decorated--overline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.heading-decorated--overline.heading-decorated--center::before {
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
}

.heading-decorated--overline.heading-decorated--right::before {
  left: auto;
  right: 0;
}


/* ============================================================
   Decorator 6: bracket
   Угловые скобки [ ] вокруг текста через ::before/::after.
   Технический/геометрический стиль.
   ============================================================ */

.heading-decorated--bracket {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.heading-decorated--bracket::before,
.heading-decorated--bracket::after {
  content: '';
  display: block;
  width: 10px;
  height: 1.2em;
  border-color: var(--primary);
  border-style: solid;
  opacity: 0.6;
  flex-shrink: 0;
}

.heading-decorated--bracket::before {
  border-width: 2px 0 2px 2px;
}

.heading-decorated--bracket::after {
  border-width: 2px 2px 2px 0;
}

.heading-decorated--bracket.heading-decorated--center {
  justify-content: center;
  display: flex;
}


/* ============================================================
   Decorator 7: badge-line
   Маленький цветной прямоугольник-пилюля слева от текста.
   Подходит для боковых меток / категорий.
   ============================================================ */

.heading-decorated--badge-line {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.heading-decorated--badge-line::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.1em;
  background: var(--primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.heading-decorated--badge-line.heading-decorated--center {
  justify-content: center;
}

.heading-decorated--badge-line.heading-decorated--right {
  flex-direction: row-reverse;
}


/* ============================================================
   Decorator 8: shadow-text
   Крупный полупрозрачный "тень-текст" позади заголовка
   через CSS data-attr trick: нет JS, только CSS content.
   Текст берётся из атрибута data-shadow на wrapper (не ставится
   автоматически — только если шаблон явно добавит extra_class).
   Используется совместно с class="..." на wrapper через extra_classes.

   Проще: декоративный ::before с крупным outline-текстом.
   Текст тот же — через attr() не работает без JS в CSS < 5.
   Поэтому shadow-text добавляет просто background outline effect
   через text-shadow на самом заголовке.
   ============================================================ */

.heading-decorated--shadow-text h1,
.heading-decorated--shadow-text h2,
.heading-decorated--shadow-text h3,
.heading-decorated--shadow-text h4,
.heading-decorated--shadow-text h5,
.heading-decorated--shadow-text h6 {
  text-shadow:
    1px 1px 0 var(--primary-soft, rgba(0,0,0,0.08)),
    2px 2px 0 var(--primary-soft, rgba(0,0,0,0.05)),
    3px 3px 0 var(--primary-soft, rgba(0,0,0,0.03));
  letter-spacing: -0.01em;
}
