:root {
    /* Theme colors - Light theme (default) */
    --bg: #ffffff;
    --bg-secondary: #f5f5f5;
    --text: #000000;
    --text-secondary: #222222;
    --text-tertiary: #555555;
    --text-muted: #666666;
    --card: #ffffff;
    --card-secondary: #f0f0f0;
    --border: #e0e0e0;
    --border-secondary: #cccccc;
    --border-hover: #999999;
    --header-bg: rgba(255, 255, 255, 0.80);
    --header-border: rgba(255, 255, 255, 0.08);
    --popup-bg: #ffffff;
    --popup-border: #cccccc;
    --input-bg: rgba(255, 255, 255, 0.25);
    --input-bg-focus: rgba(255, 255, 255, 0.35);
    --input-border: #cccccc;
    --input-border-focus: #999999;
    --button-primary-bg: #000000;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #f0f0f0;
    --button-secondary-text: #111111;
    --button-hover-bg: #f5f5f5;
    --alert-warning-bg: #fff3cd;
    --alert-warning-border: #ffe69c;
    --alert-warning-text: #664d03;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Liquid Glass effect variables */
    --shadow-offset: 0;
    --shadow-blur: 20px;
    --shadow-spread: -5px;
    --tint-color: 255, 255, 255;
    --tint-opacity: 0.4;
    --frost-blur: 6px;
    --noise-frequency: 0.008;
    --distortion-strength: 77;
    --outer-shadow-blur: 24px;
    /* Primer-style glass (header & menu) */
    --c-glass: #f3f3f4;
    --c-glass-light: #fff;
    --c-glass-dark: #000;
    --glass-saturation: 150%;
    --glass-reflex-light: 1;
    --glass-reflex-dark: 1;
    --glass-mix: 50%;
}

html.dark {
    /* Theme colors - Dark theme */
    --bg: #0e0e0e;
    --bg-secondary: #1a1a1a;
    --text: #f5f5f5;
    --text-secondary: #e0e0e0;
    --text-tertiary: #b0b0b0;
    --text-muted: #bdbdbd;
    --card: #0e0e0e;
    --card-secondary: #252525;
    --border: #2a2a2a;
    --border-secondary: #3a3a3a;
    --border-hover: #4a4a4a;
    --header-bg: rgba(8, 8, 8, 0.82);
    --header-border: rgba(255, 255, 255, 0.1);
    --popup-bg: #1a1a1a;
    --popup-border: #3a3a3a;
    --input-bg: rgba(26, 26, 26, 0.5);
    --input-bg-focus: rgba(26, 26, 26, 0.7);
    --input-border: #3a3a3a;
    --input-border-focus: #4a4a4a;
    --button-primary-bg: #ffffff;
    --button-primary-text: #000000;
    --button-secondary-bg: #2a2a2a;
    --button-secondary-text: #f5f5f5;
    --button-hover-bg: #252525;
    --alert-warning-bg: #3a2a00;
    --alert-warning-border: #5a4a00;
    --alert-warning-text: #ffd700;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* Liquid Glass effect variables for dark theme */
    --tint-color: 14, 14, 14;
    --tint-opacity: 0.6;
    /* Primer-style glass dark */
    --c-glass: #121212;
    --c-glass-light: #fff;
    --c-glass-dark: #000;
    --glass-saturation: 150%;
    --glass-reflex-light: 0.3;
    --glass-reflex-dark: 2;
    --glass-mix: 50%;
}

body { 
    font-family: 'IBM Plex Mono', monospace; 
    background-color: var(--bg); 
    margin: 0; 
    padding: 0; 
    color: var(--text);
    transition: background-color 0.25s ease, color 0.25s ease;
}
.header-bg {
position: fixed;
top: 8px;
left: 50%;
transform: translateX(-50%);
max-width: 1000px;
width: calc(100% - 30px);
height: 52px;
border-radius: 9999px;
z-index: 999;
isolation: isolate;
overflow: hidden;
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 1.8px 3px 0 -2px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -2px -2px 0 -2px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -0.3px -1px 4px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 12%), transparent),
    0 1px 5px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 6px 16px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

.header-bg::before {
content: '';
position: absolute;
inset: 0;
z-index: 0;
background-color: color-mix(in srgb, var(--c-glass) var(--glass-mix, 12%), transparent);
border-bottom: none;
}

