/* ==================== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ==================== */
:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e9ecef;
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --accent: #6c5ce7;
  --accent-hover: #5b4cdb;
  --accent-light: rgba(108, 92, 231, 0.1);
  --border: #dee2e6;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== СБРОС И БАЗОВЫЕ СТИЛИ ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  padding: 0;
}

/* Desktop: navbar сверху */
@media (min-width: 768px) {
  .navbar {
    top: 0;
    bottom: auto;
  }
}

/* Mobile: navbar снизу */
@media (max-width: 767px) {
  .navbar {
    top: auto;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    overflow: visible;
  }

  #mobile-navbar,
  .nav-row,
  .nav-row-search {
    overflow: visible;
  }
}

/* Chat: navbar внизу на desktop */
.navbar.navbar-bottom {
  top: auto;
  bottom: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Скрываем верхний #bottom в режиме чата */
body.chat-mode > #bottom {
  display: none !important;
}

#top {
  display: none; /* Скрыт по умолчанию */
}

#bottom {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 12px;
}

/* ==================== MOBILE NAVBAR ==================== */
#mobile-navbar {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 8px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Ряд 1: Верхний - левая и правая группы */
.nav-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding-bottom: 0;
  border-bottom: none;
}

.nav-row-top .nav-left {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-row-top .nav-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Mobile: все кнопки в верхнем ряду одинакового размера */
.nav-row-top .nav-button {
  padding: 8px 12px;
  font-size: 13px;
  height: 38px;
  box-sizing: border-box;
}

.nav-row-top #cartButton,
.nav-row-top #walletLabel1Mobile {
  padding: 8px 12px;
  font-size: 13px;
  height: 38px;
  box-sizing: border-box;
}

/* Ряд 2: Средний - Menu, Search, Search button */
.nav-row-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-row-search .search {
  flex: 1;
  height: 38px;
  padding: 8px 12px !important;
  box-sizing: border-box;
}

.nav-row-search .nav-button {
  padding: 8px 12px !important;
  font-size: 14px !important;
  height: 38px;
  box-sizing: border-box;
}

.nav-row-search button {
  margin: 0;
  display: inline-flex;
  width: auto;
}

/* Ряд 3: Нижний - Sales, Shopping, Blog */
.nav-row-main {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding-top: 0;
  border-top: none;
}

.nav-row-main > * {
  flex: 1;
  text-align: center;
}

.nav-row-main .nav-button {
  width: 100%;
  justify-content: center;
}

.nav-row-main .nav-button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Width utility classes for mobile buttons */
.nav-row-main .nav-button.w-25 {
  flex: 0 0 25%;
  max-width: 25%;
}

.nav-row-main .nav-button.w-50 {
  flex: 0 0 50%;
  max-width: 50%;
}

/* Add Button - особый стиль */
.nav-button.add-btn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

.nav-button.add-btn:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Send Button - стиль для кнопки отправки */
.nav-button.send-btn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

.nav-button.send-btn:hover {
  background: var(--accent-hover);
  color: white;
}

/* Send Money Button - красная кнопка */
.nav-button.send-money-btn {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
  font-weight: 600;
}

.nav-button.send-money-btn:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: white;
}

/* Верхняя строка навбара - Cart и Balance справа, остальное слева */
#shopping-button-form,
#button-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* Левая группа кнопок */
.nav-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Правая группа - Cart и Balance */
.nav-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Нижняя строка - Menu, Search, кнопки */
#list-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Строка поиска */
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Нижние кнопки - Sales, To Purchases, Blog */
.bottom-nav-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Chat input row */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.chat-input-row .search {
  flex: 1;
}

/* Nav buttons row for chat */
.nav-buttons-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
}

/* Send button styling */
#send {
  padding: 12px 24px !important;
  background: var(--accent) !important;
  color: white !important;
  border: none !important;
  border-radius: 24px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer;
  transition: all 0.2s;
  width: auto !important;
  flex: none !important;
}

#send:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

/* ==================== CHAT MESSAGES ==================== */
.render.chat-view {
  display: flex;
  flex-direction: column;
  padding: 32px;
  padding-bottom: 60px;
  height: calc(100vh - 180px);
  max-height: calc(100vh - 180px);
  background: var(--bg-secondary);
  gap: 8px;
  overflow-y: auto;
  /* Desktop: card style like account */
  max-width: 480px;
  margin: 20px auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Spacer для прижатия сообщений к низу */
.render.chat-view::before {
  content: '';
  flex: 1 1 auto;
}

@media (max-width: 767px) {
  .render.chat-view {
    max-width: 100%;
    margin: 0;
    padding: 16px;
    padding-bottom: 60px;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-primary);
  }
}

