/* =========================
   ГЛАВНАЯ КАРТОЧКА СТРАНИЦЫ
   ========================= */

.bestellung-container {
    max-width: 1000px;
    width: 90%;
    margin: 30px auto;
    padding: 24px 26px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow:
        0 4px 10px rgba(0,0,0,0.06),
        0 16px 32px rgba(0,0,0,0.12);
}

.bestellung-container h2 {
    font-weight: 700;
    font-size: 1.7rem;
    text-align: center;
    margin-bottom: 20px;
}

/* =========================
   БЛОКИ (3 секции)
   ========================= */

.section-block {
    background: #fff;
    padding: 20px 22px;
    border-radius: 18px;
    margin-bottom: 26px;

    box-shadow:
        0 3px 6px rgba(0,0,0,0.05),
        0 10px 20px rgba(0,0,0,0.08);

    transition: 0.25s ease;
}

.section-block:hover {
    transform: translateY(-3px);
    box-shadow:
        0 6px 12px rgba(0,0,0,0.06),
        0 16px 32px rgba(0,0,0,0.12);
}

.section-block h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* =========================
   КАТЕГОРИИ
   ========================= */

#categorySelect {
    min-width: 200px;
    width: 30%;
    font-size: 1rem;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* =========================
   КАРТОЧКИ БЛЮД
   ========================= */

.menu-item {
    animation: fadeInUp .4s ease;
}

.menu-card {
    width: 100%;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 22px;

    box-shadow:
        0 4px 8px rgba(0,0,0,0.06),
        0 12px 28px rgba(0,0,0,0.10);

    transition: transform .25s ease, box-shadow .25s ease;
}

.menu-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 6px 12px rgba(0,0,0,0.08),
        0 18px 36px rgba(0,0,0,0.14);
}

.menu-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 18px 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.card-text {
    font-size: 0.95rem;
    color: #555;
}

.card-price {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Кнопка + количество */
.qty-group {
    display: flex;
    max-width: 220px;
}

.qty-input {
    border-radius: 10px 0 0 10px !important;
}

.add-btn {
    border-radius: 0 10px 10px 0 !important;
    font-weight: 600;
    padding: 8px 14px;
}

/* =========================
   КОРЗИНА
   ========================= */

#cartList {
    max-height: 260px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.cart-total {
    font-size: 1.2rem;
    font-weight: 700;
}

/* =========================
   ФОРМА
   ========================= */

.order-box label {
    font-weight: 600;
}

/* =========================
   АДАПТИВНОСТЬ
   ========================= */

@media (max-width: 576px) {
    .bestellung-container {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .menu-img {
        height: 180px;
    }
}

/* Анимация появления */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Ограничение ширины блока оформления заказа */
.order-box {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Ограничение ширины блока "Ваш заказ" */
.section-block.cart-box {
    max-width: 100px;
    margin-left: auto;
    margin-right: auto;
}

/* Карточка блюда — 2 колонки */
.menu-card {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    align-items: center;
    margin-bottom: 20px;
}

/* Фото */
.col-img img.menu-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

/* Центр — текст */
.col-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.menu-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.menu-card-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.menu-card-price {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Правая колонка — количество + кнопка */
.col-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.qty-input {
    width: 80px;
}



/* ===== КАЛЕНДАРЬ ===== */

#calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    border: 1px solid #ddd;
    user-select: none;
    transition: 0.15s;
}

.calendar-day:hover {
    background: #e9ecef;
}

/* Нерабочие дни — красная штриховка */
.calendar-day.off {
    cursor: default;
    color: #999;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 0, 0, 0.25),
        rgba(255, 0, 0, 0.25) 1px,
        transparent 1px,
        transparent 4px
    );
}

.calendar-day.off:hover {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 0, 0, 0.25),
        rgba(255, 0, 0, 0.25) 1px,
        transparent 1px,
        transparent 4px
    );
}