.header-bg::after {
content: '';
position: absolute;
inset: 0;
z-index: -1;
backdrop-filter: blur(8px) saturate(var(--glass-saturation));
-webkit-backdrop-filter: blur(8px) saturate(var(--glass-saturation));
isolation: isolate;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30px;
height: 52px;
background: none;
border: none;
border-radius: 9999px;
position: fixed;
top: 8px;
left: 50%;
transform: translateX(-50%);
max-width: 1000px;
width: calc(100% - 30px);
z-index: 1000;
box-sizing: border-box;
}
.header-left {
display: flex;
align-items: center;
position: relative;
z-index: 2;
}
.header-logo {
display: flex;
align-items: center;
justify-content: center;
font-family: 'IBM Plex Mono', monospace;
font-weight: 700;
font-size: 2em;
letter-spacing: 2px;
user-select: none;
height: 52px;
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 1;
}
.header-logo a {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.header-logo img {
height: 20px;
width: auto;
display: block;
margin: 0 8px;
}
.header-center {
display: none;
}
.search-bar {
display: flex;
align-items: center;
height: 40px;
margin: 0;
padding: 0;
}
.search-toggle-btn {
width: 40px;
height: 40px;
border-radius: 99em;
border: none;
background: var(--input-bg);
color: var(--text);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background-color 0.25s ease, box-shadow 0.25s ease;
flex-shrink: 0;
}
.search-toggle-btn .bi {
font-size: 15px;
}
.search-toggle-btn:hover {
background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}
.header-left {
display: flex;
align-items: center;
gap: 8px;
}
.search-field {
display: flex;
align-items: center;
position: relative;
width: 0;
opacity: 0;
pointer-events: none;
transition: width 0.3s ease, opacity 0.25s ease;
overflow: visible;
}
.search-bar.is-open .search-field {
width: clamp(220px, 35vw, 320px);
opacity: 1;
pointer-events: auto;
}
.search-bar .search-input {
height: 36px;
font-size: clamp(0.9em, 1.5vw, 1.05em);
display: flex;
align-items: center;
width: 100%;
padding-left: 1rem;
padding-right: 2.5rem;
border-radius: 999px;
border: none;
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
background-color: color-mix(in srgb, var(--c-glass) 12%, transparent);
backdrop-filter: blur(8px) saturate(var(--glass-saturation));
-webkit-backdrop-filter: blur(8px) saturate(var(--glass-saturation));
color: var(--text-secondary);
transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
box-sizing: border-box;
position: relative;
z-index: 1;
}
.search-bar .search-input:focus {
outline: none;
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
background-color: color-mix(in srgb, var(--c-glass) var(--glass-mix, 24%), transparent);
}
.search-bar .search-input::placeholder {
color: var(--text-tertiary);
opacity: 0.7;
}
.search-field .filter-btn {
position: absolute;
right: 4px;
top: 2px;
margin-left: 0;
z-index: 10;
background: transparent !important;
border: none;
box-shadow: none;
transition: color 0.2s;
display: none;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
cursor: pointer;
pointer-events: auto;
}
.search-bar.is-open .filter-btn {
display: flex;
}
.search-bar .filter-btn:hover {
background: transparent !important;
box-shadow: none;
}
.search-bar .filter-btn svg {
width: 18px;
height: 18px;
transition: fill 0.25s ease;
}
/* Light theme - dark icon */
html:not(.dark) .search-field .filter-btn svg {
fill: var(--text-secondary);
}
/* Dark theme - light icon */
html.dark .search-field .filter-btn svg {
fill: var(--text-secondary);
}
.search-field .filter-btn:hover svg {
fill: var(--text);
}
.header-icons {
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
position: relative;
height: 52px;
z-index: 2;
}
#languageBtn {
position: relative;
}
#themeToggle {
position: relative;
}
.icon-btn, .balance {
display: flex;
align-items: center;
justify-content: center;
height: 40px;
}

.balance {
background: none;
border: none;
cursor: pointer;
padding: 8px 12px;
border-radius: 99em;
font-weight: 500;
color: var(--text);
transition: background-color 0.2s ease, box-shadow 0.2s ease;
font-size: 16px;
}

