/* Базовые настройки шрифта и цвета */
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
  background-color: #fffaf4;
  color: #212529;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

html {
  width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-weight: 800;
  color: #212529;
}

header {
  background-color: #ffffff;
  padding: 20px 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: 1000;
  flex-direction: row;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left img.logo {
  height: 48px;
  width: auto;
}

.header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #ff6f00;
}

.header-right i {
  font-size: 28px; /* можно изменить на нужный размер */
}

/* Главное меню навигации */
nav ul,
.main-menu {
  display: flex;
  list-style: none;
  gap: 24px;
  margin: 0;
  padding: 0;
  flex-direction: row; /* Всегда горизонтально */
  flex-wrap: wrap;
  justify-content: center;
}

nav ul li a,
.main-menu a {
  text-decoration: none;
  font-weight: 500;
  color: #212529;
  transition: color 0.3s;
  font-size: 1.2rem;
  padding: 8px;
}

nav ul li a:hover {
  color: #ff6f00;
}

/* Hero-блок */
.hero {
  background: linear-gradient(135deg, #ffa94d 0%, #ff6f00 100%);
  color: white;
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.hero::after {
  content: '';
  position: absolute;
  width: 150%;
  height: 100px;
  background: white;
  border-radius: 50% 50% 0 0;
  bottom: -50px;
  left: -25%;
}

/* Back-to-top кнопка */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa94d 0%, #ff6f00 100%);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.back-to-top.hidden {
  display: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: scale(1);
}

.back-to-top:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #ef6800, #ef3a0d);
}

/* Контентные секции */
section {
  padding: 80px 0;
}

