* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: #fff5f0;
  color: #4a4a4a;
  line-height: 1.6;
}

/* === ШАПКА === */
header {
  background: white;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
  color: #ff9f8c;
}

.logo:hover {
  transform: scale(1.02);
}

nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

nav a {
  text-decoration: none;
  color: #4a4a4a;
  transition: color 0.3s;
  font-weight: 500;
}

nav a:hover {
  color: #ff9f8c;
}

/* === КОРЗИНА === */
.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 24px;
  margin-left: 20px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #ff6b6b;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.cart-modal {
  display: none;
  position: fixed;
  top: 70px;
  right: 20px;
  width: 380px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 20px;
}

.cart-modal.show {
  display: block;
}

.cart-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.cart-header {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ff9f8c;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 13px;
  color: #666;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.cart-item .quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item .quantity-btn {
  width: 28px;
  height: 28px;
  font-size: 16px;
  background: #fff0eb;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.cart-item .item-name {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item .item-price {
  text-align: right;
  font-weight: 500;
}

.cart-item .delete-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #ff6b6b;
  text-align: center;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
  margin-top: 10px;
  border-top: 2px solid #eee;
  font-weight: bold;
}

.cart-checkout-btn {
  width: 100%;
  margin-top: 15px;
}

/* === ГЕРОЙ-БЛОК === */
.hero {
  background:
    linear-gradient(135deg, rgba(255, 159, 140, 0.6), rgba(255, 212, 196, 0.7)),
    url("../images/hero-bg.webp");
  background-size: cover;
  background-position: center;
  text-align: center;
  padding: 100px 20px;
  color: white;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 20px;
  margin-bottom: 30px;
}

.hero-btn {
  background: white;
  color: #ff9f8c;
  font-size: 18px;
  padding: 12px 30px;
}

/* === КНОПКИ === */
.btn {
  display: inline-block;
  background: #ff9f8c;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 500;
}

.btn:hover {
  background: #ff7f6b;
  transform: translateY(-2px);
}

/* === КАТЕГОРИИ С ВЫПАДАЮЩЕЙ ПАНЕЛЬЮ === */
.categories {
  padding: 60px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
  color: #4a4a4a;
}

.category-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.category-item {
  position: relative;
  cursor: pointer;
}

.category-title {
  background: white;
  padding: 20px 35px;
  border-radius: 60px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.category-title:hover {
  background: #ff9f8c;
  color: white;
  transform: translateY(-5px);
}

/* Выпадающая панель */
.category-dropdown {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 50;
  white-space: nowrap;
}

.category-item:hover .category-dropdown {
  opacity: 1;
  visibility: visible;
}

.category-dropdown ul {
  list-style: none;
}

.category-dropdown li {
  padding: 8px 15px;
  border-bottom: 1px solid #eee;
  color: #4a4a4a;
  transition: all 0.2s;
}

.category-dropdown li:last-child {
  border-bottom: none;
}

.category-dropdown li:hover {
  background: #fff0eb;
  color: #ff9f8c;
  border-radius: 10px;
}

/* === СЕТКА ТОВАРОВ === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  text-align: center;
  padding-bottom: 20px;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-card h3 {
  padding: 15px 15px 5px;
  font-size: 20px;
}

.price {
  color: #ff6b6b;
  font-size: 22px;
  font-weight: bold;
  margin: 10px 0;
}

/* Счётчик товара */
.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 10px 0;
}

.quantity-btn {
  background: #fff0eb;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.quantity-btn:hover {
  background: #ff9f8c;
  color: white;
}

.quantity-value {
  font-size: 18px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.add-to-cart-btn {
  background: #ff9f8c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 500;
}

/* === ФОРМА ЗАКАЗА === */
.order-form {
  max-width: 600px;
  margin: 60px auto;
  background: white;
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  font-size: 16px;
  background: #f9f9f9;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #ff9f8c;
}

/* === ЧАТ === */
.chat-container {
  max-width: 800px;
  margin: 40px auto;
  background: white;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #ff9f8c;
  color: white;
}

.chat-avatar {
  font-size: 40px;
}

.chat-name {
  font-size: 18px;
  font-weight: bold;
}

.chat-status {
  font-size: 12px;
  opacity: 0.8;
}

.chat-messages {
  height: 350px;
  padding: 20px;
  overflow-y: auto;
  background: #fafafa;
}

.message {
  margin-bottom: 15px;
  padding: 10px 16px;
  border-radius: 20px;
  max-width: 80%;
  word-wrap: break-word;
}

.message.user {
  background: #ff9f8c;
  color: white;
  margin-left: auto;
}

.message.baker {
  background: white;
  color: #4a4a4a;
  border: 1px solid #ffd4c4;
}

.chat-quick {
  display: flex;
  gap: 10px;
  padding: 15px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
}

.quick-btn {
  background: #fff0eb;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 13px;
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #eee;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 30px;
}

.chat-auth-message {
  text-align: center;
  padding: 40px;
  background: #fafafa;
  color: #666;
}

/* === ОТЗЫВЫ === */
.reviews {
  padding: 60px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.review-card {
  background: white;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.review-card:hover {
  transform: translateY(-4px);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  background: #ff9f8c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: white;
}

.review-info {
  flex: 1;
}

.review-author {
  font-weight: bold;
}

.review-date {
  font-size: 11px;
  color: #999;
}

.review-stars {
  color: #ffd700;
  letter-spacing: 2px;
  font-size: 14px;
}

.review-text {
  font-style: italic;
  line-height: 1.5;
}

/* Форма отправки отзыва (доступна только авторизованным) */
.review-form-container {
  text-align: center;
  margin-top: 40px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  background: white;
  padding: 30px;
  border-radius: 30px;
}

.review-form-container textarea,
.review-form-container input,
.review-form-container select {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid #ddd;
}

/* === УВЕДОМЛЕНИЯ === */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 12px 24px;
  border-radius: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left: 4px solid #4caf50;
}
.notification.error {
  border-left: 4px solid #ff6b6b;
}
.notification.info {
  border-left: 4px solid #ff9f8c;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === ПОДВАЛ (единый) === */
footer {
  background: #4a4a4a;
  color: white;
  text-align: center;
  padding: 30px;
  margin-top: 60px;
}

footer p {
  margin: 5px 0;
}

.admin-link {
  color: #aaa;
  text-decoration: none;
  font-size: 12px;
  opacity: 0.6;
}

.admin-link:hover {
  opacity: 1;
  color: #ff9f8c;
}

/* === ОБЩИЕ СТРАНИЦЫ === */
.page-title {
  text-align: center;
  margin: 40px 0;
  font-size: 36px;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero {
    padding: 60px 20px;
  }

  .categories,
  .popular,
  .reviews {
    padding: 40px 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .cart-modal {
    width: 300px;
    right: 10px;
  }

  .category-dropdown {
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
  }
}
