:root {
    --bg: #06070B;
    --fg: #e9f9f9;
    --accent: #00c8c8;
    --card-bg: #090A0E;
    --border: #0E0F13;
    font-family: "Inter", sans-serif;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    scrollbar-width: none;
}

header, footer {
    justify-content: center;
}

header .container {
    display:grid;
    grid-template-rows: auto;
    grid-template-areas:
    ". title admin"
}

header h1 {
    grid-area: title;
    align-items:center;
    display:flex;
    justify-self: center;
    justify-content:center;
    letter-spacing: .15em;
    font-weight: 600;
}

header .container .close{
    grid-area: admin;
    justify-self:end;
}

main { padding-bottom: 88px; }


.grid {
    padding: 16px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color .15s;
}
.card:hover, .tea_cart:hover { border-color: var(--accent); }

.card img, .tea_card img {
    grid-area: img;
    width: 100px; height: 100px; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px;
    justify-self: center;
}
.card .title, .tea_card .title {
    grid-area: title;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    margin-top: 10px;
}

.tea_grid {
    padding: 1rem;
    display: grid;
    grid-gap: 1rem;
    grid-row: auto;
    /*gap: 3rem;*/
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.tea_card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding-top: 1em;
    padding-bottom: 1em;
    display: grid;
    grid-template-areas:
    "img"
    "title"
    "price"
    "manage";
    flex-direction: column;
    align-items: center;
    gap: .8em;
    cursor: pointer;
    transition: border-color .15s;
    justify-content: center;
}

