/* --- Убрали лишний отступ у контейнера --- */
@font-face {
  font-family: "ArtegraBlack";
  src: url("ARTEGRASANSEXBLACK.TTF");
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: "ArtegraRegular";
  src: url("ARTEGRASANSEXREGULAR.TTF");
  font-weight: 900;
  font-style: normal;
}
@font-face {  
  font-family: "Gilroy";
  src: url("GILROY-LIGHT.OTF");
  font-weight: 300;
  font-style: normal;
}

/* ===== VARIABLES ===== */
:root {
  --bg-primary: #050505;
  --bg-secondary: #0c0c0c;
  --bg-hover: #1c1c1c;
  --border-color: #969696;
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent-color: #bdbdbd; /* neutral accent — grayscale */
  --link-color: #bdbdbd;
  --error-color: #8a8a8a; /* muted grayscale for errors */
  --success-color: #8a8a8a;
  
  /*--border-radius-sm: 8px;
  --border-radius-md: 10px;
  --border-radius-lg: 20px;
  --border-radius-xl: 50px;*/

  --border-radius-sm: 15px;
  --border-radius-md: 20px;
  --border-radius-lg: 20px;
  --border-radius-xl: 20px;
  
  --transition: 0.2s ease;
  --spacing-xs: 10px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 40px;
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
}

body {
  margin: var(--spacing-xs);;
  font-family: "Gilroy", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* ===== LAYOUT COMPONENTS ===== */
.logo-wrapper {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin: 0 0 var(--spacing-sm) 0;
}

/* Place sparks panel on the right side in market header */
.market-header .sparks-panel {
  position: static;
  justify-self: end;
}

.logo {
  width: min(150px, 80%);
  height: auto;
  transition: var(--transition);
  justify-self: center; /* center in the middle column */
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  width: 100%;
  max-width: 1200px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  margin-top: 0 !important;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: "ArtegraBlack", sans-serif;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-sm) 0;
  font-weight: 300;
  line-height: 1.2;
}

h1 {
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.5px;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.3px;
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-size: clamp(20px, 3vw, 24px);
  margin-bottom: var(--spacing-sm);
}

h4 {
  font-size: clamp(18px, 2.5vw, 20px);
  margin-bottom: var(--spacing-xs);
}

h5 {
  font-size: 16px;
  margin-bottom: var(--spacing-xs);
}

h6 {
  font-size: 14px;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

p {
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-md) 0;
}

.lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.small {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Back label above titles */
.back-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  opacity: 0.9;
}

.muted {
  color: var(--text-muted);
}

.text-error {
  color: var(--error-color);
}

.text-success {
  color: var(--success-color);
}

.text-accent {
  color: var(--link-color);
}

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font weights */
.light { font-weight: 300; }
.medium { font-weight: 500; }
.bold { font-weight: 700; }

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ===== BUTTONS & CONTROLS ===== */
#backBtn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs);
  cursor: pointer;
  display: inline-block;
  width: 40px;
  height: 40px;
  transition: var(--transition);
  flex-shrink: 0;
  justify-self: start;
}

#backBtn img {
  width: 100%;
  height: 100%;
  display: block;
  transition: var(--transition);
}

#backBtn:hover img {
  filter: brightness(1.5);
}

.btn-primary {
  background: linear-gradient(180deg, #ffffff, #bdbdbd);
  color: #000000;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs) 24px;
  font-size: 18px;
  cursor: pointer;
  font-family: "Gilroy";
  transition: var(--transition);
}
.btn-primary {
  background: #fff;
  color: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs) 24px;
  font-size: 18px;
  cursor: pointer;
  font-family: "Gilroy";
  transition: var(--transition);
}
.file-upload-wrapper {
  position: relative;
  display: inline-block;
}
.file-upload-input {
  opacity: 0;
  width: 1px;
  height: 1px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
}
.file-upload-label {
  display: inline-block;
  background: #fff;
  color: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  font-family: "Gilroy";
  transition: var(--transition);
}
.file-upload-label:hover {
  background: #f2f2f2;
}

#premiumBtn {
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.02);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 6px 10px;
}