.balance:hover {
background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}
.icon-btn {
background: none;
border: none;
cursor: pointer;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 99em;
transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.icon-btn:hover {
background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}
.icon-btn .material-symbols-outlined,
.icon-btn .bi {
font-size: 18px;
color: var(--text-secondary);
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
height: 24px;
transition: color 0.2s;
}

.icon-btn:hover .material-symbols-outlined,
.icon-btn:hover .bi {
color: var(--text);
}
.icon-btn:focus { outline: none; }
.profile-popup, .filter-popup {
display: none;
position: absolute;
top: 63px; /* Position below the header pill */
background: var(--popup-bg);
border: 1px solid var(--popup-border);
border-radius: 8px;
box-shadow: 0 2px 8px var(--shadow-color);
z-index: 100;
transition: background-color 0.25s ease, border-color 0.25s ease;
}
.main-container { padding: 60px 40px 20px; }
a { color: var(--text); text-decoration: none; transition: color 0.25s ease; }

.email-verify-banner {
  margin: 60px auto 0;
  max-width: 1082px;
  width: calc(100% - 30px);
  background: var(--alert-warning-bg);
  border: 1px solid var(--alert-warning-border);
  color: var(--alert-warning-text);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 6px 18px var(--shadow-color);
  box-sizing: border-box;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.email-verify-title { font-weight: 700; margin-bottom: 4px; }
.email-verify-text { font-size: 0.95em; margin: 0; }
.email-verify-actions { display: flex; align-items: flex-end; gap: 6px; flex-direction: column; min-width: 180px; }
.email-verify-btn {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s, background-color 0.25s ease, color 0.25s ease;
}
.email-verify-btn.secondary {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
}
.email-verify-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.email-verify-status { font-size: 0.9em; color: var(--alert-warning-text); min-height: 18px; text-align: right; align-self: stretch; }

.verify-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.verify-modal.active { display: flex; }
.verify-modal-card {
  background: var(--card);
  border-radius: 12px;
  padding: 22px 20px;
  max-width: 360px;
  width: 90vw;
  box-shadow: 0 10px 30px var(--shadow-color);
  text-align: center;
  transition: background-color 0.25s ease;
}
.verify-modal-title { font-size: 1.2em; font-weight: 700; margin-bottom: 8px; }
.verify-modal-text { margin: 0 0 16px 0; color: var(--text-tertiary); }

@media (max-width: 768px) {
  .email-verify-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 16px;
  }
  .email-verify-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    min-width: 0;
  }
  .email-verify-btn {
    width: 100%;
    text-align: center;
  }
  .email-verify-status { text-align: left; }
}

/* Стили для карточек товара */
.beat-card {
border-radius: 8px !important;
}

.beat-card img {
border-radius: 8px !important;
}

.beat-card .play-button {
opacity: 0 !important;
transition: opacity 0.3s ease !important;
}

.beat-card:hover .play-button,
.beat-card .beat-cover:hover .play-button {
opacity: 1 !important;
}

/* Кнопки внутри карточек: без принудительной черной обводки */
.beat-card .price-btn,
.beat-card .favorite-btn,
.beat-card .icon-btn {
border-radius: 6px !important;
}

/* При наведении на обложку показываем кнопку play */
.beat-card .beat-cover:hover .play-button {
opacity: 1 !important;
}

/* При клике на обложку также показываем кнопку play */
.beat-card .beat-cover:active .play-button {
opacity: 1 !important;
}

/* Стили для div элементов внутри beat-cover (заглушки обложек) */
.beat-card .beat-cover > div {
border-radius: 8px !important;
}

.lang-popup {
display: none;
position: absolute;
top: 63px;
right: 0;
min-width: 110px;
background: var(--popup-bg);
border: 1px solid var(--popup-border);
border-radius: 8px;
box-shadow: 0 2px 8px var(--shadow-color);
z-index: 100;
transition: background-color 0.25s ease, border-color 0.25s ease;
}
.lang-popup.active {
display: block;
}
.filter-popup {
/* Positioned relative to the form */
top: 52px;
left: 48px;
transform: none;
width: clamp(220px, 35vw, 320px);
max-width: calc(100vw - 32px);
padding: 16px;
box-sizing: border-box;
position: absolute;
}

