/* ============================================
   Стили для магазина товаров
   ============================================ */

/* Переключатель языка */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.language-switcher {
  display: flex;
  align-items: center;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 18px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  min-width: 85px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lang-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.lang-btn:hover::before {
  width: 200px;
  height: 200px;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.lang-flag {
  font-size: 1.4rem;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.lang-code {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Навигация в хедере */
.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.nav-link svg {
  transition: transform 0.3s ease;
}

.nav-link:hover svg {
  transform: scale(1.1);
}

/* Статистика сервера */
.server-stats {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.server-online,
.last-purchases {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.15) inset,
              0 1px 0 rgba(255, 255, 255, 0.2) inset;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.server-online::before,
.last-purchases::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #bb88ff 100%);
  opacity: 0.6;
}

.server-online:hover,
.last-purchases:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.online-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.online-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.online-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.online-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.online-icon-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.online-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-radius: 16px;
  color: #4ade80;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(74, 222, 128, 0.4);
  box-shadow: 0 4px 15px rgba(74, 222, 128, 0.2);
}

.online-icon.online-full {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.online-icon.online-medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.online-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(74, 222, 128, 0.3);
  animation: pulse 2s ease-in-out infinite;
  z-index: 1;
}

.online-icon.online-full .online-pulse {
  background: rgba(248, 113, 113, 0.2);
}

.online-icon.online-medium .online-pulse {
  background: rgba(251, 191, 36, 0.2);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.online-numbers {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.online-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.online-count {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.online-separator {
  font-size: 1.5rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

.online-max {
  font-size: 1.2rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.online-percentage {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.online-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.online-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.online-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.online-version {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 10px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

.online-version svg {
  color: #bb88ff;
  filter: drop-shadow(0 0 4px rgba(187, 136, 255, 0.4));
}

/* Список игроков онлайн */
.online-players {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.online-players-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.online-players-header svg {
  color: #4ade80;
  filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4));
}

.online-players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.online-players-list::-webkit-scrollbar {
  width: 4px;
}

.online-players-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.online-players-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.online-player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.online-player-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  overflow: hidden;
  position: relative;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

.player-avatar.avatar-fallback::before {
  content: attr(data-fallback);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  z-index: 1;
}

.player-avatar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

.player-name {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-players-more {
  text-align: center;
  padding: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.purchases-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.purchases-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.purchases-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.purchase-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.purchase-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.purchase-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(6px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.purchase-item:hover::before {
  opacity: 1;
}

.purchase-image-wrapper {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.purchase-item:hover .purchase-image-wrapper {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.purchase-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 4px;
}

.purchase-buyer {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.purchase-item-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* Категории */
.shop-categories {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.category-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 24px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.category-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Контейнер магазина */
.shop-container {
  width: 100%;
  max-width: 800px;
  animation: fadeInUp 0.8s ease-out 0.5s both;
  position: relative;
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Карточка товара */
.shop-item-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.shop-item-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.item-image {
  width: 100%;
  height: 180px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.item-online-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(56, 142, 60, 0.2) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 1;
}

.item-online-overlay::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #4caf50;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.8), 0 0 16px rgba(76, 175, 80, 0.4);
  animation: pulse-online 2s ease-in-out infinite;
}

@keyframes pulse-online {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.shop-item-card:hover .item-image img {
  transform: scale(1.05);
}

.item-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.item-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.item-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(56, 142, 60, 0.2) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #81c784;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
  animation: glow-online 2s ease-in-out infinite;
}

.item-online-badge svg {
  color: #4caf50;
  flex-shrink: 0;
}

@keyframes glow-online {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
  }
  50% {
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.4);
  }
}

.item-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  position: relative;
}

.description-more {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  display: block;
  margin-bottom: 12px;
}

/* Tooltip с полным описанием */
.item-description-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: 320px;
  max-width: calc(100vw - 40px);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 100;
  margin-bottom: 10px;
}

.item-description-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
  pointer-events: all;
}

/* На мобильных устройствах tooltip не должен перекрывать кнопки */
@media (max-width: 768px) {
  .item-description-tooltip {
    pointer-events: none !important;
    z-index: 1;
  }
  
  .item-description-tooltip.show {
    pointer-events: none !important;
  }
  
  /* Кнопка "Купить" всегда должна быть кликабельной */
  .item-buy-btn {
    position: relative;
    z-index: 100;
    pointer-events: all !important;
  }
  
  /* Карточка товара должна позволять клики на кнопку */
  .shop-item-card {
    pointer-events: auto;
  }
}

.item-description-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(0, 0, 0, 0.95);
}

.tooltip-content {
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.tooltip-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-content p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.tooltip-content::-webkit-scrollbar {
  width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.item-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #bb88ff;
  text-shadow: 0 2px 10px rgba(187, 136, 255, 0.3);
}

.item-buy-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  font-family: inherit;
  white-space: nowrap;
}

.item-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.item-buy-btn:active {
  transform: translateY(0);
}

/* Загрузка и ошибки */
.shop-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  z-index: 10;
}

.shop-error,
.shop-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.9);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

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

.shop-error svg {
  margin-bottom: 20px;
  color: #ff6b6b;
}

.shop-error h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.retry-button {
  margin-top: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

/* Модальное окно покупки */
.buy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.buy-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 24px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.buy-modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-product {
  text-align: center;
  margin-bottom: 30px;
}

.modal-product-image {
  width: 150px;
  height: 150px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.modal-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-product-image .item-online-overlay {
  border-radius: 16px;
}

.modal-product-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.modal-online-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(56, 142, 60, 0.2) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 10px;
  padding: 8px 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #81c784;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
  animation: glow-online 2s ease-in-out infinite;
}

.modal-online-notice svg {
  color: #4caf50;
  flex-shrink: 0;
}

.modal-product-price {
  font-size: 2rem;
  font-weight: 700;
  color: #bb88ff;
  text-shadow: 0 2px 10px rgba(187, 136, 255, 0.3);
  margin-bottom: 20px;
}

.modal-product-description {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  width: 100%;
}

.modal-product-description h4 {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.description-content {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.description-content::-webkit-scrollbar {
  width: 6px;
}

.description-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.description-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.form-group input {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 18px;
  color: #ffffff;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.quantity-control input {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  padding: 0;
}

.modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: 10px;
}

.total-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.total-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #bb88ff;
  text-shadow: 0 2px 10px rgba(187, 136, 255, 0.3);
}

.modal-submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  margin-top: 10px;
}

.modal-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.modal-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   Адаптивность для мобильных
   ============================================ */

@media (max-width: 768px) {
  .header-top-bar {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .header-logo {
    width: 100%;
    justify-content: center;
  }

  .logo-text {
    font-size: 1.6rem;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 15px;
  }

  .header-nav {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .lang-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.9rem;
    min-width: auto;
  }

  .lang-flag {
    font-size: 1.3rem;
  }


  .server-stats {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
  }

  .shop-items {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .item-image {
    height: 140px;
  }

  .item-name {
    font-size: 1.1rem;
  }

  .item-price {
    font-size: 1.3rem;
  }

  .item-buy-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .modal-content {
    padding: 30px 20px;
    margin: 10px;
  }

  .modal-product-image {
    width: 120px;
    height: 120px;
  }

  .category-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header-nav {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 15px auto 0;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
  }

  .server-stats {
    gap: 15px;
    margin-bottom: 25px;
  }

  .server-online,
  .last-purchases {
    padding: 18px;
    border-radius: 16px;
  }

  .online-icon {
    width: 56px;
    height: 56px;
  }

  .online-pulse {
    width: 64px;
    height: 64px;
  }

  .online-count {
    font-size: 2rem;
  }

  .item-description-tooltip {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    max-width: none;
    transform: none;
    margin-bottom: 0;
    pointer-events: none !important;
    z-index: 1;
  }

  .item-description-tooltip.show {
    transform: none;
    pointer-events: none !important;
  }

  .item-description-tooltip::after {
    display: none;
  }
  
  /* Кнопка "Купить" всегда должна быть кликабельной на мобильных */
  .item-buy-btn {
    position: relative;
    z-index: 100;
    pointer-events: all !important;
  }
  
  /* Карточка товара должна позволять клики на кнопку */
  .shop-item-card {
    pointer-events: auto;
  }

  .server-stats {
    margin-bottom: 20px;
  }

  .shop-categories {
    margin-bottom: 20px;
    gap: 8px;
  }

  .category-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .shop-items {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .item-image {
    height: 200px;
  }

  .item-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .item-buy-btn {
    width: 100%;
  }

  .modal-content {
    padding: 25px 15px;
    border-radius: 20px;
  }

  .modal-product-image {
    width: 100px;
    height: 100px;
  }

  .modal-product-name {
    font-size: 1.3rem;
  }

  .modal-product-price {
    font-size: 1.5rem;
  }

  .form-group input {
    padding: 12px 16px;
    font-size: 16px; /* Предотвращает зум на iOS */
  }

  .quantity-control {
    width: 100%;
  }

  .quantity-btn {
    width: 44px;
    height: 44px;
  }

  .modal-total {
    padding: 15px;
  }

  .total-price {
    font-size: 1.5rem;
  }

  .modal-submit-btn {
    padding: 14px 24px;
    font-size: 0.95rem;
  }
}

/* Скроллбар для модального окна */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 400px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

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

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

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

.notification-info {
  border-left: 4px solid #60a5fa;
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.notification-message {
  color: #ffffff;
  font-weight: 500;
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.notification-close:hover {
  color: #ffffff;
}

@media (max-width: 480px) {
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

