
:root {
    --b: #158afe;
    --blue: #3d2f2f;
    --default: #3d2f2f;
    --red: #fc221a;
    --button: #38e516;
    --cart: #3d2f2fa6;
    --cart-hover: #3d2f2ffa;
}


body, html {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100%;
    white-space: wrap;
    font-family: slavicFont;
    scroll-behavior: smooth;
    word-break: break-word;

}


body.modal-open {
    overflow: hidden;
}

@font-face {
  font-family: slavicFont;
  src: url(./slavic.otf);
}

header {
    background-color: var(--blue);
    color: white;
    text-align: center;
    font-size: 1.2em;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
/*    padding: 10px 20px;*/
    font-family: slavicFont;
}

#settings {
    justify-content: space-evenly;    
}

.logo {
    display: flex;
    align-items: center;
}
.logo img {
    height: 100px;
    margin-right: 10px;
    margin-top: 10px;
    margin-bottom: -35px;
    z-index: 5;
}
.logo img:hover {
    transform: scale(1.1);
}

header h1 {
    font-size: 28px;
    color: #fff;
}

nav a {
    margin: 0 15px;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

a {
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

::-webkit-scrollbar {
    width: 0.5em;
    height: 0.5em;

}

::-webkit-scrollbar-track {
    background: #ccc;
}

::-webkit-scrollbar-thumb {
    background: #3d2f2f;
    border-radius: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
#category-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}


#menu-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}




.menu-item {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 5px 5px rgba(0, 0, 0, 0.1);
    width: 30vh;
    text-align: center;
    max-width: 150px;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-wrap: nowrap;
    align-items: stretch;
    transition: transform 0.3s, box-shadow 0.3s;
}

.menu-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.menu-item p {
    margin: 2px;
}

.menu-item h3 {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 5px;
    font-weight: bold;
    font-size: 3.0vh;
    margin: 5px;
}


.menu-item img {
    max-width: 100%;
    border-radius: 5px;
}

#add-item {
    padding: 1vh 0vh;
    font-size: 7vh;
    z-index: 4;
}
.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s, transform 0.3s;
}
.floating-button:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

button {
    cursor: pointer;
    background-color: var(--button);
    border: none;
    border-radius: 5px;
    padding: 10px;
    color: #fff;
    margin: 5px;
}

.deleteButton, #cancel-edit, #cancel-category {
    background-color: var(--red);
}

.addButton {
    background-color: var(--b);
}


.category {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 10px;
}
.category h2 {
    padding: 5px;
    border-radius: 5px;
    color: #fff;
    background-color: var(--default);
    width: 100%;
    font-weight: bold;
    margin: 0;
    margin-top: 5px;
}
.category-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    width: calc(33.333% - 40px); /* Три категории в ряд */
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}
.category-item h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
    cursor: pointer;
    word-break: break-word;
}
.category-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.category-item button {
    display: block;
    margin: 5px auto;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.buttons {
    display: flex;
}

.icon-img {
    width: 4vh;
    height: 4vh;
    padding: 0;
    margin: 0;
}

.icon-img:hover {
    transform: scale(1.1);
}

.flexing {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: stretch;
    align-content: flex-end;
    gap: 10px;
    padding: 5px;
}
.flexing input {
/*    width: 40vh;*/
    padding: 5px 10px;
    width: 50%;
}
.flexing textarea {
    padding: 5px 10px;
    width: 50%;    
}
.flexing label, label {
    background-color: var(--default);
    color: #fff;
    width: 100%;
    padding: 5px;
}

.flexing select {
    padding: 10px;
    font-weight: bold;
    width: 100%;
}

#web-working {
    font-weight: bolder;
}

#sort {
    padding: 5px 10px;
    background: var(--blue);
    color: #fff;
    border: 1px solid #fff;
    font-size: 2.5vh;
    cursor: pointer;
    margin-right: 10px;
    min-width: 130px;
}