.price_add {
    grid-area: price;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price_add .price {
    color: #7EB4B5;
    font-weight: 600;
    font-size: 16px;
    
}

.to_cart {
    cursor: pointer;
    background: #081716;
    border-radius: 5px;
    border: none;
    color: #7EB4B5;
    /*font-weight: 600;*/
    /*font-size: 16px;*/
    /*right: 0;*/
}

.price_add .to_cart {
    height: 3em;
    width: 5em;
    font-weight: 600;
    font-size: 16px;
    right: 0;
}

.tea_card .add {
    grid-area: manage;
    cursor: pointer;
    background: #081716;
    height: 3em;
    width: 8em;
    border-radius: 5px;
    border: none;
    color: #7EB4B5;
    font-weight: 600;
    font-size: 16px;
    right: 0;
}

.category-list {
    display: flex;
    align-items: center;
    gap: 2vw;
    margin-left: 1rem;
    height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.category-list .category {
    display: flex;
    order: 1;
    align-items: center;
    background: #0F1014;
    border-radius: 20px;
    height: 100%;
    white-space: nowrap;
    cursor: pointer;
}
.category-list .category p {
    width: 100%;
    padding-left: 1em;
    padding-right: 1em;
}

.category-list .category-active {
    display: flex;
    order: 0;
    background: #0B2524;
    align-items: center;
    border-radius: 20px;
    height: 100%;
    white-space: nowrap;
    cursor: pointer;
}
.category-list .category-active p {
    width: 100%;
    padding-left: 1em;
    padding-right: 1em;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;


    background-color: rgba(0, 0, 0, 0.4);  /* bg-black/40 */

    /* backdrop-blur-sm ≈ blur(4 px) */
    backdrop-filter: blur(4px);
    z-index: 40;
}

.modal-sheet {
    display: grid;
    position: fixed;
    /*flex-direction: column;*/
    /*align-items: center;*/
    /*gap: 1rem;*/
    background-color: #090A0E;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;

    width: 100%;
    height: 60%;
    bottom: 0;

    box-shadow:
            0 20px 25px -5px rgba(0, 0, 0, 0.10),
            0  8px 10px -6px rgba(0, 0, 0, 0.10);
    /* стартовый сдвиг вниз — лист невиден */
    transform: translateY(100%);

    /* анимация */
    transition-property: transform;
    transition-duration: 300ms;
    transition-timing-function: ease-out;
    z-index: 50;

    grid-template-rows: auto;
    grid-template-areas:
    "img close"
    "img title"
    "img description"
    "img description"
    "img description"
    "desc-cat description"
    "desc-cat description"
    "desc-cat description"
    "desc-cat description"
    "desc-cat price"
    "add add";
}

.modal-sheet.open { transform: translateY(0); }

.close {
    grid-area: close;
    width: 25px;
    height: 25px;
    justify-self: end;

    margin-top: 2vh;
    margin-right: 4vw;
    /*margin-bottom: 0vh;*/
}

.modal-sheet img,
.editor .preview {
    grid-area: img;
    width: 200px; height: 200px;

    margin: 2vh 2vw;
}

.modal-sheet .title {
    grid-area: title;
    justify-self: center;
    align-self: center;

    margin-top: 1vh;
    margin-bottom: 1vh;

    /*margin-right: 4vw;*/
    /*margin-left: 4vw;*/

    font-size: 25px;
}

.modal-sheet .description {
    grid-area: description;

    justify-self: end;
    margin: 1vh 4vw;

    font-size: 18px;
}

.modal-sheet .description-cat{
    grid-area: desc-cat;

    margin: 0 1rem;
    align-self: start;
    justify-self: start;
    font-size: 18px;
}

.modal-sheet .price {
    grid-area: price;

    justify-self: end;
    margin: 1vh 4vw;

    font-size: 18px;
}

.button_color {
    border: none;
    background: #081716;
    color: #7EB4B5;
}

.modal-sheet .add,
.modal-sheet .to_cart {
    grid-area: add;
    justify-self: center;
    align-self: center;

    border-radius: 15px;
    /*height: 70px;*/
    margin-top: 1%;
    margin-bottom: 1%;
    height: 8vh;
    width: 95%;
    border: none;

    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.cart_elem {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 15px;

    display: grid;
    column-gap: .75rem;

    align-items: center;
    grid-template-areas:
    "checkbox img title close"
    ". img . ."
    ". manage . price";

    margin: 2vh 2vw;
    padding: 1vh 2vw;
}

.cart_elem .checkbox {
    grid-area: checkbox;

    width: 25px;
    height: 25px;
}

.cart_elem input.checkbox {
    /* отключаем нативный рендер */
    -webkit-appearance: none;
    appearance: none;

    width: 1.6rem;
    height: 1.6rem;
    background-color: #081716;
    border: 2px solid #0E0F13;
    border-radius: 0.25rem;
    position: relative;
    cursor: pointer;
}

.cart_elem input.checkbox:checked::after {
    content: "";
    position: absolute;
    top: 0.18rem;
    left: 0.5rem;
    width: 0.4rem;
    height: 0.8rem;
    border: solid #7EB4B5;
    border-width: 0 0.15rem 0.15rem 0;
    transform: rotate(45deg);
}

.cart_elem img,
.cart_elem .manage_weight,
.cart_elem .title,
.cart_elem .price {
    margin: 0.5rem .75rem;
}

.cart_elem img {
    grid-area: img;
    width: 100px;
    height: 100px;

    justify-self: center;
}

.manage_weight {
    grid-area: manage;

    display: flex;
    align-self: center;
    justify-self: center;
    justify-content: space-around;
}

.cart_elem .title {
    grid-area: title;

    font-size: 25px;
    font-weight: 500;

}

.cart_elem .price {
    grid-area: price;

    justify-self: end;
    font-size: 18px;

}

.cart_elem .close {
    margin-right: 1rem;

    /*grid-area: close;*/
    /*justify-self: end;*/
    /*@apply --close_btn;*/
}


.cart_elem button {

    right: 1vh;
}

.manage_weight .append {
    justify-self: right;
    align-self: center;

    height: 2.5em;
    width: 2.5em;

    border-radius: 3px;

    font-weight: 600;

    /*right: 1vh;*/
}

.cart_elem .manage_weight .weight {
    justify-self: center;
    align-self: center;
    font-size: 16px;
    font-weight: 600;
    margin: 0 2vw;
}

.manage_weight .subtract {
    justify-self: left;
    align-self: center;

    height: 2.5em;
    width: 2.5em;

    border: none;
    border-radius: 3px;
    background: #081716;
    color: #7EB4B5;

    font-weight: 600;

    /*right: 1vh;*/
}

.manage_weight .weight {
  align-content: center;
  margin-left: 1em;
  margin-right: 1em;
}

.cart .order {
    position: fixed;
    bottom: 80px; left: 0; right: 0;
    margin: 0 3% 3% 3%;

    border-radius: 15px;
    z-index: 10;
    height: 70px;
/
    cursor: pointer;

    font-weight: 600;
    font-size: 20px;
}

footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #090A0E; border-top: 1px solid #141518;
    justify-content: center;
    margin: 0 3% 3% 3%;
    border-radius: 15px;
    z-index: 10;
    height: 70px;
}
footer navigate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    margin-left: 5%; margin-right: 5%;
}
footer navigate button {
    background: none; border: none; color: var(--fg);
    font-size: 24px; cursor: pointer; padding: 8px 16px;
    left: 250pc; right: 250pc;
}

.make-order {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem;
}

.make-order .back {
    /*display: flex;*/
    align-content: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 30px;
    border-radius: 5px;
    margin-top: .2rem;
}

.make-order label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.make-order input,
.make-order textarea {
    margin-top: .2rem;
    padding: .6rem .8rem;
    border-radius: .5rem;
    border: 1px solid #141518;
    background: #0F1116;
    color: var(--fg);
}

.make-order .error {
    color: #ff6969;
    font-size: 12px;
}

.pay-button {
    padding: .9rem;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    transition: opacity .2s;
}

.pay-button.inactive {
    background: #2a2a2a;
    color: #5a5a5a;
    cursor: not-allowed;
    opacity: .6;
}

.pay-button.active {
    background: #081716;
    color: #7EB4B5;
    cursor: pointer;
}

.admin-top .home {
  position: fixed;
  right: 20px;
}

.new_cat,
.new_tea {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.new_cat .plus,
.new_tea .plus  {
    font-size: 80px;
    font-weight: 800;
}
.new_cat label ,
.new_tea label {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.editor {
    margin-left: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: right;
    /*align-content: ;*/
}

.editor .danger {
    margin: 1rem;
    height: 2rem;
}
.editor .save {
    margin: 1rem;
    height: 2rem;
}

.burger     { cursor: pointer; position:fixed; top:8px; left:8px; font-size:28px; background:none; border:none; color:var(--fg); z-index:60 }
.sidebar    { position:fixed; left:-240px; top:0; bottom:0; width:200px; background:#0e0f13; transition:.3s; padding:16px; display:flex; flex-direction:column; gap:8px; z-index:55 }
.sidebar.open { left:0 }
.sidebar button.active { background:#081716; }
.sidebar_btn {
  height: 2rem;
  font-size: 18px;
}

.admin-main { margin-left:0; transition:.3s }
.admin-main .grid {
    margin-left: 2rem;
    padding: 2rem 1rem 1rem 1rem;
    display: grid;
    grid-gap: 1rem;
    grid-row: auto;
    /*gap: 3rem;*/
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.sidebar.open + .admin-main{ margin-left:200px }

.admin-page   { display:flex; gap:24px }
.admin-page .list { min-width:260px }
.admin-page .row  { display:flex; align-items:center; gap:8px; cursor:pointer; padding:4px 0 }
.admin-page .editor label { display:block; margin:8px 0 }
.admin-page .editor input, .editor textarea, .editor select { width:100%; }

button.danger { background:#801010; color:#fff }


/* фон + блюр, ниже модалки */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 40;
}

/* контейнер модалки — поверх бэкдропа */
.modal-center {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;        /* ВЫШЕ, чем у backdrop */
    pointer-events: none; /* клики только по карточке */
}

/* карточка модалки — ещё на ступень выше и кликабельная */
.modal-card {
    pointer-events: auto;
    position: relative;
    z-index: 5001;        /* гарантированно над всем */
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 420px;
    width: calc(100% - 32px);
    padding: 20px;
    box-shadow:
            0 20px 25px -5px rgba(0,0,0,.25),
            0 8px 10px -6px rgba(0,0,0,.2);
}