.filter-popup.active {
display: block;
}
.filter-popup .form-group {
margin-bottom: 12px;
}
.filter-popup label {
display: block;
margin-bottom: 6px;
font-size: 0.9em;
color: var(--text-secondary);
}
.filter-popup select, .filter-popup input {
width: 100%;
padding: 8px 12px;
border: 1px solid var(--input-border);
border-radius: 8px;
font-family: inherit;
font-size: 0.9em;
box-sizing: border-box;
background: var(--card);
color: var(--text);
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.filter-popup .bpm-inputs {
display: flex;
gap: 8px;
align-items: center;
}
.filter-popup .bpm-inputs input { width: 100%; }

/* Стили для оберток фильтров внутри filter-popup */
.filter-popup .product-type-filters-wrapper,
.filter-popup .category-filters-wrapper {
    padding: 0;
    margin-bottom: 12px;
}

.filter-popup .product-type-filters-wrapper label,
.filter-popup .category-filters-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.filter-popup .product-type-filters-wrapper .category-filters,
.filter-popup .category-filters-wrapper .category-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 0;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.filter-popup .category-filters::-webkit-scrollbar {
    display: none;
}

/* Контейнер для категорий с кнопками навигации */
.filter-popup .category-filters-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-popup .category-filters-wrapper .category-filters {
    flex: 1;
    min-width: 0;
}

/* Кнопки навигации для категорий (только на ПК) */
.filter-popup .category-scroll-btn {
    display: none;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.filter-popup .category-scroll-btn:hover:not(:disabled) {
    background: var(--button-hover-bg);
    border-color: var(--border-hover);
}

.filter-popup .category-scroll-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.filter-popup .category-scroll-btn i {
    font-size: 16px;
}

/* Показываем кнопки только на ПК */
@media (min-width: 769px) {
    .filter-popup .category-scroll-btn {
        display: flex;
    }
}

.filter-popup .category-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: var(--card);
    font-family: inherit;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(.4,0,.2,1);
    color: var(--text-secondary);
    white-space: nowrap;
    outline: none;
    text-decoration: none;
    display: inline-block;
}

.filter-popup .category-btn.selected {
    background: var(--bg-secondary);
    color: var(--text);
    font-weight: 500;
}

.filter-popup .category-btn:hover:not(.selected) {
    background: var(--card-secondary);
    color: var(--text-secondary);
}

.filter-popup .apply-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: var(--button-primary-bg);
    color: var(--button-primary-text);
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Custom Multiselect Dropdown для жанров */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.multiselect-header:hover {
    border-color: var(--text-secondary);
}

.multiselect-header.active {
    border-color: var(--text-secondary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.multiselect-placeholder {
    font-size: 0.9em;
    color: var(--text-muted);
}

.multiselect-header.has-selection .multiselect-placeholder {
    color: var(--text);
}

.multiselect-header i {
    transition: transform 0.25s ease;
    color: var(--text-secondary);
}

.multiselect-header.active i {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--text-secondary);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.multiselect-dropdown.active {
    display: block;
}

.multiselect-search {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.genre-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.85em;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.genre-search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

.multiselect-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.multiselect-options::-webkit-scrollbar {
    width: 6px;
}

.multiselect-options::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.multiselect-options::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.multiselect-option:hover {
    background: var(--bg-secondary);
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.multiselect-option span {
    font-size: 0.9em;
    color: var(--text);
    transition: color 0.25s ease;
}

.multiselect-option input[type="checkbox"]:checked + span {
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-popup {
right: 60px; /* Adjust based on icon size and gap */
min-width: 160px;
}
.profile-popup.active, .filter-popup.active {
display: block;
}
.profile-popup a, .profile-popup form button {
display: block;
padding: 10px 18px;
color: var(--text-secondary);
text-decoration: none;
font-size: 1em;
background: none;
border: none;
width: 100%;
text-align: left;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
transition: background-color 0.25s ease, color 0.25s ease;
}
.lang-popup a.selected {
font-weight: bold;
background: var(--card-secondary);
}
.lang-option {
display: block;
padding: 10px 18px;
color: var(--text-secondary);
text-decoration: none;
font-size: 1em;
background: none;
border: none;
width: 100%;
text-align: left;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
transition: background-color 0.25s ease, color 0.25s ease;
}
.lang-option:hover {
background: var(--button-hover-bg);
}
.lang-option.selected {
font-weight: bold;
background: var(--card-secondary);
}
.profile-popup a:hover, .profile-popup form button:hover {
background: var(--button-hover-bg);
}
.profile-popup .divider {
height: 1px;
background: var(--border);
margin: 4px 0;
}

/* Hamburger menu styles */
#menuToggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1001;
    -webkit-user-select: none;
    user-select: none;
    width: 36px;
    height: 36px;
    border-radius: 99em;
    margin-right: 0; /* Align exactly with grid edge determined by header padding */
    overflow: visible;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#menuToggle:hover {
    background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
        inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
        inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
        inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
        inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
        inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
        0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

#menuToggle input {
    display: block;
    width: 36px;
    height: 36px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    -webkit-touch-callout: none;
    margin: 0;
}

#menuToggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    position: absolute;
    background: var(--text-secondary);
    border-radius: 2px;
    z-index: 1;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease, top 0.3s ease;
}

#menuToggle .bar-top {
    top: 10px;
    left: 6px;
    transform-origin: center;
}

#menuToggle .bar-mid {
    top: 17px;
    left: 6px;
    transform-origin: center;
}

#menuToggle .bar-bot {
    top: 24px;
    left: 6px;
    transform-origin: center;
}

/* Transform into a crossmark when checked */
#menuToggle input:checked ~ .bar-top {
    top: 17px;
    transform: rotate(45deg);
    background: var(--text);
}

