/* =========================
   GLOBAL
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================
   MENU CONTAINER
========================= */

.menu-items {
    padding: 20px;
}

/* =========================
   CATEGORY SECTION
========================= */

.category-section {
    margin: 0 auto 24px;
}

.category-section:last-child {
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
}

.category-section > h2 {
    max-width: 1200px;
    margin: 0 auto 12px;
}

/* =========================
   GRID LIST (3 / 2 / 1)
========================= */

.menu-item-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* DESKTOP */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .menu-item-list {
        grid-template-columns: repeat(2, 1fr); /* TABLET */
    }
}

@media (max-width: 600px) {
    .menu-item-list {
        grid-template-columns: 1fr; /* MOBILE */
        gap: 10px;
    }
}

/* =========================
   CARD
========================= */

.menu-item-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;

    display: flex;
    gap: 12px;
    align-items: flex-start;

    width: 100%;
    height: 100%;

    /* КРИТИЧНО для grid + flex */
    min-width: 0;
}

/* =========================
   IMAGE (≈30%)
========================= */

.menu-item-image {
    margin-top: 20px;
    flex: 0 0 40%;
    max-width: 40%;
    min-width: 120px;   /* трохи більший мінімум — виглядає краще */

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}

/* =========================
   DETAILS (≈70%)
========================= */

