/* Переменные темы */
:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --primary-color: #bb86fc;
    --secondary-color: #03dac6;
    --surface-color: #1e1e1e;
    --error-color: #cf6679;
    --link-color: #face8d;
    --font-family: 'Roboto', Arial, sans-serif;
}

* {
    box-sizing: border-box !important;
    touch-action: manipulation !important;
    -ms-touch-action: manipulation !important;
}

/* ===== Scrollbar CSS ===== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #face8d #1e1e1e;
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
    width: 16px;
}

*::-webkit-scrollbar-track {
    background: #1e1e1e;
}

*::-webkit-scrollbar-thumb {
    background-color: #face8d;
    border-radius: 10px;
    border: 8px solid #ffffff;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

body.light-theme {
    --bg-color: #fff;
    --text-color: #000;
    --surface-color: #f0f0f0;
    --link-color: #994bff;
}

body.dark-theme {
    --bg-color: #121212;
    --text-color: #fff;
    --surface-color: #1e1e1e;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.flex-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.flex-row-between {
    display: flex;
    justify-content: space-between;
}



.header {
    background-color: var(--surface-color);
    padding: 10px 0;
}

.logo {
    display: inline-block;
}

.object_logo {
    width: 150px;
}

.logo a {
    display: block;
    width: 100%;
    position: relative;
    cursor: pointer;
}

.logo a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wifi-password {
    text-align: center;
    /* margin-top: 10px; */
    font-size: 1em;
    color: var(--secondary-color);
    align-content: center;
}

.flex-row.wifi {
    font-size: 1em;
    color: var(--primary-color);
    align-content: center;
    border-bottom: 1px solid var(--link-color);
    margin-bottom: 3px;
}

.language-selector button,
.theme-toggle,
.cart-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    font-size: 1em;
    color: var(--text-color);
}

/* Cart */

.cart-button {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
}

#cart-count-bottom {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
}

.add-to-cart {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

.add-to-cart svg {
    width: 16px;
    height: 16px;
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
}

.add-to-cart:hover {
    background-color: rgba(255, 255, 255, 0.20);
}

/* Стили для модального окна корзины */



.cart-item {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--surface-color);
}

#cartItems {
    max-height: 500px;
    overflow: auto;
}

#h2-cart {
    margin: 5px 0 10px 0;
    border-bottom: 2px solid var(--surface-color);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.quantity-control button {
    background-color: var(--surface-color);
    border: none;
    color: var(--text-color);
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.quantity-control button:hover {
    background-color: var(--primary-color);
}

.item-quantity {
    margin: 0 10px;
    font-weight: bold;
}

.cart-item-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.cart-item-remove:hover {
    color: var(--primary-color);
}

#cartSummary {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--surface-color);
    font-weight: bold;
}

#cartSummary div {
    margin-bottom: 10px;
}

.category-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    overflow-x: auto;
    background-color: var(--surface-color);
    padding: 5px 0;
    scrollbar-width: none;
    /* Firefox */
}

.category-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--surface-color);
}

.category-link {
    flex: 0 0 auto;
    margin-right: 15px;
    padding-bottom: 5px;
    font-size: 1em;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s, color 0.3s;
}


/* Bottom navigation bar */
.bottom-nav {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    right: 0;
    height: 60px;
    width: 250px;
    border-radius: 50px;
    background-color: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--bg-color);
    z-index: 99999;
}

.bottom-nav button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    position: relative;
}

.bottom-nav svg {
    width: 22px;
    height: 22px;
}


/* Dropdown menu */
.dropdown-menu {
    display: none;
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    border: 1px solid var(--link-color);
    border-radius: 5px;
    padding: 10px;
    z-index: 99999;
}

.dropdown-menu p {
    margin: 5px 0;
}

.language-option {
    display: block;
    background: none;
    border: none;
    padding: 5px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    color: var(--text-color);
}

.language-option:hover {
    background-color: var(--surface-color);
}

.category-nav::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari и Opera */
}

.category-link {
    flex: 0 0 auto;
    margin-right: 10px;
    padding: 5px 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 5px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.category-link.active {
    color: var(--link-color);
}

.category-link:hover {
    background-color: rgba(255, 255, 255, 0.20);
    color: var(--link-color);
    ;
}

.search-bar {
    display: flex;
    margin: 20px 0;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    font-size: 1em;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--surface-color);
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-color);
    padding: 0 10px;
}

.category-title {
    font-size: 1.5em;
    margin: 20px 0 10px;
}

.subcategory-title {
    font-size: 1.2em;
    margin: 15px 0 10px;
}

#menu {
    margin-bottom: 100px;
}

.menu-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.menu-item {
    width: calc(33.333% - 20px);
    background-color: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s;
}

.menu-item:hover {
    transform: scale(1.02);
}

.menu-item img {
    width: 100%;
    height: auto;
}

.menu-item-content {
    padding: 10px;
}

.menu-item-title {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.menu-item-description {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.menu-item-weight,
.menu-item-price {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.menu-item-title {
    font-size: 1.1em;
    cursor: pointer;
}


.menu-item-image {
    width: 100%;
    height: auto;
    cursor: pointer;
}

.menu-item-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
}

.menu-item-price {
    font-weight: bold;
    color: var(--primary-color);
}


.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
    overflow: hidden;
}

.modal-content {
    background-color: var(--bg-color);
    margin: 8% auto;
    padding: 15px;
    border: 1px solid #004467a6;
    width: 80%;
    max-width: 500px;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s;
}

.close {
    color: var(--text-color);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.checkout-button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    font-size: 1em;
    margin-top: 20px;
}

.checkout-button:hover {
    background-color: var(--secondary-color);
}

#backToTop {
    display: none;
    z-index: 99999;
    width: 35px;
    height: 35px;
    position: fixed;
    bottom: 35px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--surface-color);
    border: none;
    padding: 10px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 50%;
}

.notification {
    position: fixed;
    max-width: 400px;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 99999;
}

@media (max-width: 768px) {
    .menu-item {
        width: calc(50% - 20px);
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 80%;
    }

    #cartItems {
        max-height: 375px;
        overflow: auto;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item img {
        width: 50px;
        height: 50px;
    }

    .cart-item-details {
        width: calc(100% - 65px);
    }

    .quantity-control {
        margin-top: 5px;
    }

    #cartItems::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 480px) {
    .menu-item {
        width: 100%;
    }

    #cart-count-bottom {
        right: 5px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}