#products {
  background-color: #f2ebe1;
  padding: 50px 1%;
  text-align: center;
}

#products h2 {
  margin-bottom: 30px;
  color: #402e21;
  font-family: "Playfair Display", serif;
  font-size: 40px;
}

/* Контейнер, що тримає всі три блоки */
#catalog1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 50px;
}

/* Стилі для кожного окремого блоку каталогу */
.catalog {
  display: flex;
  flex-direction: column;
  /* Вибудовує елементи всередині блоку вертикально */
  align-items: center;
  width: 500px;
  background: #fff;
  /* Білий фон (за бажанням) */
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  /* Легка тінь */
}

/* Назва блоку — зверху */
.catalog h3 {
  order: 1;
  /* Задаємо черговість: 1 — найперший */
  margin-bottom: 15px;
  color: #402e21;
  font-family: "Playfair Display", serif;
  font-size: 28px;
}

/* Картинка — посередині */
.catalog img {
  order: 2;
  /* 2 — посередині */
  width: 100%;
  /* Розтягуємо по ширині блоку */
  height: 360px;
  /* Фіксуємо висоту, щоб всі блоки були однакові */
  object-fit: cover;
  /* Обрізаємо фото, щоб не деформувалося */
  border-radius: 10px;
  margin-bottom: 15px;
}

/* Посилання — знизу */
.catalog a {
  order: 3;
  /* 3 — в самому низу */
  text-decoration: none;
  color: #8c6a4a;
  font-weight: bold;
  border: 2px solid #8c6a4a;
  padding: 10px 20px;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-family: "Playfair Display", serif;
  font-size: 20px;
}

.catalog a:hover {
  background-color: #8c6a4a;
  color: #fff;
}

/* Адаптація для телефонів */
@media (max-width: 768px) {
  #products {
    flex-direction: column;
    /* Блоки стають один під одним */
    align-items: center;
  }

  .catalog {
    width: 90%;
    /* На мобільному займають майже всю ширину */
  }
}

/*styles for blanket, toys and toys for baby*/
#blankets,
#toys_for_baby,
#toys {
  display: grid;
  grid-template-columns: repeat(auto-fit,
      minmax(280px, 1fr));
  /* Автоматична сітка */
  gap: 30px;
  padding: 40px 5%;
  background-color: #f2ebe1;
}

/* Окрема картка товару */
#blankets>div,
#toys>div,
#toys_for_baby>div {
  background: #fdfaf7;
  border-radius: 15px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

#blankets>div:hover,
#toys_for_baby>div:hover,
#toys>div:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Фото товару */
#blankets img[alt^="blanket"],
#toys_for_baby img[alt^="toy_for_baby1"],
#toys img[alt^="toy1"] {
  width: 100%;
  height: 250px;
  object-fit: cover;
  /* Зберігає пропорції фото */
}

/* Контейнер з інфою всередині картки */
.info_product {
  padding: 20px;
  text-align: center;
  position: relative;
}

.info_product h4 {
  font-family: "Playfair Display", serif;
  color: #402e21;
  font-size: 20px;
  margin-bottom: 10px;
  min-height: 44px;
  /* Для вирівнювання заголовків у ряд */
}

.info_product p {
  font-family: "Playfair Display", serif;
  font-weight: bold;
  color: #8c6a4a;
  font-size: 16px;
  margin-bottom: 5px;
}

/* Кнопка "В кошик" */
.button_product {
  background-color: #8c6a4a;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  transition: background 0.3s;
  font-family: "Playfair Display", serif;
  margin: 20px 0;
}



.button_product:hover {
  background-color: #402e21;
}

.button_product img {
  width: 18px;
  filter: brightness(0) invert(1);
  /* Робить іконку кошика білою */
}

/* Стан при натисканні (моментальний відгук) */
.button_product:active {
  background-color: #b1967a;
  transform: scale(0.97);
}

