.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    align-items: center;
}

@media (max-width: 768px) {
    .popup-overlay {
        align-items: flex-start;
        padding-top: 160px;
    }
}

.popup-content {
    position: relative;
    margin: 5% auto;
    width: 80%;
    max-width: 500px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .popup-content {
        width: 90%;       /* майже на весь екран */
        max-width: none;  /* прибираємо обмеження */
        margin: 20px auto; /* відступ зверху/знизу */
        border-radius: 8px; /* залишаємо кути */
    }
}


.popup-image {
    width: 100%;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FF6600;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.popup-details {
    padding: 20px;
}

.popup-details h3 {
    font-weight: bold;
    font-size: 24px;
    margin-bottom: 10px;
}

.popup-details .popup-price {
    font-weight: bold;
    font-size: 22px;
    color: #000;
    margin-bottom: 10px;
}

.popup-details .popup-description,
.popup-details .popup-weight {
    color: #777;
    font-size: 16px;
    margin-bottom: 5px;
}

.popup-details .popup-weight i {
    margin-right: 5px;
    color: #777 !important;
    font-size: 16px;
    display: inline-block;
}

.action-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portion-control {
    display: flex;
    align-items: center;
}

.favorite-button2 {
    width: 40px;
    height: 40px;
    padding: 10px;
    margin: 0 5px;
    border: 2px solid orange;
    background-color: transparent;
    color: orange;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.add-to-favorites {
    background-color: orange;
    color: white;
    flex-grow: 1;
    margin-left: 10px;
}

.add-to-favorites:hover {
    background-color: #ff8c00;
}

.add-to-favorites:active {
    background-color: #ff6f00;
}

.portion-count {
    margin: 0 10px;
    font-size: 16px;
    width: 8px; /* Фіксована ширина для лічильника */
    text-align: center; /* Вирівнювання тексту по центру */
    display: inline-block; /* Робимо блоковий елемент, щоб ширина працювала */
}





/* Заголовок страви */
h4 {
    text-align: center; /* Вирівнювання тексту по центру */
    font-size: 1.5rem; /* Збільшений шрифт */
    font-weight: bold; /* Жирний шрифт */
    margin-bottom: 20px; /* Відступ знизу для візуальної естетики */
}

.dish-name {
    font-weight: bold;
    font-size: 1.2rem; /* Збільшений шрифт */
}

/* Вартість страви */
.dish-price {
    color: gray;
    margin-top: 5px; /* Відступ від назви */
    display: block;
}

/* Контролери порцій */
.portion-control-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Вирівнюємо елементи праворуч */
    margin-top: 10px;
}

/* Кнопки зменшення та збільшення */
.decrease-button, .increase-button {
    width: 30px;
    height: 30px;
    border: 2px solid orange;
    color: orange;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    border-radius: 5px; /* Зробити кути заокругленими */
}

/* Лічильник */
.portion-count {
    text-align: center;
    font-size: 1.1rem;
    width: 8px; /* Фіксована ширина для лічильника */
    text-align: center; /* Вирівнювання тексту по центру */
    display: inline-block; /* Робимо блоковий елемент, щоб ширина працювала */
}

/* Загальна сума */
.dish-total-price {
    font-weight: bold;
    margin-left: 5px;
    min-width: 60px; /* Фіксована мінімальна ширина для вирівнювання */
    text-align: right; /* Вирівнювання тексту по правому краю */
}

/* Сепаратор між стравами */
.dish-separator {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

/* Контейнер загальної суми */
.total-order {
    display: flex;
    justify-content: space-between; /* Вирівнювання елементів */
    align-items: center;
    margin-top: 15px;
}

/* Заголовок "Загальна сума замовлення:" */
.total-order-label {
    font-size: 1.5rem; /* Збільшений шрифт */
    font-weight: bold; /* Жирний шрифт */
}

/* Загальна сума */
#total-order-price {
    font-size: 1.5rem; /* Такий же шрифт, як заголовок */
    font-weight: bold; /* Жирний шрифт */
    color: orange; /* Колір помаранчевий */
}


/* Контейнер для назви страви та ціни */
.dish-info {
    display: flex;
    justify-content: space-between; /* Вирівнює елементи по краях */
    align-items: center; /* Вертикальне вирівнювання */
}

/* Заголовок страви */
.dish-name {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Вартість страви */
.dish-price {
    color: gray;
    margin-left: 15px; /* Відступ між назвою і ціною */
}