.btn-danger {
  background: linear-gradient(180deg, #2a2a2a, #0c0c0c);
  color: var(--text-primary);
  border: 1px solid #5a5a5a;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
}

.btn-success {
  background: linear-gradient(180deg, #2a2a2a, #0c0c0c);
  color: var(--text-primary);
  border: 1px solid #5a5a5a;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
}

/* Grid / Dashboard buttons */
.grid-button {
  height: 54px;
  border-radius: var(--border-radius-md);
  background: linear-gradient(180deg, #1a1a1a, var(--bg-secondary));
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.grid-button:not(:disabled):hover {
  background: rgba(255,255,255,0.02);
}

/* ===== GRID LAYOUTS ===== */
.brand-list,
.album-list {
  display: grid;
  gap: var(--spacing-sm);
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
}

.brand {
  width: 100%;
  padding: var(--spacing-xs);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.brand:hover {
  background: var(--bg-hover);
}

.album {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-xs);
}

.album.car {
  aspect-ratio: 9/16;
}

.album.video {
  aspect-ratio: 16/9;
}

.album img {
  width: 100%;
    aspect-ratio: 16/9;
}

.album.car img {
  aspect-ratio: 9/16;
}

/* ===== OVERLAY & MODALS ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--spacing-xs);
}

.overlay .message-box,
.overlay #premiumBox {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--text-primary);
  font-size: 18px;
  text-align: center;
  min-width: 200px;
  max-width: min(90vw, 500px);
  width: 100%;
}

.overlay #premiumBox {
  display: none;
}

/* ===== BRANDS SECTION ===== */
.brands .logo {
  position: relative;
  width: min(350px, 90%);
  height: auto;
  aspect-ratio: 3.06;
  object-fit: cover;
}

.brands .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  position: relative;
  align-self: stretch;
  width: 100%;
  max-width: 1200px;
  flex: 0 0 auto;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.brands .brand-title,
.brands .text-wrapper {
  position: relative;
  width: fit-content;
  font-family: "Gilroy-Light", Helvetica;
  font-weight: 300;
  color: var(--text-primary);
  font-size: clamp(24px, 5vw, 40px);
  letter-spacing: 0;
  line-height: normal;
  white-space: nowrap;
}

.brands .brand-title {
  margin-top: -2px;
}

.brands .brand-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--spacing-xs);
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.brands .brand-button {
  display: flex;
  width: min(400px, 100%);
  height: 88px;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  position: relative;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
}

/* ===== SEARCH COMPONENTS ===== */
.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.search-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1200px; /* ← ДОБАВЬТЕ ЭТУ СТРОЧКУ */
  margin: 0 auto; /* для центрирования */
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--spacing-sm);
  width: 20px;
  height: 20px;
  z-index: 1;
  pointer-events: none;
}

.search-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 40px;
  font-size: 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.loader {
  display: none;
  margin-top: var(--spacing-sm);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  text-align: center;
}

.loading-text {
  color: var(--text-muted);
  font-family: "ArtegraRegular", sans-serif;
  text-align: center;
  width: 100%;
  padding: var(--spacing-md) 0;
}

.product-category {
  color: var(--text-muted);
  font-family: "ArtegraRegular", sans-serif;
  font-size: 13px;
  margin-top: -4px;
}

.error {
  margin-top: var(--spacing-sm);
  color: var(--error-color);
  font-family: "Gilroy", sans-serif;
  text-align: center;
}

.error.success {
  color: var(--success-color);
}

.results {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  width: 100%;
}

.panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  transition: var(--transition);
}

.panel-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  min-width: 0;
}

.meta {
  flex: 1;
  min-width: 0;
  text-align: left; /* Принудительно выравниваем текст по левому краю */
}

.panel .title {
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left; /* Выравниваем по левому краю */
}

.panel .artist {
  color: var(--text-secondary);
  font-size: 14px;
  font-family: "Gilroy", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left; /* Выравниваем по левому краю */
}

.panel-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Стили для кнопок с иконками */
.play-btn, .download-btn {
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; /* Фиксированная ширина для квадратных кнопок */
  height: 40px; /* Фиксированная высота для квадратных кнопок */
}

.play-btn:disabled, .download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player {
  margin-top: var(--spacing-sm);
  width: 100%;
}

.player iframe {
  width: 100%;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

/* ===== РЕКЛАМНЫЙ БАННЕР ===== */
#dynamicAdBanner {
  width: 100%;
  display: block;
}

.ad-banner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 0 auto;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  color: var(--text-secondary);
  font-family: "Gilroy", sans-serif;
  font-size: 20px;
  text-align: center;
  padding: var(--spacing-md) 0;
  cursor: pointer;
  border: 1px dashed var(--border-color);
  transition: var(--transition);
  display: block;
}

.ad-banner:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-style: solid;
}

/* ===== REFERRAL SECTION ===== */
#referralSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  width: 100%;
  max-width: 1200px;
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--spacing-sm);
}

#referralContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  width: 100%;
}

#referralLinkContainer {
  display: flex; /* теперь контейнер видим и flex */
  flex-direction: row;
  width: 100%;
  align-items: center;        /* вертикальное центрирование */
  justify-content: space-between; /* ссылка слева, кнопка справа */
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  min-height: 60px;
}

#referralLinkText {
  flex: 1;            /* занимает всё свободное место */
  min-width: 0;        /* чтобы text-overflow работал внутри flex */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 20px;
  line-height: 1.2;
  padding: 0 var(--spacing-xs);
  margin: 0;          /* убираем дефолтные отступы <p> */
  text-align: left;   /* ссылка слева */
  align-self: center; /* вертикальное центрирование */
}

