:root {
  --primary: #FF6B00;
  --primary-dark: #E05D00;
  --secondary: #FF6B6B;
  --dark: #111;
  --light: #f9f9f9;
  --gray: #e0e0e0;
  --dark-gray: #888;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background-color: #f5f5f7;
  color: var(--dark);
  padding: 1rem;
  line-height: 1.5;
  font-size: 16px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

a,
a:visited {
  text-decoration: none;
  color: inherit;
}

/* Header and search */
.top-header {
  background: #f5f5f7;
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 50px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.menu-toggle,
.auth-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--dark-gray);
  padding: 0 0.5rem;
  cursor: pointer;
}

.menu-toggle {
  margin-right: 0.5rem;
}

.auth-btn {
  margin-left: 0.5rem;
}

.search-bar:focus-within {
  box-shadow: var(--shadow); /* Останется обычная тень без зеленого оттенка */
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 1rem;
  padding: 0.2rem 0.5rem;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--dark-gray);
  margin-right: 10px;
}

/* Slider */
.slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.slider::-webkit-scrollbar {
  display: none;
}

.slider.active {
  cursor: grabbing;
}

.slide {
  flex: 0 0 90%;
  scroll-snap-align: start;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s ease;
}

.slide:hover {
  transform: translateY(-5px);
}

.slide::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
}

.slide:nth-child(2) {
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
}

.slide h2 {
  margin: 0 0 0.8rem;
  font-size: 1.8rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.slide p {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.slide button {
  margin-top: 1.8rem;
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  align-self: flex-start;
  transition: var(--transition);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-size: 1.1rem;
}

.slide button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.slide:nth-child(2) button {
  color: var(--secondary);
}

/* Categories */
/* Новые стили для слайдера категорий */
.categories {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.categories.active {
  cursor: grabbing;
}

.category {
  flex: 0 0 calc(33.333% - 0.67rem); /* 3 категории в строку с учетом gap */
  scroll-snap-align: start;
  min-width: 0; /* Важно для корректного отображения */
}

/* Адаптация для десктопов */
@media (min-width: 768px) {
  .category {
    flex: 0 0 calc(25% - 1rem); /* 4 категории в строку на десктопах */
  }

  .categories {
    overflow-x: visible;
    flex-wrap: wrap;
    scroll-snap-type: none;
    cursor: default;
  }

  .categories-slider .slider-dots {
    display: none;
  }

  .product-list {
    grid-template-columns: repeat(4, 1fr); /* Было 3, стало 4 */
  }
}

.category {
  background: white;
  border-radius: 16px;
  padding: 1.2rem 0.5rem;
  min-height: 110px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.category:active {
  transform: translateY(0);
}

.category img {
  width: 50px;
  height: 50px;
  margin-bottom: 0.8rem;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.category:hover img {
  transform: scale(1.1);
}

.category div {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
}

/* Products */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.section-title a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.section-title a:visited {
  color: var(--primary);
}

.section-title a i {
  margin-left: 5px;
  font-size: 0.8rem;
}

.products {
  margin-bottom: 3rem;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}


.product-card {
  background: white;
  border-radius: 16px;
  padding: 1.2rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--secondary);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  z-index: 2;
}

.product-card .favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.8);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
  transition: var(--transition);
}

.product-card .favorite i {
  color: var(--dark-gray);
  font-size: 1.1rem;
  transition: var(--transition);
}

.product-card .favorite.active i {
  color: var(--secondary);
}

.product-card .favorite:hover i {
  color: var(--secondary);
  transform: scale(1.2);
}

.product-card .image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1; /* Квадратное соотношение */
  margin-bottom: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
}

.product-card img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Полное изображение без обрезки */
  transition: transform 0.5s ease;
}

.product-card:hover img {
  transform: scale(1.05);
}

.product-card .title {
  font-weight: 600;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.1rem;
}

.product-card .desc {
  font-size: 0.9rem;
  color: var(--dark-gray);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.4rem;
}

.product-card .price {
  color: var(--black);
  font-weight: 700;
  margin: 0.8rem 0;
  font-size: 1.2rem;
}

.product-card .old-price {
  text-decoration: line-through;
  color: var(--dark-gray);
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

.product-card button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.9rem;
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.product-card button i {
  margin-right: 8px;
  font-size: 1rem;
}

.product-card button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(75, 184, 127, 0.3);
}

.product-card button:active {
  transform: translateY(0);
}

/* Floating cart button */
.cart-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  color: var(--primary);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgb(59 59 59 / 40%);
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
}

.cart-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 25px rgb(0 0 0 / 50%);
}

.cart-btn i {
  font-size: 1.8rem;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide {
  animation: fadeIn 0.6s ease forwards;
}

.slide:nth-child(2) {
  animation-delay: 0.1s;
}

.category {
  animation: fadeIn 0.6s ease forwards;
}

.category:nth-child(1) { animation-delay: 0.2s; }
.category:nth-child(2) { animation-delay: 0.3s; }
.category:nth-child(3) { animation-delay: 0.4s; }
.category:nth-child(4) { animation-delay: 0.5s; }
.category:nth-child(5) { animation-delay: 0.6s; }
.category:nth-child(6) { animation-delay: 0.7s; }

.product-card {
  animation: fadeIn 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.3s; }
.product-card:nth-child(2) { animation-delay: 0.4s; }

/* Responsive adjustments */
@media (min-width: 768px) {
  body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-size: 17px;
  }

  .search-bar {
    padding: 1.2rem 2rem;
  }
  
  .slide {
    flex: 0 0 45%;
  }
  
  .categories {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .product-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .categories-slider {
  position: relative;
  margin-bottom: 2rem;
}

.slider-dots {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 0.5rem;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  cursor: pointer;
}

.slider-dot.active {
  background: var(--primary);
}

} 

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  transition: var(--transition);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mobile-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.mobile-menu.open {
  left: 0;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.menu-logo {
    width: 150px;
    height: 150px;
    object-fit: contain; /* сохраняет пропорции изображения */
}

.menu-logo {
    width: 2em;
    height: 2em;
    object-fit: contain;
}

.menu-logo {
    width: 100px;
    height: 100px;
    max-width: 100px; /* ограничение максимального размера */
    max-height: 100px;
    object-fit: contain;
}

.menu-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark-gray);
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: auto;
}

.menu-nav a {
  color: var(--dark);
  text-decoration: none;
  font-size: 1.1rem;
}

.menu-contacts {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.menu-contacts a {
  color: var(--dark-gray);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.policy-link {
  margin-top: 1rem;
  color: var(--dark-gray);
  font-size: 0.9rem;
  text-decoration: none;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
}

.menu-backdrop.visible {
  opacity: 1;
  visibility: visible;
}