body {
  font-family: ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  transition: all 0.2s ease-in-out;
}

html,
body {
  max-width: 100vw;
  color: #1a202c;
  background-color: #f7fafc;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Base styles for mobile */
.bg-gray-50 {
  background-color: #f9fafb;
}

.bg-white {
  background-color: #ffffff;
}

.bg-pink {
  background-color: #E5A2C1;
}

.text-white {
  color: #ffffff;
}

.text-gray-900 {
  color: #111827;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-500 {
  color: #6b7280;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-red-500 {
  color: #ef4444;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.d {
  color: #cd2272;
}

.text-4xl {
  font-size: 2.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-lg {
  font-size: 1.125rem;
}

.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.max-w-7xl {
  max-width: 80rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.text-center {
  text-align: center;
}

.mt-25 {
  margin-top: 6.25rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.main-h {
  height: 400px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.w-full {
  width: 100%;
}

.h-12 {
  height: 3rem;
}

.min-h-screen {
  min-height: 100vh;
}

.hidden {
  display: none;
}

/* Mobile-first grid: single column by default */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.search-heading-wrapper {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.search-input-wrapper {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
}

.search-button {
  background: #cd2272;
  border: none;
  cursor: pointer;
  border-radius: 0.625rem;
  margin-left: -50px;
  width: 50px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;

}

.p-6 {
  padding: 1.5rem;
}

.rounded-lg {
  border-radius: 0.625rem;
}

/* Стили для контейнера поля поиска */
.search-input-wrapper {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* Стили для выравнивания заголовка */
.search-heading-wrapper {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.search-bar {
  height: 35px;
  border: 1px solid #9ca3af;
  border-radius: 0.625rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.category-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #f7fafc;
  /* светлый фон для неактивных категорий */
  color: #4b5563;
  /* серый текст */
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease-in-out;
}

.category-item:hover {
  background-color: #edf2f7;
  /* более темный фон при наведении */
}

/* Стили для активного элемента категории */
.category-item.active {
  background-color: #CD2272;
  /* цвет кнопок */
  color: #ffffff;
  /* белый текст */
}

/* Улучшенный отступ между элементами списка */
.space-y-2> :not([hidden])~ :not([hidden]) {
  margin-top: 0.5rem;
}

/* Responsive styles with media queries */


/* For screens smaller than 1024px (laptops) */
@media (max-width: 1023px) {

  /* Sidebar and products layout */
  .flex.lg\:flex-row {
    flex-direction: column;
  }

  .lg\:w-1\/4,
  .lg\:w-3\/4 {
    width: 100%;
  }
}

/* For screens larger than 640px (tablets) */
@media (min-width: 640px) {
  .sm\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* For screens larger than 1024px (laptops) */
@media (min-width: 1024px) {
  .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .lg\:flex-row {
    flex-direction: row;
  }

  .lg\:w-1\/4 {
    width: 25%;
  }

  .lg\:w-3\/4 {
    width: 75%;
  }

  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    z-index: 10;
  }

}


/* Product Card styles */
.product-card {
  /* 1. Жестко задаем Flex-контейнер */
  display: flex !important;
  flex-direction: column !important;

  /* 2. Заставляем карточку занимать 100% высоты ряда сетки и не менее 450px */
  height: 100% !important;
  min-height: 450px !important;

  /* Оформление */
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  padding: 1.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* Элементы внутри не должны сжиматься */
.product-card>* {
  flex-shrink: 0;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.product-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  min-height: 3.5rem;
  /* Зарезервируем место под 2 строки заголовка */
}

.product-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;

  /* УБРАЛИ flex-grow, описание занимает только свое место */
  flex-grow: 0 !important;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

/* === ГЛАВНОЕ: Пружина === */
.price-container {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;

  /* Это свойство заполнит все пустое место СВЕРХУ от цены */
  margin-top: auto !important;
}

.add-to-cart-btn {
  background-color: #CD2272;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-align: center;
  cursor: pointer;
  width: 100%;
  border: none;
  margin-top: 0;
  /* Убираем лишние отступы, если они были */
}

.add-to-cart-btn:hover {
  background-color: #b01e63;
}

.cart-icon {
  font-size: 3rem;
  line-height: 1;
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(25%, -25%);
  background-color: #ef4444;
  color: #ffffff;
  border-radius: 9999px;
  height: 24px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  border-width: 2px;
  border-color: #ffffff;
}

/* Additional styles for mobile */
@media (max-width: 639px) {
  .product-card {
    padding: 1rem;
  }

  .main-h {
    height: 300px;
  }

  .text-4xl {
    font-size: 1.75rem;
  }

  .text-2xl {
    font-size: 1.25rem;
  }

  .text-xl {
    font-size: 1rem;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #cd2272;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b01e63;
}

/* Focus styles */
input:focus,
select:focus {
  outline: 2px solid #cd2272;
}

/* Smooth transitions */
* {
  transition: all 0.2s ease-in-out;
}

/* Loading animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}