/* Карточка товара */
.card {
  border: none;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease-in-out;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.img-qr {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

/* переключение */
.gallery-container {
  max-width: 1000px;
  position: relative;
  margin: auto;
}

.gallery-container img {
  width: 300px;
  height: 250px;
  object-fit: cover;
  padding: 20px;
  background-color: white;
}

.gallery-img {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.gallery-img.visible {
  opacity: 1;
  display: block;
}

.prev, .next {
  position: absolute;
  top: 20%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: black;
  border: none;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  background: none;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
  color: #6f6f6f;
}

.dots-container {
  text-align: center;
  margin-bottom: 20px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer;
}

.dot.active {
  background-color: #ff6600;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

/* Избранное */
.fav-gallery {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.fav-img {
  width: 225px;
  height: 170px;
  object-fit: cover;
}

.fav-prev, .fav-next {
  position: absolute;
  top: 40%;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
}

.fav-prev:hover, .fav-next:hover {
  color: #6f6f6f;
}

.fav-prev { left: 5px; }
.fav-next { right: 5px; }

.fav-img-list {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.fav-img-list img {
  opacity: 1;
  display: block;
}

/* Управление количеством */
.qty-controls {
  position: absolute;
  right: 4rem;
  bottom: 2.5rem;
  display: inline-flex;
  gap: 10px;
  padding: 4px;
  align-items: center;
  background-color: #f0f0f0;
  border-radius: 8px;
}

.qty-btn {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.qty-btn:hover {
  background-color: #e0e0e0;
  border-radius: 4px;
}

.qty-number {
  color: #222;
  font-size: 18px;
  font-weight: bold;
  min-width: 24px;
  text-align: center;
}
.card-body small.text-dark.fs-4 {
  display: block;
  margin-top: 0.5rem;
}

/* Кнопка удаления товара */
.btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Упаковка и выпадающий список */
.product-card .pack {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 400;
  color: #6c757d;
  background-color: transparent;
  border: none;
  padding: 0;
}

.product-card .pack small {
  font-size: 0.875rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.5;
}

/* Кнопка с объемом */
.btn-size, .btn-volume {
  background-color: #ffa94d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 0px;
}

.btn-volume:hover {
  background-color: #ff6f00;
}

.btn-volume.active {
  background-color: #e8590c;
}

/* Кнопки цвета */
.btn-color {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid #ddd;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.2);
  margin: 5px;
}

.btn-color.active {
  border-color: #fff;
  box-shadow:
    0 0 0 1px white,
    0 0 0 2px black;
}

/* Формы и поля ввода */
input,
textarea {
  border-radius: 10px !important;
  border: 1px solid #dee2e6 !important;
  padding: 10px;
  font-size: 1rem;
  background-color: #fff;
  box-shadow: none;
  max-width: 100%;
}

input:focus,
textarea:focus {
  border-color: #ffa94d !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 175, 0, 0.25);
}

/* Кнопка действия (primary) */
.btn-primary {
  background-color: #ff6f00;
  border: none;
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}
.btn-warning {
  border: none;
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #e8590c;
}

/* Списки с галочками */
ul:not(nav ul) {
  list-style: none;
  padding-left: 0;
}

ul:not(nav ul) li::before {
  content: '✓';
  color: #ff922b;
  font-weight: bold;
  margin-right: 10px;
}

/* Футер сайта */
footer {
  font-size: 0.95rem;
  background-color: #212529;
  color: #f1f3f5;
  padding: 40px 0;
  text-align: center;
}

footer p {
  margin: 5px 0;
}

/* Модальное окно */
.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-x;
}

.modal-content {
  max-width: 100vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.close {
  position: fixed;
  top: 20px;
  right: 15px;
  color: white;
  font-size: 32px;
  cursor: pointer;
}

.modal-prev, .modal-next {
  position: absolute;
  top: 50%;
  font-size: 36px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  padding: 12px;
  transform: translateY(-50%);
}

.modal-prev {
  left: 15px;
}
.modal-next {
  right: 15px;
}

.modal-prev:hover, .modal-next:hover {
  color: #ddd;
}


/* Адаптивность */
/* Мобильные устройства (до 575.98px) */
@media (max-width: 575.98px) {
  header {
    padding: 8px;
    flex-direction: row !important;
  }
  .header-left {
    gap: 8px;
  }
  .header-left img.logo {
    height: 32px;
  }
  nav ul.main-menu, .header-right {
    display: none !important;
  }
  section {
    padding: 32px 8px;
  }
  .card-img-top, .img-fluid {
    max-height: 120px;
  }
  .card .row {
    display: flex;
    flex-direction: column;
  }

  .card .col-4 {
    width: 100%;
    order: 1;
  }

  .card .col-5 {
    width: 100%;
    order: 2;
  }

  .card .col-2 {
    width: 100%;
    order: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-top: 8px;
  }

  .col-2 strong {
    font-size: 16px;
  }
  .card-body small.text-dark.fs-4 {
    display: block;
    margin-bottom: 0.75rem;
  }
  .qty-controls {
    right: 2rem;
    bottom: 2rem;
  }
  .qty-number {
    font-size: 20px;
  }
  .fav-prev, .fav-next, .prev, .next {
    display: none !important;
  }
  .modal-prev, .modal-next {
    display: none !important;
  }
  .close {
    font-size: 24px;
    top: 10px;
    right: 10px;
  }
}

/* Планшеты (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  header {
    padding: 12px 20px;
    flex-direction: row !important;
  }
  .header-left img.logo {
    height: 38px;
  }
  nav ul.main-menu, .header-right {
    display: none !important;
  }
  section {
    padding: 48px 16px;
  }
  .card-img-top, .img-fluid {
    max-height: 140px;
  }
  .fav-prev, .fav-next, .prev, .next {
    display: none !important;
  }
  .qty-controls {
    right: 2rem;
    bottom: 2rem;
  }
  .modal-prev, .modal-next {
    display: none !important;
  }
  .favorites .col-md-4 {
    margin-top: 20px;
  }
  .favorites .card {
    padding: 20px;
  }
}

/* Небольшие ноутбуки (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  header {
    padding: 16px 28px;
    flex-direction: row !important;
  }
  .header-left img.logo {
    height: 44px;
  }
  nav ul.main-menu, .header-right {
    display: none !important;
  }
  section {
    padding: 60px 24px;
  }
  .card-img-top, .img-fluid {
    max-height: 160px;
  }
  .fav-prev, .fav-next, .prev, .next {
    display: none !important;
  }
  .qty-controls {
    right: 1rem;
    bottom: 2rem;
  }
  .modal-prev, .modal-next {
    font-size: 30px;
    padding: 10px;
  }
}

/* Десктопы (1025px и выше) */
@media (min-width: 1025px) {
  header {
    padding: 20px 32px;
  }
  .header-left img.logo {
    height: 48px;
  }
  nav ul.main-menu {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
  }
  nav ul.main-menu li a {
    font-size: 1.15rem;
  }
  .header-right {
    font-size: 1rem;
    display: flex !important;
  }
  .mobile-menu {
    display: none !important;
  }
}

/* Бургер-кнопка */
.menu-toggle {
  background: none;
  border: none;
  padding: 8px;
  margin-left: auto;
  cursor: pointer;
  display: none;
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: block !important;
  }
  .back-to-top {
    display: none !important;
  }
}

/* Мобильное меню */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  max-width: 320px;
  background: #fff;
  box-shadow: -2px 0 16px rgba(0,0,0,0.08);
  padding: 40px 20px 20px 20px;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
  z-index: 1050;
  border-radius: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

@media (max-width: 320px) {
  .mobile-menu {
    max-width: 280px;
    padding: 30px 15px 15px 15px;
  }
  .mobile-menu a {
    font-size: 1rem;
  }
  .mobile-menu .bi-whatsapp, .mobile-menu .bi-telegram {
    font-size: 24px;
  }
}

.mobile-menu.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu ul {
  list-style: none !important;
  margin: 0 0 24px 0;
  padding: 0;
}

.mobile-menu ul li + li {
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  color: #222;
  font-weight: 500;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color .2s;
}

.mobile-menu a:hover, .mobile-menu a:focus {
  color: #ff6600;
  outline: none;
}

/* Навигация в шапке */
.header-center ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-center ul li + li {
  margin-left: 24px;
}

.header-center a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  transition: color .2s;
}

.header-center a:hover, .header-center a:focus {
  color: #ff6600;
  outline: none;
}

/* Иконки в шапке справа */
.header-right a {
  color: inherit;
  text-decoration: none;
}

.header-right a:hover, .header-right a:focus {
  color: #ff6600;
  outline: none;
}

/* Убираем псевдоэлементы галочек */
.mobile-menu li {
  position: relative;
}

.mobile-menu li::before {
  display: none !important;
  content: none !important;
}