#menuToggle input:checked ~ .bar-mid {
    opacity: 0;
    transform: scale(0);
}

#menuToggle input:checked ~ .bar-bot {
    top: 17px;
    transform: rotate(-45deg);
    background: var(--text);
}

#menuToggle .notifications-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4d4f;
    border: 2px solid #fff;
    pointer-events: none;
    z-index: 3;
}

/* Mobile menu overlay - removed, no overlay needed */
.mobile-menu-overlay {
display: none;
}

.mobile-menu {
position: fixed;
top: 60px;
right: max(calc((100vw - 1000px) / 2 + 20px), 20px);
width: 260px;
max-height: calc(100vh - 72px);
border: none;
border-radius: 0 0 10px 10px;
z-index: 998;
overflow: hidden;
overflow-y: auto;
overflow-x: hidden;
padding: 12px;
box-sizing: border-box;
display: block;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.25s ease;
scrollbar-width: none;
-ms-overflow-style: none;
isolation: isolate;
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 1.8px 3px 0 -2px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -2px -2px 0 -2px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -0.3px -1px 4px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 12%), transparent),
    0 1px 5px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 6px 16px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

.mobile-menu::before {
content: '';
position: absolute;
inset: 0;
z-index: 0;
background-color: color-mix(in srgb, var(--c-glass) var(--glass-mix, 12%), transparent);
border-radius: inherit;
pointer-events: none;
}

.mobile-menu::after {
content: '';
position: absolute;
inset: 0;
z-index: -1;
border-radius: inherit;
backdrop-filter: blur(8px) saturate(var(--glass-saturation));
-webkit-backdrop-filter: blur(8px) saturate(var(--glass-saturation));
isolation: isolate;
pointer-events: none;
}

.mobile-menu > * {
position: relative;
z-index: 1;
}

html.dark .mobile-menu {
background-color: transparent;
}

.mobile-menu::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}

.mobile-menu.active {
opacity: 1;
visibility: visible;
}

/* Позиционирование для ПК - меню под скруглённым хедером */
@media (min-width: 769px) {
.mobile-menu {
width: 260px;
top: 60px;
right: max(calc((100vw - 1000px) / 2 + 20px), 20px);
}
}

.mobile-menu-header {
    display: none;
}

.mobile-menu-title {
display: none;
}

.mobile-menu-close {
display: none;
}

.mobile-menu-section {
margin-bottom: 22px;
}

.mobile-menu-section h3 {
font-size: 0.82em;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 10px;
}

.mobile-menu-item {
display: flex;
align-items: center;
padding: 10px 12px;
color: var(--text-secondary);
text-decoration: none;
border-radius: 99em;
transition: background-color 0.2s, color 0.25s ease, box-shadow 0.2s ease;
margin-bottom: 2px;
margin-left: -12px;
margin-right: -12px;
}

.mobile-menu-item button {
color: var(--text-secondary);
}

.mobile-menu-item:hover {
background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
    inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
    0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

.mobile-menu-item .material-symbols-outlined,
.mobile-menu-item .bi {
margin-right: 10px;
font-size: 18px;
color: var(--text-muted);
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
}

.mobile-menu-item .menu-pill {
margin-left: auto;
padding: 2px 8px;
border-radius: 999px;
background: #ff4d4f;
color: #fff;
font-size: 0.7rem;
font-weight: 600;
line-height: 1;
}

.mobile-menu-item.balance {
font-weight: 600;
font-size: 1em;
color: var(--text);
padding: 12px 12px;
border-bottom: none;
margin-bottom: 14px;
margin-left: -12px;
margin-right: -12px;
display: flex;
align-items: center;
gap: 10px;
cursor: default;
pointer-events: none;
}

.mobile-menu-item.balance:hover {
background-color: transparent;
box-shadow: none;
}

.mobile-menu-item.balance > a {
pointer-events: auto;
cursor: pointer;
}

.balance-avatar-wrapper {
position: relative;
display: inline-block;
border-radius: 50%;
overflow: visible;
flex-shrink: 0;
z-index: 10;
}

.mobile-menu-item.balance .balance-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
box-shadow: 0 1px 4px rgba(0,0,0,0.1);
background: #f5f5f5;
position: relative;
z-index: 2;
display: block;
}

/* Эффект свечения за аватаркой в мобильном меню в темной теме */
html.dark .balance-avatar-wrapper::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 64px;
height: 64px;
border-radius: 50%;
background-image: var(--avatar-glow-url);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
filter: blur(30px) brightness(1.2);
opacity: 0.6;
z-index: 1;
pointer-events: none;
}

.mobile-menu-item.balance .balance-avatar-placeholder {
width: 40px;
height: 40px;
border-radius: 50%;
background: var(--bg-secondary);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}