#copyRefBtn {
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: "Gilroy", sans-serif;
  font-size: 14px;
}

#copyRefBtn:hover {
  background: var(--bg-hover);
}

/* Style for the referral generate button */
#generateRefBtn {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  font-family: "ArtegraBlack", sans-serif;
  transition: var(--transition);
  width: 100%;
}

#generateRefBtn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== NAVIGATION BUTTONS ===== */
.navigation-buttons {
  width: 100%;
  max-width: 1200px;
  margin-bottom: var(--spacing-xs); /* Уменьшен отступ снизу */
}

/* Контейнер навигационных кнопок "Маркет" и "Страны" на главном экране mini app */
#navBtnContainer {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--spacing-xs) auto;
  text-align: center;
  font-size: 0; /* убираем пробелы между inline-block */
}

/* Сами навигационные кнопки на главном экране mini app */
#navBtnContainer .market-main-btn {
  display: inline-block;
  width: calc(50% - 4px); /* две кнопки в ряд с небольшим зазором */
  margin: 0 2px;
  box-sizing: border-box;
  font-size: 16px; /* возвращаем нормальный размер текста */
}

.nav-button {
  display: block;
  width: 100%;
  text-decoration: none;
}

.nav-button button {
  width: 100%;
  padding: var(--spacing-xs);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
}

.nav-button button:hover {
  background: var(--bg-hover);
}

/* ===== TYPOGRAPHY ENHANCEMENTS ===== */
#referralSection h3 {
  font-size: 24px; /* Увеличен до размера .title */
  margin: 0 0 var(--spacing-xs) 0; /* Уменьшен отступ снизу */
  font-weight: 300;
  color: var(--text-primary);
}

.title {
  font-size: 24px;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 var(--spacing-xs) 0; /* Уменьшен отступ снизу */
  font-family: "ArtegraBlack", sans-serif;
  font-weight: 300;
}

.overlay .message-box p {
  margin: 0;
  line-height: 1.4;
}

#premiumBox p {
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  body {
    padding: 8px;
    gap: var(--spacing-sm);
  }
  
  .brands .brand-button {
    width: 100%;
    height: auto;
    min-height: 80px;
  }
  
  .brands .brand-title,
  .brands .text-wrapper {
    font-size: 20px;
  }
  
  .container {
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
  }
  
  .brands .container {
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
  }

  #referralLinkText {
    font-size: 18px; /* Немного меньше на планшетах */
  }

  #referralLinkContainer {
    min-height: 55px; /* Чуть меньше высота на планшетах */
  }
  
  .title {
    font-size: 20px;
  }
  
  #referralSection h3 {
    font-size: 20px; /* Соответствует .title */
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
    gap: var(--spacing-xs);
  }
  
  .brands .brand-title,
  .brands .text-wrapper {
    font-size: 18px;
  }
  
  #referralLinkText {
    font-size: 16px; /* Еще меньше на телефонах */
  }
  
  #referralLinkContainer {
    min-height: 50px; /* Еще меньше высота на телефонах */
    padding: var(--spacing-xs); /* Меньше отступы на телефонах */
  }
  
  .title {
    font-size: 18px;
  }
  
  #referralSection h3 {
    font-size: 18px; /* Соответствует .title */
  }
  
  .brand-list,
  .album-list {
    gap: var(--spacing-sm);
  }

/* ===== MARKET BUTTON CONTAINER ===== */
#marketBtnContainer {
  width: 100%;
  margin: 0 auto var(--spacing-sm) auto;
}

/* ===== SPARKS PANEL ===== */
.sparks-panel {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-family: "ArtegraRegular", sans-serif;
  color: var(--text-primary);
  font-size: 16px;
  flex-shrink: 0;
}

.spark-icon {
  width: 20px;
  height: 20px;
}

#sparksValue {
  line-height: 1;
  margin-top: 2px;
}
.market-main-btn {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-lg);
  position: relative;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  font-family: "ArtegraRegular", "Gilroy-Light", Helvetica;
  color: var(--text-primary);
  font-size: clamp(16px, 4vw, 40px);
}
.market-main-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.market-main-btn:active {
  background: var(--bg-secondary);
  filter: brightness(1.1);
}
.market-main-btn:focus {
  outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}
.categories {
  display: flex;
  gap: var(--spacing-xs);
  width: 100%;
  overflow-x: auto;
  padding-bottom: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
  padding-left: 12px;
}
.category-button {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: none;
  color: var(--text-secondary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
  box-shadow: none;
}
.category-button.active {
  background: #1A1A1A;
  color: #ffffff;
  border-radius: 999px;
  min-width: 80px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 1200px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  width: 100%;
}
.product-item {
  background: none;
  border: none !important;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: none;
}
.product-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
  background: #222;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-title {
  text-align: center;
  color: var(--text-primary);
  font-size: 15px;
  margin-top: 6px;
}

