body {
    margin: 0;
    padding: 0;
    background: black;
    color: white;
    font-family: sans-serif;
    box-sizing: border-box;
    overflow-x: hidden;
    display: flex;
    touch-action: manipulation;
    min-height: 100vh;
    justify-content: center;   /* центрируем весь контейнер */
}


/* обертка всей страницы */
.container-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 375px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

/* контейнер кнопок */
#buttons-container {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-auto-rows: 58px;
    gap: 8px;
    width: max-content;
    height: calc(60px * 3 + 8px * 2);
    overflow-y: scroll;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-left: 1px;
    padding-right: 8px; /* увеличили правый отступ, скролл вправо от кнопок */

    position: relative;
    z-index: 10; /* выше картинки, чтобы анимации price-effect были поверх */
}



.top-image {
    width: 95%;
    height: 150px;
    object-fit: cover;
    object-position: center 20%;  /* ← вот тут регулируем */
    border-radius: 12px;
    margin: 0 auto 10px auto;
    display: block;
    position: relative;
    z-index: 5;
}



  /* сдвигаем вправо */
  padding-left: 4px; /* увеличь/уменьшай по вкусу */
}


/* Скрыть скроллбар в Webkit-браузерах */
/* Для современного вертикального скролла */
#buttons-container::-webkit-scrollbar {
    width: 8px;                 /* толщина скроллбара */
}

#buttons-container::-webkit-scrollbar-track {
    background: transparent;    /* дорожка прозрачная */
    border-radius: 4px;
}

#buttons-container::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3); /* цвет ползунка */
    border-radius: 4px;
    transition: background 0.3s;
}

#buttons-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.6); /* подсветка при наведении */
}

/* Для Firefox */
#buttons-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}


.product-btn div.price-effect {
    position: absolute;
    z-index: 20; /* поверх всего */
}


.product-btn {
    height: 60px;
    background: linear-gradient(135deg, #222, #333); /* градиент */
    color: white;
    border: none;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.product-btn:hover, .product-btn:active {
    transform: scale(1.05); /* слегка увеличиваем кнопку */
    background: linear-gradient(135deg, #333, #444); /* подсветка */
}

.product-btn div:first-child {
    font-size: 28px;           /* чуть больше иконка */
    transition: transform 0.2s;
}

.product-btn:hover div:first-child {
    transform: scale(1.3);     /* увеличиваем иконку при hover/тапе */
}

/* подсветка при наведении */
.product-btn:hover {
    background: #333;
}

/* анимация нажатия через псевдокласс */
.product-btn:active {
    transform: scale(0.9);
    background: #555;
}

/* дополнительная анимация через JS класс */
.product-btn.clicked {
    transform: scale(0.85);
    background: #666;
}

.product-btn div:first-child {
    font-size:24px;
}

.product-btn .count {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    background: green;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none; /* скрыт изначально */
    align-items: center;
    justify-content: center;
}

#cart-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.product-block {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 5px 0;
    padding: 10px 0;
    background: #222;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    transition: transform 0.1s, background 0.2s;
    cursor: default; /* если не кликабельные */
}

.product-block:hover {
    background: #444; /* подсветка при наведении */
}

@keyframes jump {
    0% { transform: translateY(0); }
    30% { transform: translateY(-10px); } /* вверх на 10px */
    60% { transform: translateY(3px); }   /* немного вниз */
    100% { transform: translateY(0); }    /* возвращаемся */
}

.product-btn.jump {
    animation: jump 0.4s ease-out;
}

.cart-btn {
    height: 60px;
    width: 60px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 12px;
    cursor: pointer;
}

.cart-btn .count {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    background: green;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ряд трёх кнопок под продуктами */
#top-buttons-row {
    display: flex;
    justify-content: space-between;
    width: 95%;
    margin: 10px auto;
    gap: 0;
}

/* Общий стиль для всех трёх кнопок */
.top-btn {
    width: 31.66%;        /* 95% / 3 = ~31.66% */
    height: 50px;
    color: white;         /* текст белый для всех */
    font-weight: bold;
    font-size: 16px;      /* одинаковый размер шрифта для всех */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.3s;
}

/* Цвета кнопок */
.red-btn { background: #dc3545; }
.green-btn {
    background: #007bff;
    font-size: 18px;
}
.yellow-btn { background: #ffc107; color: white; } /* теперь белый текст вместо чёрного */

/* Анимация ховер и клик */
.top-btn:hover { transform: scale(1.05); filter: brightness(1.1); }
.top-btn:active { transform: scale(0.95); filter: brightness(0.9); }

/* Модальное окно Notes */
.modal {
    display: none; /* скрыто по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #222;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-content textarea {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    border: none;
    padding: 10px;
    font-size: 14px;
    resize: none;
}

.modal-content button {
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

#save-notes { background: #28a745; color: white; }
#close-notes { background: #dc3545; color: white; }

.product-btn.magic {
    animation: jumpGlow 0.8s ease forwards;
}

@keyframes jumpGlow {
    0% { transform: translateY(0); box-shadow: 0 0 0px rgba(255,255,0,0); }
    25% { transform: translateY(-10px); box-shadow: 0 0 15px rgba(255,255,0,0.8); }
    50% { transform: translateY(0); box-shadow: 0 0 15px rgba(255,255,0,0.8); }
    75% { transform: translateY(-5px); box-shadow: 0 0 10px rgba(255,255,0,0.5); }
    100% { transform: translateY(0); box-shadow: 0 0 0px rgba(255,255,0,0); }
}

#total {
    font-size: 20px;       /* размер цифр */
    font-weight: bold;     /* жирность */
    color: white;          /* цвет цифр */
    display: flex;         /* чтобы иконка и цифры красиво выравнивались */
    align-items: center;
    justify-content: center;
    gap: 4px;              /* расстояние между иконкой и цифрой */
}

.yellow-btn.active-note {
    animation: noteGlow 1s infinite;
}

@keyframes noteGlow {
    0% { box-shadow: 0 0 0px rgba(255,255,0,0); }
    50% { box-shadow: 0 0 20px rgba(255,255,0,1); }
    100% { box-shadow: 0 0 0px rgba(255,255,0,0); }
}