.mobile-menu-item.balance .balance-avatar-placeholder .material-symbols-outlined,
.mobile-menu-item.balance .balance-avatar-placeholder .bi {
font-size: 26px;
color: var(--text-muted);
}

.mobile-menu-item.balance .balance-info {
display: flex;
flex-direction: column;
gap: 4px;
flex: 1;
min-width: 0;
}

.mobile-menu-item.balance .balance-username {
font-size: 0.9em;
font-weight: 600;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.mobile-menu-item.balance .balance-amount {
    font-size: 0.85em !important;
    font-weight: 500 !important;
    color: var(--text-muted);
    line-height: 1.2;
}

.mobile-menu-item.balance .material-symbols-outlined {
    display: none;
}

.mobile-menu-item.balance > a[href*="chats"] {
    flex-shrink: 0;
}

.mobile-menu-item.balance > a[href*="chats"] .bi {
    display: inline-flex !important;
    margin-right: 0;
    color: var(--text);
    font-size: 1.15em;
}

.mobile-menu-divider {
height: 1px;
background-color: transparent;
margin: 14px 0;
}

/* Mobile language buttons */
.mobile-lang-btn {
padding: 8px 16px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--card);
color: var(--text);
font-size: 0.9em;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.mobile-lang-btn:hover {
background: var(--button-hover-bg);
}
.mobile-lang-btn.selected {
background: var(--text);
color: var(--bg);
border-color: var(--text);
}


/* Mobile responsive styles - хедер покрупнее */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
        height: 48px;
        width: 100vw;
        border-radius: 9999px;
        top: 6px;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 24px);
        box-sizing: border-box;
    }
    .header-bg {
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100vw - 24px);
        width: calc(100vw - 24px);
        height: 48px;
        border-radius: 9999px;
    }
    .header-logo {
        display: flex;
        height: 48px;
    }
    .header-logo img {
        height: 18px;
    }
    .header-left {
        height: 48px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .search-bar {
        height: 40px;
    }
    .search-toggle-btn {
        width: 40px;
        height: 40px;
    }
    .search-toggle-btn .bi {
        font-size: 16px;
    }
    .search-bar.is-open .search-field {
        width: calc(100vw - 140px);
    }
    .search-bar .search-input {
        height: 40px;
        font-size: 0.95em;
        padding-left: 0.75rem;
        padding-right: 2.5rem;
    }
    .search-field .filter-btn {
        right: 2px;
        width: 32px;
        height: 32px;
        top: 2px;
    }
    .header-icons {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        position: static;
        height: 48px;
        flex-shrink: 0;
    }
    .header-icons .icon-btn {
        width: 40px;
        height: 40px;
    }
    .header-icons .icon-btn .material-symbols-outlined,
    .header-icons .icon-btn .bi {
        font-size: 20px;
    }
    .header-icons .balance {
        font-size: 0.9em;
        height: 40px;
        min-width: 44px;
        padding: 6px 10px;
    }
    #menuToggle {
        width: 40px;
        height: 40px;
    }
    #menuToggle input {
        width: 40px;
        height: 40px;
    }
    #menuToggle .bar {
        width: 22px;
    }
    #menuToggle .bar-top {
        top: 10px;
        left: 9px;
    }
    #menuToggle .bar-mid {
        top: 18px;
        left: 9px;
    }
    #menuToggle .bar-bot {
        top: 26px;
        left: 9px;
    }
    #menuToggle input:checked ~ .bar-top {
        top: 18px;
    }
    #menuToggle input:checked ~ .bar-bot {
        top: 18px;
    }
    .main-container {
        padding: 56px 16px 16px 16px;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .filter-popup.active {
        display: block;
        position: fixed;
        top: 54px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 32px);
        max-width: 400px;
        z-index: 1001;
    }
    .mobile-menu {
top: 54px;
right: 24px;
width: min(calc(100vw - 48px), 260px);
max-width: 260px;
max-height: calc(100vh - 70px);
        border: none;
        border-radius: 0 0 10px 10px;
        overflow-y: auto;
        overflow-x: hidden;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.25s ease;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 12px;
    }
    .mobile-menu::-webkit-scrollbar {
        display: none;
    }
    .mobile-menu.active {
        opacity: 1;
        visibility: visible;
    }
    .mobile-menu-item {
        padding: 10px 12px;
        font-size: 0.95em;
    }
    .mobile-menu-item .material-symbols-outlined,
    .mobile-menu-item .bi {
        font-size: 20px;
    }
}

