* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: #2c3e50;
  color: white;
  padding: 20px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 20px;
  text-align: center;
}

header h1 {
  font-size: 1.8em;
  margin-bottom: 10px;
}

nav {
  margin-top: 10px;
}

nav a {
  color: #bdc3c7;
  margin: 0 15px;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
}

nav a:hover {
  color: white;
  text-decoration: underline;
}

.search-box {
  margin: 15px 0 10px;
  text-align: center;
}

.search-box input {
  padding: 12px 16px;
  width: 85%;
  max-width: 500px;
  border: 2px solid #3498db;
  border-radius: 30px;
  font-size: 1em;
  outline: none;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: #2980b9;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

main {
  padding: 10px 0;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.product {
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-icon {
  font-size: 3.2em;
  line-height: 1;
  margin: 10px 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product h3 {
  font-size: 1.1em;
  margin: 10px 0 5px;
  color: #2c3e50;
}

.product p {
  margin-bottom: 10px;
  font-size: 0.95em;
  color: #555;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: background 0.3s;
}

.btn:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* Фиксированная кнопка корзины */
#floating-cart {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

#floating-cart button {
  padding: 14px 22px;
  font-size: 1.15em;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 40px;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  min-width: 180px;
  text-align: center;
}

#floating-cart button:hover {
  background: #219653;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* Боковая панель корзины */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100%;
  background: white;
  box-shadow: -3px 0 15px rgba(0,0,0,0.1);
  z-index: 2000;
  padding: 30px;
  overflow-y: auto;
  border-left: 1px solid #eee;
  /* Основная анимация */
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Когда панель видима — сдвигаем влево */
.sidebar:not(.hidden) {
  transform: translateX(0);
}

.sidebar h3 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 1.3em;
}

.cart-item {
  margin: 15px 0;
  padding: 12px;
  border-bottom: 1px dashed #eee;
  font-size: 0.95em;
  background: #f9f9f9;
  border-radius: 6px;
}

.cart-item > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item strong {
  font-size: 1.1em;
  color: #2c3e50;
}

.cart-item small {
  color: #7f8c8d;
  font-size: 0.9em;
}

.cart-item em {
  font-size: 0.9em;
  color: #34495e;
}

.qty-btn {
  background: #ecf0f1;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  margin: 0 5px;
  font-size: 1.1em;
}

.qty-btn:hover {
  background: #bdc3c7;
}

/* Модальное окно */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-content label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 500;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1em;
  margin-top: 4px;
}

.modal-content small {
  font-size: 0.85em;
  color: #7f8c8d;
  font-style: italic;
}

/* Футер */
footer {
  text-align: center;
  margin-top: 60px;
  color: #777;
  font-size: 0.9em;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* Категории (для sellers.html) */
.categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  margin: 10px 0;
  scrollbar-width: thin;
}

.categories::-webkit-scrollbar {
  height: 6px;
}

.categories::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 3px;
}

.category-btn {
  padding: 8px 16px;
  background: #ecf0f1;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9em;
  transition: all 0.2s;
}

.category-btn:hover {
  background: #bdc3c7;
}

.category-btn.active {
  background: #3498db;
  color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 1.5em;
  }

  nav a {
    margin: 0 8px;
    font-size: 0.9em;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .product-icon {
    font-size: 2.8em;
  }

  .sidebar {
    width: 100%;
  }

  #floating-cart button {
    font-size: 1.05em;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .product-icon {
    font-size: 2.4em;
  }

  .modal-content {
    padding: 20px;
  }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 1.5em;
  }

  .products {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product {
    padding: 12px;
  }

  .product-icon {
    font-size: 2.8em;
  }

  #floating-cart button {
    font-size: 1em;
    padding: 12px 18px;
  }

  .sidebar {
    width: 100%;
  }

  .cart-item {
    font-size: 0.9em;
  }

  .qty-btn {
    width: 25px;
    height: 25px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .product-icon {
    font-size: 2.4em;
  }

  .categories {
    font-size: 0.9em;
  }

  .category-btn {
    padding: 6px 12px;
    font-size: 0.8em;
  }

  .modal-content {
    padding: 20px;
    margin: 10px;
  }
}

/* Модальное окно для увеличения изображения */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  animation: fadeIn 0.3s;
  cursor: zoom-out;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  cursor: zoom-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Увеличение изображения */
img.zoomed {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 10000;
  border: 5px solid white;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  border-radius: 10px;
  cursor: zoom-out;
}

/* Кнопки изменения количества */
.qty-btn {
  padding: 5px 10px;
  background: #ddd;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 0 5px;
}

.qty-btn:hover {
  background: #ccc;
}

.qty {
  margin: 0 5px;
}

.tutorial-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #27ae60;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 10000;
  font-family: 'Roboto', sans-serif;
  font-size: 0.95em;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  font-family: 'Roboto', sans-serif;
}

.confirm-modal p {
  margin: 0 0 15px;
  font-size: 1em;
  color: #333;
}

.confirm-modal button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}

.confirm-modal button:first-child {
  background: #95a5a6;
  margin-left: 10px;
}