/* Кнопки слотов */
.slot-btn {
    margin: 5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-header {
    text-align: center;
    font-weight: bold;
    padding: 6px 0;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.status-label.bestellt {
    background-color: #d9534f !important; /* красный */
}

.status-label.in-bearbeitung {
    background-color: #f0ad4e !important; /* жёлтый */
}

.status-label.abholbereit {
    background-color: #5cb85c !important; /* зелёный */
}

.status-label.abgeholt {
    background-color: #0275d8 !important; /* синий */
}




/* 📱 Мобильная версия — на всю ширину */

@media (max-width: 768px), (max-height: 500px) {

     .section-block {
        width: 100%;
        max-width: 100%;
        padding: 18px 14px;
        border-radius: 0; /* по желанию — выглядит как нативный мобильный блок */
        
    }

    .bestellung-container {
        width: 100%;
        max-width: 100%;
        padding: 0px;
        border-radius: 0;
    }

    .order-box,
    .section-block.cart-box {
        max-width: 100%;
        width: 100%;
    }

    .menu-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 12px;
    }

    .col-action {
        align-items: center;
    }

    .col-img img.menu-img {
        margin: 0 auto;
        width: 100%;
        max-width: 260px;
        height: auto;
    }
}

/* 📱 Улучшенные карточки блюд для мобильных */
@media (max-width: 768px), (max-height: 500px) {

    .menu-card {
        grid-template-columns: 1fr;
        padding: 14px;
        text-align: center;
        gap: 12px;
    }

    .col-img img.menu-img {
        width: 100%;
        max-width: 260px;
        height: auto;
        border-radius: 12px;
        margin: 0 auto;
    }

    .menu-card-title {
        font-size: 22px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .menu-card-desc {
        font-size: 15px;
        color: #666;
        margin-bottom: 10px;
    }

    .menu-card-price {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 12px;
    }

    .col-action {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .qty-input {
        width: 70px;
        font-size: 18px;
    }

    .add-btn {
        padding: 10px 18px;
        font-size: 18px;
        border-radius: 10px;
        font-weight: 700;
    }
}




#cartList .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Правая часть — не сжимать */
#cartList .list-group-item > div:last-child {
    flex-shrink: 0;
}

/* Цена — не переносить */
#cartList .list-group-item span:last-child {
    white-space: nowrap;
}


/* ============================
   📱 Карточки заказов — только для основной таблицы
   ============================ */

@media (max-width: 768px) {

    /* НЕ применять карточки к таблицам внутри модалки */
    #orderModal table.table {
        all: revert !important;
        display: table !important;
    }

    #orderModal table.table thead,
    #orderModal table.table tbody,
    #orderModal table.table tr,
    #orderModal table.table td {
        all: revert !important;
    }

    /* Применяем карточки только к таблице заказов */
    .orders-table.table thead {
        display: none !important;
    }

    .orders-table.table tbody tr {
        display: block !important;
        background: #fff !important;
        margin-bottom: 14px !important;
        border-radius: 12px !important;
        padding: 14px 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        position: relative !important;
    }

    .orders-table.table tbody td {
        display: flex !important;
        justify-content: space-between !important;
        padding: 6px 0 !important;
        border: none !important;
        background: none !important;
    }

    .orders-table.table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        flex-shrink: 0;
    }
}

/* всплывающее окноб добавленно в корзину */
/*
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(40, 167, 69, 0.95); 
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 99999;
    text-align: center;
}
.toast-message.show {
    opacity: 1;
}
*/



/* печать из модалки */
@media print {

    /* Скрыть всё на странице */
    body * {
        visibility: hidden !important;
    }

    /* Показать только модалку */
    #orderModal,
    #orderModal * {
        visibility: visible !important;
    }

    /* Печатать только тело модалки */
    #orderModal .modal-body {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }

    /* Скрыть заголовок и футер */
    #orderModal .modal-header,
    #orderModal .modal-footer {
        display: none !important;
    }

    /* Убрать тени и фон */
    #orderModal .modal-content {
        box-shadow: none !important;
        border: none !important;
    }
}


/* Исправление для мобильной версии — toast всегда поверх */
/* @media (max-width: 768px) {
    .toast-message {
        position: fixed !important;
        top: 40% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 999999 !important;
    } */

    /* Убираем влияние transform у контейнеров */
/*
    .bestellung-container,
    .section-block {
        transform: none !important;
        overflow: visible !important;
    }
} 
*/

/* Плавающая кнопка корзины */
.floating-cart-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: #198754;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    z-index: 99999;
    transition: transform 0.2s ease;
}

/* Бейдж количества */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Анимация прыжка */
.cart-bounce {
    animation: cartBounce 0.4s ease;
}

@keyframes cartBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.25); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Мобильная версия */
@media (max-width: 768px) {
    .floating-cart-btn {
        width: 54px;
        height: 54px;
        font-size: 26px;
        right: 14px;
        bottom: 14px;
    }
}

/* Горизонтальная сетка для выравнивания */
#cartList .list-group-item .d-flex {
    display: grid !important;
    grid-template-columns: 32px 40px 32px auto; /* − | qty | + | price */
    align-items: center;
    gap: 8px;
}

/* Цена — фиксированная ширина */
#cartList .list-group-item .price-cell {
    width: 70px;          /* ← регулируй под максимальную длину */
    text-align: right;
    white-space: nowrap;
}

/* Компактная сетка для − 1 + */
#cartList .list-group-item .d-flex {
    display: grid !important;
    grid-template-columns: 26px auto 26px auto; /* − | qty | + | price */
    align-items: center;
    column-gap: 0px; /* ← расстояние между кнопками и цифрой */
}

/* Компактные кнопки */
#cartList .qty-minus,
#cartList .qty-plus {
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    min-width: 0 !important;
    font-size: 18px;
    line-height: 1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Цифра — по центру */
#cartList .qty-value {
    text-align: center;
    font-weight: 600;
    min-width: 20px; /* чтобы не прыгала */
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ КОРЗИНЫ ===== */
@media (max-width: 768px) {

    /* Делаем 2 строки */
    #cartList .list-group-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Название — первая строка */
    #cartList .list-group-item > div:first-child {
        width: 100%;
        font-size: 15px;
        margin-bottom: 2px;
    }

    /* Вторая строка: qty + price */
    #cartList .cart-row {
        width: 100%;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    /* Блок − 1 + */
    #cartList .qty-minus,
    #cartList .qty-plus {
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        min-width: 0 !important;
        font-size: 18px;
        line-height: 1 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
    }

    /* Цена справа */
    #cartList .price-cell {
        margin-left: auto;
        white-space: nowrap;
        font-weight: 600;
    }
}

/* фиксация фильтра вверху экрана*/
.menu-filters {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}


