/* ЗАВЕДЕНИЕ */

.restaurant-page {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.menu-sidebar {
    width: 200px;
    font-size: 16px;
}

.back-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 30px;
    width: 100%;
    height: 50px;
    background-color: var(--color-white);
    font-size: 16px;
    font-weight: 400;
    border: 1px solid var(--color-white);
    border-radius: 10px;
    cursor: pointer;
}

.back-link:hover {
    transition: .3s;
    border-color: var(--color-black);
}


.back-link a {
    color: var(--color-text-dark);
}

.menu-categories p {
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 20px;
}

.menu-categories ul {
    display: flex;
    flex-direction: column;
}

.menu-categories a {
    display: flex;
    align-items: center;
    padding: 10px 17px;
    border-radius: 10px;
    width: 200px;
    height: 37px;
    color: var(--color-text);
}

.menu-categories a:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.menu-categories.mobile-categories {
    display: none;
}

.restaurant-main {
    flex: 1;
}

.restaurant-banner-container {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.restaurant-banner-img {
    width: 100%;
    height: auto;
    max-height: 330px;
    max-width: 880px;
    aspect-ratio: 880px/330px;
    border-radius: 25px;
    object-fit: cover;
    overflow: hidden;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h2 {
    font-weight: 600;
    font-size: 30px;
    color: var(--color-text);
    margin-bottom: 15px;
}

.menu-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.menu-item {
    background-color: var(--color-card-bg);
    border-radius: 28px;
    padding: 16px;
    height: 100%;
    width: 193px;
    display: flex;
    flex-direction: column;
}

.menu-item:hover {
    transition: .1s;
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 16px 24px var(--color-card-shadow-hover);
}

.menu-item-img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.menu-item-price {
    display: flex;
    font-weight: 600;
    font-size: 20px;
    color: var(--color-text-dark);
    text-align: start;
}

.menu-item-name {
    font-weight: 400;
    font-size: 14px;
    color: #6B6B6B;
    margin-top: 10px;
}

.menu-item button {
    background-color: #F5F4F2;
    border: none;
    color: var(--color-text-dark);
    font-weight: 400;
    font-size: 16px;
    padding: 10px 30px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 30px;
}

.menu-item button:hover {
    transition: .3s;
    background-color: var(--color-button-hover);
}

/* CART */

.cart {
    width: 260px;
    min-height: 600px;
    height: 100%;
    background-color: var(--color-card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px var(--color-card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-header {
    display: flex;
    flex-direction: column;
}

.cart-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-title h3 {
    font-weight: 600;
    font-size: 24px;
    margin: 0;
}

.clear-cart {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 400;
    font-size: 16px;
    color: #6b6b6b;
    padding: 0;
}

.cart-items {
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 14px;
    flex-grow: 1;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-item-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 64px;
}

.cart-item-content {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    gap: 10px;
}

.cart-item-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    align-items: center;
}

.cart-item-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-options-col {
    margin-bottom: 8px;
}

.cart-item-option {
    color: #888;
    font-size: 10px;
    display: block;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-price {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-dark);
    margin-top: 4px;
    white-space: nowrap;
}

.cart-item-qty-bg {
    display: flex;
    align-items: center;
    background: #f5f4f2;
    border-radius: 20px;
    padding: 4px 6px;
    gap: 8px;
    height: 28px;
    min-width: 80px;
    justify-content: space-between;
    box-sizing: border-box;
}

.cart-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
}

.cart-item-qty {
    min-width: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.cart-total {
    padding-top: 20px;
    border-top: 1px solid var(--color-card-shadow);
    margin-top: 20px;
}

.cart-total span {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 20px;
}

.checkout {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
}

.checkout:hover {
    background-color: var(--color-button-hover);
}

.cart-item-img-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-options-col {
    display: flex;
    flex-direction: column;
}

.cart-item-option {
    color: #888;
    font-size: 12px;
}

.cart-item-title {
    font-weight: 400;
    font-size: 13px;
}

.cart-item-price {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-brown);
    margin: 0 0 5px 0;
    white-space: nowrap;
}

/* Стили для пустой корзины */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    text-align: center;
}

.empty-cart img {
    width: 120px;
    margin-bottom: 10px;
}

.empty-cart p {
    font-size: 14px;
    font-weight: 500;
    margin: 5px 0;
}

.empty-cart a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
}

.empty-cart a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .restaurant-page {
        flex-direction: column;
        gap: 0;
        margin-top: 10px;
    }

    .menu-sidebar .menu-categories,
    .menu-sidebar .back-link {
        display: none;
    }

    .cart {
        display: none !important;
    }

    .menu-sidebar {
        width: 100%;
        order: 1;
        margin-bottom: 12px;
        background: none;
        box-shadow: none;
        border: none;
        padding: 0;
        font-size: 16px;
    }

    .menu-categories.mobile-categories {
        display: flex;
    }

    .menu-categories {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        overflow-x: auto;
        background: var(--color-card-bg);
        border-radius: 10px;
        margin: 0 0 16px 0;
        padding: 10px 0;
    }

    .menu-categories p {
        display: none;
    }

    .menu-categories ul {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 8px;
        margin: 0;
        scrollbar-width: thin;
        align-items: center;
    }
    
    .menu-categories ul::-webkit-scrollbar {
        display: none;
    }

    .menu-categories ul {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .menu-categories a {
        display: inline-block;
        width: auto;
        height: auto;
        white-space: nowrap;
        min-width: 60px;
        padding: 8px 14px;
        flex-shrink: 0;
        text-align: center;
        border-radius: 8px;
        text-decoration: none;
        color: var(--color-text);
    }

    .menu-items {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
    }
    
    .menu-item {
        max-width: 150px;
        border-radius: 10px;
    }

    .menu-item-name {
        font-size: 14px;
    }

    .menu-item-price {
        font-size: 16px;
    }

    .menu-item button {
        font-size: 14px;
        width: 120px;
        height: 40px;
        padding: 0;
        border-radius: 5px;
    }

    .restaurant-banner-container {
        margin: 0 0 12px 0;
        padding: 0;
        max-width: none;
    }

    .restaurant-banner-img {
        width: 95vw;
        max-width: 100vw;
        height: auto;
        min-height: 150px;
        aspect-ratio: 16/6;
        border-radius: 0;
        object-fit: cover;
        border-radius: 10px;
    }

    .restaurant-main {
        flex: unset;
        width: 100%;
        padding: 0;
    }
}