/* На маленьких экранах сохраняем те же размеры что и на 768px */
@media (max-width: 480px) {
    .main-container {
        padding: 56px 12px 12px 12px;
    }
}

@media (max-width: 768px) {
/* Hide all header icons except hamburger menu and beatok button on mobile */
.header-icons .icon-btn:not(.mobile-beatok-btn),
.header-icons .language-switcher {
display: none !important;
}
.mobile-beatok-btn {
display: flex !important;
}
.header-icons {
gap: 8px !important;
}
}

@media (max-width: 700px) {
.header {
padding: 0 8px;
left: 50%;
transform: translateX(-50%);

}
.search-bar .filter-btn {
display: none !important;
}
.search-bar .filter-btn.active {
display: flex !important;
}
}



/* Footer styles */
footer {
    padding: 40px 0 20px 0;
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 30px;
    align-items: start;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 220px;
}

.footer-main .footer-column:nth-child(1) {
    justify-self: start;
}

.footer-main .footer-column:nth-child(2) {
    justify-self: center;
    align-items: center;
    text-align: center;
}

.footer-main .footer-column:nth-child(3) {
    justify-self: end;
    align-items: flex-end;
    text-align: right;
}

.footer-contact-column {
    align-items: flex-start;
    text-align: left;
}

.footer-contact-column .socials {
    justify-content: flex-start;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0 0 8px 0;
    transition: color 0.25s ease;
}

.footer-link {
    color: var(--text-muted);
    font-size: 0.9em;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text-secondary);
}

.footer-column h4 {
    color: var(--text-muted);
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 16px 0;
    transition: color 0.25s ease;
}

.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--text-secondary);
}

.socials {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.socials a {
    color: var(--text-muted);
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 99em;
}

.socials a:hover {
    color: var(--text);
    background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
        inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
        inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
        inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
        inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
        inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
        0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}

.socials a .bi {
    font-size: 20px;
    transition: color 0.2s;
}

/* Пилюли Telegram: плоские, низкие, серый текст и иконка, без обводки */
.socials a.footer-tg-pill {
    width: auto;
    height: auto;
    min-height: 28px;
    padding: 4px 10px 4px 8px;
    border-radius: 99em;
    border: none;
    background: var(--card);
    gap: 6px;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-muted);
}
.socials a.footer-tg-pill .bi {
    font-size: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.socials a.footer-tg-pill:hover {
    background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
    color: var(--text-secondary);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 10%), transparent),
        inset 2px 1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 90%), transparent),
        inset -1.5px -1px 0 -1px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 80%), transparent),
        inset -2px -6px 1px -5px color-mix(in srgb, var(--c-glass-light) calc(var(--glass-reflex-light) * 60%), transparent),
        inset -1px 2px 3px -1px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 20%), transparent),
        inset 0 -4px 1px -2px color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 10%), transparent),
        0 3px 6px 0 color-mix(in srgb, var(--c-glass-dark) calc(var(--glass-reflex-dark) * 8%), transparent);
}
.socials a.footer-tg-pill:hover .bi {
    color: var(--text-secondary);
}

/* Global и Russia в один ряд */
.footer-socials-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    margin-top: 16px;
}
.footer-socials-group {
    display: flex;
    flex-direction: column;
}

.footer-payments {
    text-align: left;
    margin-bottom: 30px;
}

.footer-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.payment-icons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.payment-icons img {
    height: 18px;
    transition: filter 0.25s ease;
}

/* Invert footer images and icons in dark theme (except beatprod logo) */
html.dark .payment-icons img {
    filter: brightness(0) invert(1);
}

html.dark footer svg:not(.footer-column img),
html.dark .socials svg {
    filter: brightness(0) invert(1);
}

/* Убираем фильтры для логотипа в футере */
footer img {
    filter: none !important;
}

html.dark .socials .bi {
    color: var(--text);
}

/* Verification checkmark icon */
.bi-patch-check-fill {
    color: #2196f3;
    vertical-align: middle;
    margin-left: 4px;
}