.menu-item-details {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================
   HEADER
========================= */

.menu-item-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

/* =========================
   LABELS
========================= */

.menu-item-label-container {
    display: inline-flex;
    gap: 5px;
    min-height: 20px;
    align-items: center;
}

.menu-item-label-container:empty {
    visibility: hidden;
}

.menu-item-label {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.new-label {
    background-color: rgba(255, 0, 0, 0.65);
}

.popular-label {
    background-color: rgba(0, 0, 255, 0.57);
}

/* =========================
   PRICE & TEXT
========================= */

.menu-item-price {
    font-size: 22px;
    font-weight: 700;
    color: #000;
}

.menu-item-description {
    font-size: 13px;        /* ⬅️ розмір тексту */
    white-space: pre-line;
    line-height: 1.45;
    margin: 0;
    color: #777;

    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.menu-item-weight {
    display: flex;
    align-items: center;
    color: #777;
}

.menu-item-weight i {
    margin-right: 5px;
}

/* =========================
   ACTION SLOT (UNDER IMAGE)
   Фіксована висота для кнопки / лічильника
========================= */

.menu-item-image-actions {
    width: 100%;
    height: 44px;              /* 🔑 ЄДИНИЙ стандарт */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   FAVORITE BUTTON
========================= */

.favorite-but {
    width: 100%;
    height: 100%;              /* 🔑 під слот */
    padding: 0;                /* ❌ прибираємо padding */

    border: 2px solid orange;
    background-color: transparent;
    color: orange;

    border-radius: 10px;
    cursor: pointer;

    text-transform: uppercase;
    font-weight: 700;
    font-size: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background-color 0.3s, color 0.3s;
}

.favorite-but:hover {
    background-color: orange;
    color: #fff;
}

/* =========================
   QUANTITY CONTROLS
========================= */

.quantity-select {
    display: grid;
    grid-template-columns: 44px auto 44px;

    width: 100%;
    height: 100%;              /* 🔑 той самий слот */

    align-items: center;
    justify-content: center;

    column-gap: 10px;
}

/* =========================
   PLUS / MINUS BUTTONS
========================= */

.increase-but,
.decrease-but {
    width: 44px;
    height: 44px;

    background-color: transparent;
    border: 2px solid orange;
    color: orange;

    border-radius: 10px;
    cursor: pointer;

    font-size: 18px;
    font-weight: 700;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background-color 0.3s, color 0.3s;
}

.increase-but:hover,
.decrease-but:hover {
    background-color: orange;
    color: white;
}

/* =========================
   PORTION COUNTER
========================= */

.portion-cou {
    min-width: 24px;           /* 🔑 без скачків 9 → 10 */
    text-align: center;

    font-size: 18px;
    font-weight: 700;

    display: inline-block;
}

/* =========================
   MOBILE TUNING
========================= */

@media (max-width: 600px) {
    .menu-item-card {
        padding: 10px;
    }
}











/* Стилі для текстового меню */
.textmenu-text-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid #ddd; /* Рамка з усіх сторін */
    max-width: 900px;
    margin: 0 auto;
    margin-top: 10px;  /* Відступ зверху від інших елементів */
    margin-bottom: 10px; /* Відступ знизу від інших елементів */
    border-radius: 5px; /* Згладжені кути, якщо потрібно */
}

.textcategory-section {
    margin-bottom: 40px;
}

.textmenu-category-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.textmenu-category-content {
    display: flex;
    justify-content: space-between;
    gap: 50px;
}

.textmenu-item-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Відступ між колонками */
}

.textmenu-item {
    width: calc(50% - 10px); /* Відступ між колонками */
    display: flex;
    justify-content: space-between;
    padding: 0px;
    position: relative;
    margin-top: 0px; /* Забираємо зайві відступи */
    margin-bottom: -21px; /* Негативний відступ для накладання ліній */
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc; /* Лінія знизу для всіх */
}

.textmenu-item-info {
    width: 73%;
    display: flex;
    flex-direction: column;
}

/* Вирівнювання значків "NEW" та "ПОПУЛЯРНЕ" */
.textmenu-item-label-container {
    display: inline-flex;
    gap: 5px;
    align-items: center;

    min-height: 14px;        /* резерв під лейби */
    margin-top: 4px;        /* ⬅️ ВІДСТУП ВІД СЕПАРАТОРА */
    margin-bottom: 2px;     /* маленький відступ до назви */
}

/* Якщо немає значків, контейнер все одно буде займати місце */
.textmenu-item-label-container:empty {
    visibility: hidden; /* Робимо його невидимим, але він зберігає висоту */
}

/* Оформлення значків */
.textmenu-item-label {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

.textnew-label {
    background-color: rgba(255, 0, 0, 0.65);
}

.textpopular-label {
    background-color: rgba(0, 0, 255, 0.57);
}

.textmenu-item-title {
    font-size: 18px;
    font-weight: bold;

    margin: 0;            /* ⬅️ без дефолтних відступів */
    line-height: 1.2;

}

.textmenu-item-description {
    white-space: pre-line;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
}

.textmenu-item-weight {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
    margin-bottom: 14px;
}

.textmenu-item-right {
    width: 27%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    padding-right: 15px;   /* ⬅️ ЄДИНЕ МІСЦЕ ВІДСТУПУ ВІД КРАЮ */
}

/* Порожній рядок, який відповідає лейбам */
.textmenu-item-right::before {
    content: '';
    display: block;
    height: 14px;        /* ⬅️ ТА САМА ВИСОТА, ЩО min-height ЛЕЙБІВ */
    margin-top: 4px;     /* ⬅️ ТА САМИЙ ВІДСТУП ВІД СЕПАРАТОРА */
    margin-bottom: 2px;  /* ⬅️ як у лейбів */
}

.textmenu-item-price {
    font-size: 20px;
    font-weight: bold;
    color: #10100f;

    margin: 0;          /* ⬅️ обовʼязково */
    line-height: 1.2;
}

/* =========================
   TEXT MENU ACTION SLOT
========================= */

.textmenu-item-actions {
    width: 100%;
    height: 40px;              /* 🔑 ФІКСОВАНА ВИСОТА */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* ⬅️ праве вирівнювання, як ціна */
    margin-top: 25px;
}


.textfavorite-but {
    background-color: transparent;
    border: none;
    cursor: pointer;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.textfavorite-but i {
    color: transparent;
    font-size: 20px;
    -webkit-text-stroke: 2px #d9534f;
}

/* Кнопки "+" і "-" */
.textincrease-but,
.textdecrease-but {
    width: 30px;
    height: 30px;

    background-color: transparent;
    color: orange;
    border: 2px solid orange;
    border-radius: 5px;
    cursor: pointer;

    font-size: 18px;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background-color 0.3s, color 0.3s;
}

.textincrease-but:hover,
.textdecrease-but:hover {
    background-color: orange;
    color: white;
}

.textquantity-select {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;              /* 🔑 КЛЮЧ */

    gap: 10px;
}

@media (max-width: 768px) {

    /* Контейнер меню */
    .textmenu-text-container {
        border: none;
    }


    /* Картка меню: залишаємо ліву + праву частину в одному рядку */
    .textmenu-item {
        width: 100%;
    }
}

