.Header {
    position: fixed;
    height: 50px; /* Немного увеличили для симметрии */
    width: 100%;
    /* Вместо синего #2563eb используем белый или темный зеленый из карточки */
    background: rgba(255, 255, 255, 0.8); 
    backdrop-filter: blur(10px); /* Эффект стекла, как у кнопок навигации */
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
}

.flooter {
    position: fixed;
    height: 40px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e0e0e0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}
.flooter:empty {
  display: none;
}
.page-btn {
    min-width: 35px;
    height: 28px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #333;
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5; /* Делает кнопку полупрозрачной */
    background: #f0f0f0;
}

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
    font-weight: bold;
}

.page-btn:hover {
    border-color: #016d01;
    color: #016d01;
}

.top {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

#menu-app {position: relative; font-family: sans-serif; height: 42px; width: 50px;}

/* Скрываем чекбоксы управления */
.cart-checkbox, .burger-checkbox { display: none; }

.cart-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-icon {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
    display: block;
}
.cart-icon:hover { transform: scale(1.1); }

.badge {
    position: absolute;
    top: 2px;
    right: 0px;
    background-color: #ff4d4d;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.badge-animate {
    animation: pulse 0.3s ease-out;
}

.badge.active {
    opacity: 1;
}

.cart-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 325px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    padding: 10px;
    /* ИЗМЕНЕНИЕ: Используйте flex только когда корзина открыта */
    display: none; 
    z-index: 1001;
    /* ИЗМЕНЕНИЕ: Ограничиваем только общую высоту окна */
    max-height: 80vh; 
    box-sizing: border-box;
}
.cart-content {
    /* ИЗМЕНЕНИЕ: Убираем max-height в vh, разрешаем блоку расти */
    flex: 1 1 auto; 
    overflow-y: auto; /* Включает прокрутку при переполнении */
    overflow-x: hidden;
    padding-right: 8px;
    margin: 10px 0;
    
    /* Добавляем минимальную высоту, чтобы блок не схлопывался */
    min-height: 30px; 
    max-height: 50vh; 
}

.cart-footer {
    flex-shrink: 0; 
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* ИЗМЕНЕНИЕ: Чтобы заголовок не сжимался */
.cart-header {
    flex-shrink: 0;
}

/* 4. Фиксируем отображение при открытии */
.cart-checkbox:checked + .cart-icon + .cart-dropdown {
    display: flex; /* Вместо block для работы flex-grow */
    animation: fadeIn 0.2s ease-out;
}
.cart-checkbox:checked + .cart-icon + .cart-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-header {
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.cart-img{
    width: 50px;
    height: 70px; object-fit: cover;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item-info{
    flex: 1; /* Занимает все свободное пространство */
}
.quantity-controls{
    display: flex;
  justify-content: center; /* Центрирует по горизонтали */
  align-items: center;     /* Центрирует по вертикали */
  margin: 5px;            /* Отступ от других элементов снаружи */
  gap: 10px; 
}
.cart-item-price {
    font-weight: bold;
    white-space: nowrap;
}

.cart-footer {
    margin-top: 15px;
}

.cart-total {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: right;
    margin-bottom: 10px;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

#clear-cart {
    flex: 1;
    background: #f5f5f5;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #777;
}

#checkout {
    flex: 2;
    background: #016d01; /* Тот самый зеленый из карточки */
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

#checkout:hover { opacity: 0.9; }

/* Иконка бургера */
.burger-btn {
      display: block;
  width: 30px;
  cursor: pointer;
  padding: 10px;
  height: 22px;
}
.burger-line {
    height: 2px;
    background: #333; /* Нейтральный темный */
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.burger-btn:hover .burger-line {
    background: #016d01; /* Цвет как при наведении на карточку */
    transform: translateY(-5); /* Подъем вместо scale */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
/* Выпадающее меню */
.top-menu {
    position: fixed;
    top: 0;
    left: 10;
    width: 300px;
    height: auto;

    background: #ffffff;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    transform: translateY(-100%); /* Прячем влево, а не вверх */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    padding-top: 60px; /* Отступ под хедер */
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0px 0px 6px 0px;
}

/* Показ при клике */
body:has(#burger-toggle:checked) #menu  {
    transform: translateY(0);
}

/* Стилизация списков */
.main-list { list-style: none; padding: 0px; margin: 0px;}

.sex-title {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s;
}
.sex-title:hover {
    color: #016d01;
}

.category-list {
    list-style: none;
    background: #fcfcfc;
    padding: 5px 0;
    margin-block-start: 5px;
    margin-block-end: 5px;
    max-height: 60vh; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
}

.cat-link {
    padding: 5px 25px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 0.95rem;
}
.cat-link:hover {
    background: #f0fdf4; /* Очень светлый зеленый фон */
    color: #016d01; /* Зеленый из карточки */
}
.all-products{
    border-bottom: 1px solid #f0f0f0 ;
}
#content-display { 
    /* Отступ сверху должен быть чуть больше высоты хедера (50px), чтобы контент не прилипал */
    margin-top: 55px; 
    
    /* Добавляем нижний отступ, чтобы футер не перекрывал карточки (40px высота футера + запас) */
    margin-bottom: 50px; 
    
    padding: 20px; 
    
    /* Убираем жесткий font-size, так как внутри будут карточки со своими стилями шрифтов */
    font-size: 1rem; 
    
    /* Центрируем содержимое */
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* Цвет фона делаем нейтральным (светло-серый), чтобы белые карточки .Product "выпрыгивали" */
    background-color: #f8f9fa; 
    
    /* Плавный переход при смене контента */
    transition: opacity 0.3s ease;
    
    /* Ограничиваем ширину для больших экранов, как и в .desktop */
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}