html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding-top: 100px; /* 30px top-bar + 70px header */
    font-family: 'Helvetica Neue', sans-serif;
    background-color: #f9f9f9;
}

body.lock-scroll {
    overflow: hidden;
    padding-right: 15px;
}

/* Анимация при наведении на ссылки */
nav a {
    position: relative;
    color: inherit;
    transition: color 0.3s ease; /* Плавный переход для цвета */
}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background-color: #fc40c7a1;
    transform: scaleX(0); /* Начальное состояние, риски нет */
    transform-origin: left;
    transition: transform 0.3s ease; /* Плавный переход для риски */
}

nav a:hover {
    color: #494949;
}

nav a:hover::after {
    transform: scaleX(1); /* Анимация появления риски при наведении */
}

/* Убираем анимацию при наведении на кнопку */
.left button {
    background-color: inherit;
    color: inherit;
}

.left button:hover {
    background-color: inherit;
    color: inherit;
    transform: none; /* Убираем анимацию увеличения */
}

.custom-toast-wrapper {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1055;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none; /* чтобы клики проходили сквозь */
}

.custom-toast-wrapper .alert {
  pointer-events: auto;
  display: inline-block;
  min-width: 360px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  padding: 24px 32px;         /* Увеличенные отступы */
  font-size: 1.25rem;         /* Крупнее шрифт */
  font-weight: 500;           /* Чуть жирнее */
  border-radius: 14px;        /* Более скруглённые углы */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Более мягкая и широкая тень */
}

.alert.hide {
  opacity: 1; /* Убираем анимацию скрытия */
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .custom-toast-wrapper .alert {
    min-width: 250px;  /* Уменьшаем минимальную ширину */
    max-width: 350px;  /* Ограничиваем максимальную ширину */
    width: 80%;        /* Делаем ширину 80% */
    padding: 16px 24px;/* Уменьшаем отступы */
    font-size: 1rem;   /* Уменьшаем шрифт */
    font-weight: 400;  /* Меньше жирность */
    border-radius: 12px; /* Меньше радиус скругления */
  }
}

/* Overlay для корзины */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1050; /* Обеспечиваем, что она будет поверх всего */
}

/* Выдвижная корзина */
.slide-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100%;
  background-color: #fff;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 1051;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

.slide-cart.open {
  transform: translateX(0);
}

/* Заголовок корзины */
.cart-header {
    padding: 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-cart-btn {
    background: none;
    border: none;
    font-size: 25px;
    cursor: pointer;
    color: #333;
}

/* Элементы корзины */
.cart-items {
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: flex-start; /* выравнивание сверху */
    gap: 10px; /* уменьшает расстояние между фото и текстом */
    margin-bottom: 12px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.cart-item-name {
    font-size: 14px;
    color: #333;
}

.cart-item-price {
    font-size: 14px;
    color: #fc40c7a1;
}

.cart-item-quantity {
    font-size: 14px;
    color: #333;
}

.remove-item button {
    background: none;
    border: none;
    font-size: 18px;
    color: #fc40c7a1;
    cursor: pointer;
}

/* Нижняя часть корзины */
.cart-footer {
    padding: 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}

.total-price {
    font-size: 16px;
    color: #333;
}

.checkout-btn {
    padding: 10px 20px;
    background-color: #fc40c7a1;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 1; /* Убираем анимацию */
    }
}

/* По умолчанию, элементы скрыты */
.auto-dismiss {
    opacity: 1;
}

.auto-dismiss.hide {
    opacity: 1; /* Убираем анимацию скрытия */
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .slide-cart {
        width: 80%;
    }
}