.sort-container {
    width: 100%;
    background: var(--blue);
    display: flex;
    flex-direction: row-reverse;
    align-items: stretch;
    margin: 5px 0;
    padding: 10px 0;
    justify-content: space-evenly;
    position: relative;
    transition: position 0.3s ease, top 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Тень для красоты */
    z-index: 3;   /* Убедиться, что бар над другим контентом */
}
.sort-container.fixed {
    position: fixed; /* Становится фиксированным при прокрутке */
    top: 0;
    left: 0;
    width: 100%;
}

#search-input {
    width: 50%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.switch {
    background: #bdbdbd;
    width: 60px;
    height: 30px;
    border-radius: 50px;
    box-sizing: border-box;
    display: block;
    cursor: pointer;
    padding: 2px;
}
.switch.checked {
    background: #3498db;
}
.switch.checked #knob {
    transform: translateX(25px);
    background: #fff;
}
#knob {
    border-radius: 50px;
    background: rgb(247 246 246);
    width: 25px;
    height: 25px;
    transition: all 0.3s ease-out;
}

#navbar {
    text-align: right;
    margin-right: 15vh;    
}

.description {
    white-space: nowrap;
    overflow: hidden;
    padding: 5px;
    text-overflow: ellipsis;
}

.description.checked {
    white-space: wrap;
    overflow: auto;
}

#add-category {
    font-weight: bold;
}

#back-button {
    background-color: var(--default);
    font-size: x-large;
    top: 0;
    right: 0;
    position: absolute;
    margin: 23px;
    z-index: 5;
}

#items-sum {
    padding: 10px;
    color: #fff;
    margin: 0;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 11; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}


.modal-content {
    display: flex;
    background-color: #fff;
    color: black;
    gap: 5px;

    margin: 10% auto;
    padding-top: 10px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow);
    width: 80%;
    animation: fadeIn 0.3s ease-in-out;
    font-size: 19px;
    align-items: normal;
    flex-direction: column;
}
.modal-content h2 {
    text-align: center;
}
.modal-content label {
    font-weight: bold;
    text-align: center;
}
.modal-content button {
    font-weight: bold;
}

.close-modal {
    float: right;
    color: #aaa;
    cursor: pointer;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: -10vh;
    transition: color 0.3s;
    align-self: flex-end;
    margin-top: -5px;
    z-index: 2;
}
.close-modal:hover {
    color: #333;
}


.red-button {
    background-color: var(--red);
}

@media (max-width: 768px) {
    .category-item {
        width: calc(50% - 20px); /* Две категории в ряд */
    }

    .category-item button {
        padding: 5px 10px;
    }
    .icon-img {
        width: 3vh;
        height: 3vh;
    }
    .menu-item {
        font-size: 0.9rem;
    }
    header {
        flex-direction: column;
        text-align: center;
    }

    .logo img {
        width: 100px; /* уменьшите ширину */
        margin: 0 auto; /* центрирование */
        display: block;
        position: relative;
        z-index: 9;
    }

    .logo {
        text-align: center; /* выравнивание по центру */
/*        padding: 10px; /* добавьте отступы */*/
    }

    nav a {
        font-size: 0.9rem;
        margin: 5px;
    }

    #navbar {
        font-size: larger;
        margin-right: 0;
    }

    #cart-button {
        right: 10px;
        bottom: 10px;
    }
    #sort {
        min-width: 130px;
    }
}

@media (max-width: 480px) {
    .category-item {
        width: calc(50% - 20px); /* Две категории в ряд */
    }
    .category-item button {
        padding: 5px 10px;
    }

    .modal {
        width: 100%;
    }
    .logo {
        margin: 10px 0;
    }
    #item-image {
        max-width: 90%;
        max-height: 90%;
        border: 1px solid #00000026;
        border-radius: 10px;
    }
    #sort {
        width: 130px;
    }
    #back-button {
        margin: 10px;
        position: absolute;
        z-index: 5;
        top: 0;
        right: 0;
    }

}