/* Стан після натискання (фокус) */
.button_product:focus {
  background-color: #b1967a;
  /* Колір, який залишиться після кліку */
  color: #ffffff;
  box-shadow: 0 0 10px rgba(177, 150, 122, 0.5);
  /* Додає легке сяйво */
}


/* Іконка серця (обране) */

.info_product img[alt="heart"]:hover {
  transform: scale(1.1);
}

/* Блок вибору кількості */
.quantity {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}

.qty-btn {
  background: #fdfaf7;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  width: 100%;
}

.quantity input {
  width: 100px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  outline: none;
}

.section-title {
  display: flex;
  justify-content: center;
  font-family: "Playfair Display", serif;
  color: #402e21;
  font-size: 36px;
}

/* Контейнер одного елемента результату */
.search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-bottom: 1px solid #f2ebe1;
  cursor: pointer;
  transition: background 0.2s;
}

.search-item:hover {
  background: #fdfaf7;
}

/* Стиль прев'ю картинки */
.search-img-preview {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #efe5db;
}

/* Текст назви */
.search-name {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: #402e21;
  font-weight: 500;
}

/* Chrome, Safari, Edge, Opera */
.quantity input::-webkit-outer-spin-button,
.quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.quantity input[type="number"] {
  -moz-appearance: textfield;
}

/* Клас, який буде додаватися при натисканні */
.wishlist-btn img[alt="heart"] {
  position: absolute;
  top: -50px;
  right: 15px;
  background: white;
  padding: 8px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: 0.3s;
}

.wishlist-btn img[alt="heart"].active {
  /* Цей фільтр робить іконку коричневою */
  filter: invert(23%) sepia(13%) saturate(1200%) hue-rotate(346deg) brightness(95%) contrast(85%);
  transform: scale(1.1);
}

/*Щоб товари в кошику виглядали охайно:*/
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #efe5db;
  background: #fff;
  margin-bottom: 10px;
  border-radius: 10px;
}

.cart-item-controls button {
  background: #8c6a4a;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
}

.delete-item {
  background: #f2caa1 !important;
  color: #f8f8f8;
  margin-left: 15px;
}

.cart-summary {
  margin-top: 30px;
  text-align: right;
  padding: 20px;
  background: #fdfaf7;
  border-radius: 15px;
}

#cart-count {
  position: absolute;
  top: -8px;
  /* Зміщуємо вгору */
  right: -8px;
  /* Зміщуємо вбік */
  background-color: #8c6a4a;
  /* Ваш коричневий колір */
  color: white;
  font-size: 11px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  display: none;
  /* Спочатку ховаємо, поки кошик порожній */
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
  /* Біла обводка, щоб виділялося */
  pointer-events: none;
  /* Щоб лічильник не заважав клікати на іконку */
}

.actual-price {
  color: #402e21;
}

.continue-shopping {
  text-decoration: none;
  padding-top: 20px;
  color: black;
}

.continue-shopping:hover {
  color: #8c6a4a;
}

/* Основний стиль кнопки */
.submit-btn {
  background-color: #8c6a4a;
  /* Ваш стандартний коричневий */
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  /* Плавний перехід кольору */
}

/* Колір при наведенні (опціонально, трохи темніший) */
.submit-btn:hover {
  background-color: #7a5c40;
}

/* Колір при натисканні (світло-коричневий, як ви просили) */
.submit-btn:active {
  background-color: #b1967a;
  /* Світло-коричневий */
  transform: scale(0.98);
  /* Ефект легкого вдавлювання */
}


/*Стилізація модального вікна*/
#order-modal {
  border: none;
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  background: #fdfaf7;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.order-preview {
  max-height: 200px;
  overflow-y: auto;
  margin: 20px 0;
  border-bottom: 1px solid #efe5db;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.modal-total {
  font-weight: bold;
  font-size: 18px;
  margin: 20px 0;
  text-align: right;
  color: #8c6a4a;
}

.back-link {
  background: none;
  border: none;
  color: #8c6a4a;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 15px;
  display: block;
  width: 100%;
}

select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #efe5db;
  background: white;
  margin-top: 5px;
}