.product-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  align-items: center;
}

.product-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Price badge on preview (rounded rectangle bottom-left) */
.product-thumb {
  position: relative;
}
.product-price {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.6);
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}
.product-price img {
  width: 16px;
  height: 16px;
  display: block;
}

.product-title {
  text-align: center;
  color: var(--text-primary);
  font-size: 14px;
}
  
  .logo {
    width: min(120px, 70%);
  }
}

/* ===== SEARCH COMPONENTS ===== */
.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.search-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--spacing-sm);
  width: 20px;
  height: 20px;
  z-index: 1;
  pointer-events: none;
}

.search-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 40px;
  font-size: 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.loader {
  display: none;
  margin-top: var(--spacing-sm);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  text-align: center;
}

.error {
  margin-top: var(--spacing-sm);
  color: var(--error-color);
  font-family: "Gilroy", sans-serif;
  text-align: center;
}

.error.success {
  color: var(--success-color);
}

.results {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  width: 100%;
}

.panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  transition: var(--transition);
}

.meta {
  flex: 1;
}

.panel .title {
  font-weight: 600;
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
  margin-bottom: 4px;
}

.panel .artist {
  color: var(--text-secondary);
  font-size: 14px;
  font-family: "Gilroy", sans-serif;
}

.panel-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.play-btn, .download-btn {
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  white-space: nowrap;
  background-color: transparent;
  border: none;
}

/* ===== MODAL PREVIEW STYLES ===== */
.modal-box{
  position: relative;
  background: var(--bg-secondary);
  padding: 18px;
  border-radius: 12px;
  max-width: 920px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  margin: 0 12px;
}
.modal-close{
  position: absolute;
  right: 12px;
  top: 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}
.modal-media{ text-align:center; margin-bottom:14px; max-height:70vh; overflow:auto }
.modal-media img, .modal-media video{ max-width:100%; max-height:70vh; border-radius:8px }
.modal-info{ display:flex; align-items:center; justify-content:space-between; gap:12px }
.modal-meta{ display:flex; flex-direction:column; gap:6px }
.modal-info h3{ margin:0; font-size:18px }
.modal-price img{ height:16px; vertical-align:middle; margin-right:6px }
.modal-buy{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  gap:8px;
  padding: var(--spacing-xs) 16px;
  background: #fff;
  color: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  cursor: pointer;
}
.modal-buy .modal-buy-icon{ width:18px; height:18px; filter:grayscale(1) brightness(0); }
.modal-buy .modal-buy-text{ flex:none; text-align:center; font-family: 'ArtegraRegular'; margin-top: 4; }
.overlay.product-overlay{ display:flex; align-items:center; justify-content:center }

@media (max-width: 700px){
  .modal-info{ flex-direction:column; align-items:stretch }
  .modal-box{ padding:12px }
  .modal-close{ right:8px; top:6px }
}

.play-btn:disabled, .download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player {
  margin-top: var(--spacing-sm);
  width: 100%;
}

.player iframe {
  width: 100%;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

/* ===== LOAD MORE BUTTON ===== */
.load-more-btn {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-top: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.load-more-btn:hover {
  background: var(--bg-hover);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-btn:disabled:hover {
  background: var(--bg-secondary);
}

/* ===== MOBILE PAGE STRUCTURE ===== */
.mobile-page {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 1200px;
}

/* Контейнер с аватаркой и текстом */
.profile-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.profile-text {
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  line-height: 1.2;
}

/* Поле ввода с иконкой лупы */
.search-field {
  position: relative;
  width: 100%;
  height: 50px;
}

.search-field-icon {
  position: absolute;
  left: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  z-index: 1;
  pointer-events: none;
}

.search-field-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--text-muted);
}

.search-field-input {
  width: 100%;
  height: 50px;
  padding: 0 var(--spacing-sm) 0 40px;
  font-size: 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  transition: var(--transition);
}

.search-field-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.search-field-input::placeholder {
  color: var(--text-muted);
}

/* Контейнер с кнопками */
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-xs);
  width: 100%;
}

.grid-button {
  height: 50px;
  border: none;
  border-radius: var(--border-radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Gilroy", sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-button:hover {
  background: var(--bg-hover);
}

/* Адаптивность для мобильной структуры */
@media (max-width: 768px) {
  .profile-text {
    font-size: 20px;
  }
  
  .buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .profile-container {
    gap: var(--spacing-xs);
  }
  
  .profile-text {
    font-size: 18px;
  }
  
  .buttons-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-button {
    height: 45px;
    font-size: 16px;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 320px) {
  .profile-text {
    font-size: 16px;
  }
}