/* Сброс базовых отступов и общие настройки */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    color: #f1f1f1;
    font-size: 14px;
}

/* Стили для ряда иконок кафе */
.cafe-icons {
    display: flex;
    overflow-x: auto; /* Горизонтальная прокрутка при необходимости */
    padding: 10px;
    background-color: #282828; /* Темнее фон для отличия */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    white-space: nowrap; /* Предотвращаем перенос строк */
}

.cafe-icon {
    flex: 0 0 auto; /* Не растягиваем и не сжимаем */
    margin-right: 15px; /* Отступ между иконками */
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cafe-icon:hover {
    opacity: 0.8;
}

.cafe-icon.active {
    opacity: 1;
    /* Возможно, добавить индикатор активности, например, рамку */
    border-bottom: 2px solid #00cc66;
}

.cafe-icon img {
    width: 50px; /* Размер иконки */
    height: 50px; /* Размер иконки */
    object-fit: cover;
    border-radius: 50%; /* Круглая форма */
    margin-bottom: 5px;
}

.cafe-icon span {
    font-size: 12px;
    color: #f1f1f1;
    text-align: center;
}

/* Контейнер: две колонки, высота = экран - панель заказа */
.container {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 60px);
    overflow-x: auto;
}

/* Сайдбар (категории) с вертикальной прокруткой */
.sidebar {
    width: 250px;
    background-color: #2e2e2e;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 18px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #f1f1f1;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar li a:hover,
.sidebar li a.active {
    background-color: #00cc66;
}

.sidebar li img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.category-name {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    text-align: center;
}

/* Правый блок – товары */
.content {
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Секция для каждой категории */
.category-section {
    margin-bottom: 40px;
}

.category-divider {
    border-bottom: 2px solid #444;
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.category-divider h2 {
    margin: 0;
    font-size: 20px;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Карточка товара */
.product {
    background-color: #2e2e2e;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.product.selected {
    border: 2px solid #00cc66;
}

.product:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Изображение товара с заданной высотой */
.product img {
    width: 100%;
    height: 120px;  /* согласно вашим изменениям */
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

/* Обёртка для изображения для позиционирования метки */
.image-wrapper {
    position: relative;
}

/* Метка варианта – теперь с красным фоном */
.variant-label {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
}

/* Информация о товаре */
.product-info {
    padding: 5px 0;
}

.product-info h3 {
    font-size: 16px;
    margin: 4px 0;
}

.product-info p {
    font-size: 13px;
    margin: 4px 0;
}

.price {
    font-weight: bold;
    color: #00cc66;
    font-size: 14px;
}

/* Контроллер количества – поднят выше метки (z-index: 3) */
.quantity-control {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    display: none;
    align-items: center;
    color: #fff;
    touch-action: none;
    z-index: 3;
}

.quantity-control button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 0 5px;
    cursor: pointer;
    touch-action: manipulation;
}

.quantity-control .quantity {
    margin: 0 5px;
    font-size: 16px;
}

/* Фиксированная панель заказа – по умолчанию скрыта */
.order-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    text-align: center;
    z-index: 100;
}

#order-button {
    background-color: #00cc66;
    color: #fff;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#order-button .btn-text {
    margin-left: 10px;
}

/* Адаптивные правки для мобильных устройств */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 5px;
    }
    .sidebar h2 {
        font-size: 14px;
    }
    .sidebar li img {
        width: 60px;
        height: 60px;
    }
    .category-name {
        font-size: 12px;
    }
    .content {
        padding: 8px;
    }
    .category-divider h2 {
        font-size: 16px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product {
        padding: 8px;
        border-radius: 6px;
    }
    .product-info h3 {
        font-size: 14px;
    }
    .product-info p {
        font-size: 12px;
    }
    .price {
        font-size: 12px;
    }
    .product img {
        height: 120px;
    }
    .quantity-control {
        padding: 3px 6px;
    }
    .quantity-control button {
        font-size: 18px;
    }
    .quantity-control .quantity {
        font-size: 14px;
    }
    #order-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    #order-button .btn-text {
        margin-left: 5px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