.footer-bottom {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85em;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

@media (max-width: 768px) {
    footer {
        padding: 32px 0 16px 0;
    }

    .footer-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 32px;
    }

    .footer-column {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .footer-main .footer-column:nth-child(1),
    .footer-main .footer-column:nth-child(2),
    .footer-main .footer-column:nth-child(3) {
        justify-self: center;
        align-items: center;
        text-align: center;
    }

    .footer-contact-column .socials {
        justify-content: center;
    }

    .footer-contact-column {
        align-items: center;
        text-align: center;
    }

    .footer-payments {
        text-align: center;
        width: 100%;
    }

    .payment-icons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    .footer-socials-row {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    footer {
        padding: 24px 0 16px 0;
    }

    .footer-main {
        gap: 24px;
    }

    .footer-text, .footer-column a, .footer-link {
        font-size: 0.85em;
    }
    .footer-title {
        font-size: 0.9em;
        margin-bottom: 12px;
    }
    .payment-icons {
        gap: 12px;
    }
    .payment-icons img {
        height: 16px;
    }
    .footer-bottom {
        font-size: 0.8em;
    }
    .socials {
        gap: 10px;
    }
}

/* Плавный скролл управляется Lenis (lenis-smooth-scroll library) */

/* Анимация для кнопки добавления в корзину */
.favorite-btn.add-to-cart-async {
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}

.favorite-btn.add-to-cart-async:hover {
background-color: var(--button-hover-bg);
border-color: var(--border);
}

.favorite-btn.add-to-cart-async:active {
transform: scale(0.95);
}

.favorite-btn.add-to-cart-async.added {
background-color: #000;
border-color: #000;
color: white;
animation: cartSuccess 0.6s ease;
}

.favorite-btn.add-to-cart-async.added .material-symbols-outlined {
animation: iconBounce 0.6s ease;
}

@keyframes cartSuccess {
0% {
transform: scale(1);
background-color: #f5f5f5;
border-color: #ddd;
color: #000;
}
50% {
transform: scale(1.1);
background-color: #000;
border-color: #000;
color: white;
}
100% {
transform: scale(1);
background-color: #000;
border-color: #000;
color: white;
}
}

@keyframes iconBounce {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.3);
}
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: max(calc((100vw - 1080px) / 2 + 8px), 8px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 16px var(--shadow-color);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95em;
    line-height: 1.5;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast-notification.success {
    border-left: 4px solid #4caf50;
}

.toast-notification.error {
    border-left: 4px solid #f44336;
}

.toast-notification.info {
    border-left: 4px solid #2196f3;
}

.toast-notification.warning {
    border-left: 4px solid #ff9800;
}

@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 8px;
        left: 8px;
        max-width: calc(100vw - 16px);
    }
    
    .toast-notification {
        min-width: auto;
        max-width: 100%;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
    
    .toast-notification.hide {
        transform: translateY(-100px);
    }
}

/* Legal pages styles (User Agreement, Privacy Policy, License Agreement) */
.legal-page-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 32px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color);
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text);
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.legal-page-container h1 {
    color: var(--text);
    margin-bottom: 24px;
    font-size: 2em;
    font-weight: 600;
    transition: color 0.25s ease;
}

.legal-page-container h2 {
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 1.5em;
    font-weight: 600;
    transition: color 0.25s ease;
}

.legal-page-container h3 {
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.25em;
    font-weight: 600;
    transition: color 0.25s ease;
}

.legal-page-container p {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 16px;
    transition: color 0.25s ease;
}

.legal-page-container ul {
    color: var(--text);
    margin-bottom: 16px;
    padding-left: 24px;
    transition: color 0.25s ease;
}

.legal-page-container li {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 8px;
    transition: color 0.25s ease;
}

.legal-page-container a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.25s ease;
}

.legal-page-container a:hover {
    color: var(--text);
    text-decoration: underline;
}

.legal-page-container b {
    color: var(--text);
    font-weight: 600;
    transition: color 0.25s ease;
}

.legal-page-container .legal-footer {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-top: 32px;
    transition: color 0.25s ease;
}

@media (max-width: 768px) {
    .legal-page-container {
        margin: 20px auto;
        padding: 24px 20px;
    }
    
    .legal-page-container h1 {
        font-size: 1.75em;
    }
    
    .legal-page-container h2 {
        font-size: 1.35em;
    }
    
    .legal-page-container h3 {
        font-size: 1.15em;
    }
}

.telegram-connect-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.telegram-connect-modal.active {
    display: flex;
}

.telegram-connect-card {
    width: min(420px, 100%);
    background: #ffffff;
    color: #000000;
    border-radius: 16px;
    border: none;
    padding: 24px 22px 20px;
    position: relative;
    box-shadow: none;
}

.telegram-connect-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    color: #000000;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.telegram-connect-title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.telegram-connect-text {
    margin: 0;
    color: #000000;
    font-size: 0.95rem;
    line-height: 1.45;
}

.telegram-connect-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.telegram-connect-primary,
.telegram-connect-secondary {
    flex: 1;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 600;
}

.telegram-connect-primary {
    background: #000000;
    color: #ffffff;
}

.telegram-connect-secondary {
    background: #ffffff;
    color: #000000;
}

.telegram-connect-hint {
    margin: 12px 0 0;
    color: #000000;
    font-size: 0.82rem;
}