.chat-message {
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
}

.chat-message.from-contact {
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.to-contact {
  background: white;
  color: var(--text-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border: 1px solid var(--border);
}

.chat-message .message-with-timestamp {
  display: block;
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.7;
}

.chat-message.from-contact .message-with-timestamp {
  color: rgba(255, 255, 255, 0.8);
}

.chat-message.to-contact .message-with-timestamp {
  color: var(--text-muted);
}

/* ==================== КНОПКИ НАВИГАЦИИ ==================== */
#nav-button,
.nav-button {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#nav-button:hover,
.nav-button:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Active Button */
.nav-button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.nav-button.active:hover {
  background: var(--accent-hover);
  color: white;
}

/* Cart Button - особый стиль */
#cartButton {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

#cartButton:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Wallet/Balance Button */
#walletLabel1,
#walletLabel1Mobile {
  background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

#walletLabel1:hover,
#walletLabel1Mobile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==================== CART CONTAINER ==================== */
.cart-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.cart-label {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
  z-index: 10;
}

/* Mobile: убираем flex: 1 для cart-container чтобы label не отрывался */
.nav-row-top .cart-container {
  flex: 0 0 auto;
}

.wallet-container {
  display: flex;
  align-items: center;
}

/* ==================== BADGES ==================== */
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.contacts-label {
  display: none;
}

/* ==================== SEARCH ==================== */
.search {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  min-width: 0;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.search::placeholder {
  color: var(--text-muted);
}

/* ==================== MENU DROPDOWN ==================== */
.dropup {
  position: relative;
}

.menu-button {
  width: 44px;
  height: 44px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.menu-button:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

#menu-badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

.dropup-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-secondary);
  min-width: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 8px;
  z-index: 1001;
}

.dropup-content a,
.dropup-content .nav-button {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropup-content a:hover,
.dropup-content .nav-button:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Menu item with badge */
.menu-item-with-badge {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

.menu-item-with-badge .badge {
  position: static;
  margin-left: 8px;
}

/* Mobile: dropdown opens upward */
@media (max-width: 767px) {
  .dropup-content {
    bottom: 100% !important;
    top: auto !important;
    margin-bottom: 8px !important;
    margin-top: 0 !important;
    z-index: 9999 !important;
  }
}

/* Desktop: dropdown opens downward */
@media (min-width: 768px) {
  .dropup-content {
    bottom: auto !important;
    top: 100% !important;
    margin-bottom: 0 !important;
    margin-top: 8px !important;
  }
}

/* ==================== FILTER CONTAINER ==================== */
.filter-container {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.filter-container select {
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.filter-container select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ==================== RENDER CONTAINER ==================== */
.render {
  padding-top: 20px;
  padding-bottom: 180px; /* Space for fixed bottom navbar on mobile */
  min-height: 100vh;
}

/* Shopping page specific - full width override */
.render.shopping-view {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Desktop: navbar сверху, отступ сверху */
@media (min-width: 768px) {
  .render {
    padding-top: 80px;
    padding-bottom: 20px;
  }

  .render.shopping-view {
    padding-top: 70px;
  }
}

/* ==================== PRODUCT CONTAINER - GRID ==================== */
.product-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* ==================== CAROUSEL ==================== */
.carousel {
  position: relative;
  background: var(--bg-primary);
  aspect-ratio: 1;
  overflow: hidden;
}

.carousel div {
  height: 100%;
}

.carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .carousel img {
  transform: scale(1.05);
}

/* Slick Carousel Dots */
.slick-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex !important;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.slick-dots li {
  margin: 0;
}

.slick-dots li button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  font-size: 0;
  cursor: pointer;
  transition: var(--transition);
}

.slick-dots li.slick-active button {
  background: white;
  transform: scale(1.2);
}

/* Slick Arrows */
.slick-prev,
.slick-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  opacity: 0;
}

.product-card:hover .slick-prev,
.product-card:hover .slick-next {
  opacity: 1;
}

.slick-prev {
  left: 12px;
}

.slick-next {
  right: 12px;
}

.slick-prev:before,
.slick-next:before {
  font-size: 14px;
  color: var(--text-primary);
}

/* ==================== PRODUCT INFO ==================== */
.product-info {
  padding: 16px;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.product-quantity {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 20px;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.add-to-cart {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-top: 8px;
}

.add-to-cart:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.name {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==================== CART PAGE ==================== */
.product {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.product:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.product-basic {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.product-basic img {
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.description,
.descriptio {
  font-size: 14px;
  color: var(--text-primary);
}

.descriptio {
  color: var(--text-secondary);
  font-size: 13px;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity > div {
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.quantity > div:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.price {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
}

.delete {
  padding: 8px;
  background: #fee;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.delete:hover {
  background: #fcc;
}

/* ==================== CHECKOUT / ADDRESS ==================== */
.address {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  margin: 16px;
  box-shadow: var(--shadow-sm);
}

.loginInput {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  margin-bottom: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

.loginInput:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.loginInput::placeholder {
  color: var(--text-muted);
}

h2 {
  text-align: center;
  margin: 24px 16px 16px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
}

button {
  display: block;
  width: calc(100% - 32px);
  margin: 16px auto;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

/* Override for contact delete button */
.contact button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: #f1f3f4;
  color: #999;
  border-radius: 50%;
  font-size: 11px;
  opacity: 0;
  transition: all 0.2s;
}

.contact:hover button {
  opacity: 1;
}

.contact button:hover {
  background: #ff6b6b;
  color: white;
}

/* ==================== CONTACTS LIST ==================== */
.contact {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin: 10px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.contact:hover {
  background: #fafafa;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: #e9ecef;
}

#contact-logo {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
}

.contact-item {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #2d3436;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-label {
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

p {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ==================== TOAST ==================== */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: opacity 0.3s ease;
}

/* ==================== DIALOG ==================== */
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dialog-content {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.dialog-content p {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.dialog-content button {
  width: auto;
  padding: 12px 32px;
}

/* ==================== PAYOUT ==================== */
.payout-box {
  max-width: 420px;
  margin: 40px auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
}

.payout-box h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.payout-box .balance {
  font-size: 18px;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-secondary);
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.payout-box .balance b {
  color: var(--accent);
}

.payout-box input {
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 15px;
  background: var(--bg-primary);
  transition: var(--transition);
}

.payout-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.payout-box button {
  margin-top: 20px;
  width: 100%;
}

.payout-status {
  margin-top: 16px;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}

/* ==================== TRANSACTIONS ==================== */
.transactions {
  padding: 16px;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Большие экраны (Desktop) */
@media (min-width: 768px) {
  /* Скрываем mobile navbar на desktop */
  #mobile-navbar {
    display: none;
  }

  #bottom {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 24px 12px 24px !important;
  }

  #shopping-button-form,
  #button-form {
    display: flex !important;
    flex: none !important;
    gap: 12px !important;
    align-items: center !important;
  }

  #shopping-button-form .search {
    width: 200px;
    padding: 10px 14px;
  }

  /* Sales navbar - увеличиваем высоту до 76px как в Shopping */
  #button-form {
    padding: 16px 0 !important;
  }

  #list-form {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 1 !important;
    justify-content: flex-end !important;
    gap: 12px !important;
  }

  .chat-input-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .nav-buttons-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 0 !important;
    border-top: none !important;
  }
}

@media (min-width: 1200px) {
  .product-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 0;
    gap: 8px;
  }

  .render {
    padding-left: 24px;
    padding-right: 24px;
    width: 100%;
    max-width: 100%;
  }

  /* Chat view - keep card style */
  .render.chat-view {
    max-width: 480px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Sales page - navbar теперь 76px как в Shopping */
  .render:not(.shopping-view) {
    padding-top: 76px;
  }
  
  .filter-container {
    margin: 8px 0;
  }
  
  #bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
  }
  
  #shopping-button-form,
  #button-form {
    flex: none;
    gap: 12px;
  }
  
  #list-form {
    flex-direction: row;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    gap: 12px;
  }
  
  .search-row {
    width: auto;
    flex: 0 1 400px;
  }
  
  .bottom-nav-buttons {
    border-top: none;
    padding-top: 0;
  }
}

/* Средние экраны (Tablet) */
@media (min-width: 768px) and (max-width: 1199px) {
  .product-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 0;
    gap: 8px;
  }

  .render {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Sales page - navbar теперь 76px как в Shopping */
  .render:not(.shopping-view) {
    padding-top: 76px;
  }

  #bottom {
    padding: 12px 20px;
  }
}

/* Маленькие экраны (Mobile) */
@media (max-width: 767px) {
  .render {
    padding-top: 8px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 200px; /* Увеличенный отступ для navbar внизу */
  }

  /* Скрываем старый navbar */
  #bottom {
    display: none;
  }

  /* Mobile navbar */
  #mobile-navbar {
    display: flex;
  }

  /* 2 продукта в ряд на мобильных */
  .product-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px;
    padding: 0;
  }
  
  .product-card {
    border-radius: 8px;
    overflow: hidden !important;
    max-width: 100%;
    display: flex !important;
    flex-direction: column !important;
    border: none;
  }

  /* Изображение сверху */
  .product-card .carousel {
    width: 100% !important;
    height: 120px !important;
    flex-shrink: 0;
    aspect-ratio: auto !important;
  }

  /* Информация снизу */
  .product-info {
    padding: 6px;
    overflow: hidden;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .product-title {
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .product-price {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
  }

  .product-quantity {
    font-size: 9px;
    padding: 2px 4px;
    display: inline-block;
    width: fit-content;
  }

  .add-to-cart {
    padding: 5px 8px;
    font-size: 10px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .product-actions {
    gap: 4px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
  }

  .product-meta {
    gap: 3px;
    flex-wrap: wrap;
  }
  
  /* Navbar на мобильных */
  #bottom {
    padding: 10px 12px;
    gap: 10px;
  }
  
  #shopping-button-form,
  #button-form {
    order: 1;
  }
  
  /* Cart и Balance справа */
  .cart-container,
  .wallet-container {
    margin-left: auto;
  }
  
  /* Группировка кнопок */
  #list-form {
    order: 2;
  }
  
  .search-row {
    order: 1;
  }
  
  .bottom-nav-buttons {
    order: 2;
    justify-content: space-around;
  }
  
  .bottom-nav-buttons .nav-button {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .dropup {
    order: 0;
  }
  
  .menu-button {
    width: 40px;
    height: 40px;
  }
  
  .search {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  #nav-button,
  .nav-button {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  #cartButton {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  #walletLabel1 {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .filter-container {
    padding: 8px;
    gap: 6px;
    border-radius: 8px;
  }

  .filter-container select {
    min-width: 100%;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  /* Cart page */
  .product {
    flex-direction: column;
    align-items: stretch;
    margin: 12px;
    padding: 12px;
  }
  
  .product-basic {
    margin-bottom: 12px;
  }
  
  .quantity {
    justify-content: center;
  }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
  .product-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }
  
  .product-info {
    padding: 8px;
  }
  
  .product-title {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }
  
  .product-price {
    font-size: 14px;
  }
  
  .product-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .add-to-cart {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .name {
    display: none;
  }
  
  .bottom-nav-buttons .nav-button {
    font-size: 11px;
    padding: 8px 6px;
  }
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== SELECTION ==================== */
::selection {
  background: var(--accent-light);
  color: var(--accent);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.4s ease forwards;
}

/* Staggered animation for cards */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* ==================== LOADING SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-primary) 25%, var(--bg-hover) 50%, var(--bg-primary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==================== ACCOUNT PAGE ==================== */
.account-page {
  display: flex;
  justify-content: center;
  padding: 20px;
  min-height: calc(100vh - 150px);
}

.account-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
}

.account-card .logo-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  cursor: pointer;
}

.account-card .logo-container #logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  transition: var(--transition);
}

.account-card .logo-container:hover #logo {
  opacity: 0.8;
}

.account-card .logo-container .watermark {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.account-card .loginInput {
  width: 100%;
  margin-bottom: 12px;
}

.account-card .address {
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.account-card #countryList {
  list-style: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 150px;
  overflow-y: auto;
  margin: -8px 0 12px 0;
  display: none;
}

.account-card #countryList li {
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.account-card #countryList li:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.account-card .save-btn {
  width: 100%;
  margin-top: 16px;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
  padding: 14px;
}

.account-card .save-btn:hover {
  background: var(--accent-hover);
  color: white;
}

@media (max-width: 767px) {
  .account-page {
    padding: 16px;
  }

  .account-card {
    padding: 24px 20px;
  }
}

/* ==================== PRODUCT FORM ==================== */
.color-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.color-size-row input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.color-size-row button {
  width: auto;
  padding: 10px 16px;
  margin: 0;
  font-size: 13px;
}

#colors-list,
#sizes-list {
  margin-bottom: 8px;
  min-height: 4px;
}

