* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

@font-face  {
    font-family: "Inter";
    src: url("https://fonts.googleapis.com/css2?family=Inter&display=swap"), format("woff2");
    font-display: swap;
    font-weight: 100;
}

/* ————————————— variables ————————————— */
:root {
  --width-main-content: 53;

  --text-color-RGB: 50, 50, 50;
  --text-color-inverse-RGB: 255, 255, 255;
  --link-color-RGB: 0, 100, 255;
  --hover-color-RGB: 0, 215, 100; 
  --background-color-RGB: 255, 255, 255; 
  --surface-color-RGB: 240, 240, 240; 
  --product-done-color-RGB: 50, 160, 90;
  --product-hover-color-RGB: 220, 220, 225;
  --product-select-color-RGB: 139, 139, 139;
}

.vertical-space.S {
  height: 1em;
  
  @media (max-width: 768px) {
    height: 0.5em;  
  }
}

.vertical-space.M {
  height: 2em;

  @media (max-width: 768px) {
    height: 3em;    
  }
}

.vertical-space.L {
  height: 6em;
  @media (max-width: 768px) {
    height: 6em;    
  }
}

.vertical-space.XL {
  height: 9em;
  @media (max-width: 768px) {
    height: 4em;    
  }
}

.text-width {
  width: 70%;
  
  @media (max-width: 768px) {
    width: 100%;
  }
}

/* ————————————— ganeral tag ————————————— */

html {  
  font-size: 18px;

  @media (max-width: 768px) {
    font-size: 13px;
  }  

  /* --mobile-viewport-min: 320;
  --mobile-desktop-breakpoint: 768;
  --desktop-viewport-max: 1500;

  --mobile-font-size-min: 14;
  --mobile-font-size-max: 32;

  --desktop-font-size-min: 12.5;
  --desktop-font-size-max: 24;

  font-size: calc(var(--mobile-font-size-min) * 1px);

  @media screen and (min-width: 320px) {    
  font-size: calc(var(--mobile-font-size-min) * 1px + (var(--mobile-font-size-max) - var(--mobile-font-size-min)) * ((100vw - var(--mobile-viewport-min) * 1px) / (var(--mobile-desktop-breakpoint) - var(--mobile-viewport-min))));
  }

  @media screen and (min-width: 768px) {    
  font-size: calc(var(--desktop-font-size-min) * 1px + (var(--desktop-font-size-max) - var(--desktop-font-size-min)) * ((100vw - var(--mobile-desktop-breakpoint) * 1px) / (var(--desktop-viewport-max) - var(--mobile-desktop-breakpoint))));
  }

  @media screen and (min-width: 1500px) {    
  font-size: calc(var(--desktop-font-size-max) * 1px);
  } */

}

body {
  font-family: "Inter";
  margin: 0;
  color: rgba(var(--text-color-RGB),1);
  background-color: rgba(var(--background-color-RGB), 1);
}

/* iOS приближает экран при фокусе на поле со шрифтом меньше 16px.
   !important — чтобы перебить font-size у вложенных правил полей */
@media (pointer: coarse) {
  input,
  textarea,
  select {
    font-size: max(16px, 1em) !important;
  }
}

img {
  display: block;
  width: 100%;
}

p {
  margin: 0;
}

h1 {
  font-size: 3.5em;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 90%
}

h3 {
  font-size: 2.5em;
  margin: 0em 0 0.5em;
  font-weight: 500;
}

h4 {
  font-size: 1.8em;
  margin: 0 0 1em;
  font-weight: 500;
}

a {
  color: rgba(var(--link-color-RGB),1);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  text-decoration-color: rgba(var(--link-color-RGB),0.3);

  transition: color 0.5s ease, text-decoration-color 0.5s ease;
}

a:hover {
  color: rgba(var(--hover-color-RGB),1);
  text-decoration-color: rgba(var(--hover-color-RGB),0.3);

  transition: color 0s ease, text-decoration-color 0s ease;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

.login-button {
  padding: 0.4em 1em;
  border-radius: 0.5em;
  color: rgba(var(--text-color-inverse-RGB), 1);
  background-color: rgba(var(--link-color-RGB), 1);

}

& .login-button:hover {
  background-color: rgba(var(--text-color-RGB), 1);
} 

/* ————————————— item ————————————— */

.topbar {
  position: sticky;
  /* top: 0; */
  display: flex;
  justify-content: space-between;
  z-index: 2;

  font-size: 1.4em;
  
  padding: 0.5em 1em;

  font-weight: 300;
  letter-spacing: 0.013em;
  
  background-color: rgba(var(--background-color-RGB), 1);
  
  
  & > div:first-child {
    white-space: nowrap;
    flex-shrink: 0;
    width: 40%;
    @media (max-width: 768px) {
      width: auto;
    }
  }

  & .admin-bar-menu {
    min-width: 0;
    overflow: hidden;

    flex-wrap: nowrap;

    & > * {
      flex-shrink: 0;
    }

    @media (max-width: 768px) {
      display: none;
    }
  }

  & .burger-toggle {
    all: unset;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 0.3em;
    width: 1.8em;
    height: 1.8em;
    flex-shrink: 0;
    /* Бургер есть только у авторизованных (см. topbar) — показываем всегда */
    display: flex;

    & span {
      display: block;
      height: 2px;
      border-radius: 1px;
      background-color: rgba(var(--text-color-RGB), 1);
    }
  }

  & .admin-bar-overflow {
    display: none;

    position: absolute;
    top: 100%;
    right: 0.5em;
    z-index: 10;

    flex-direction: column;
    align-items: flex-start;
    gap: 0.6em;
    width: 30rem;
    padding: 0.5em;
    border-radius: 0.5em;

    background-color: rgba(var(--background-color-RGB), 1);
    box-shadow: 0 0 1em #0000001a;

    @media (max-width: 768px) {
      width: auto;
      left: 0.5em;
      right: 0.5em;
    }

    & .admin-bar-overflow-items {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.6em;
    }
  }

  &.menu-open .admin-bar-overflow {
    display: flex;
  }

  & .select-wrapper {
    position: relative;
    display: inline-block;

    &::after {
      content: '⌄';
      position: absolute;
      top: 50%;
      left: 0.3em;
      transform: translateY(-65%);
      font-size: 1.3em;
      line-height: 1;
      color: rgba(var(--text-color-inverse-RGB), 1);
      pointer-events: none;
    }
  }

  & .persona-toggle {
    all: unset;
    cursor: pointer;
    box-sizing: border-box;

    font-size: 1em;
    font-weight: 300;
    padding: 0.1em 0.5em 0.1em 1.7em;
    border-radius: 1em;
    color: rgba(var(--text-color-inverse-RGB), 1);
    background-color: rgba(var(--link-color-RGB), 1);

    &:focus-visible {
      outline: 2px solid rgba(var(--text-color-RGB), 1);
      outline-offset: 2px;
    }
  }

  & .select-wrapper.is-open::after {
    transform: translateY(-35%) rotate(180deg);
  }

  & .persona-list {
    /* fixed: the header's overflow:hidden must not clip it; JS sets top/left/min-width */
    position: fixed;
    z-index: 20;
    margin: 0;
    padding: 0.3em;
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 0.8em;

    background-color: rgba(var(--background-color-RGB), 1);
    box-shadow: 0 0 1em #0000001a;

    &[hidden] {
      display: none;
    }

    & li {
      display: block;
    }

    & [role="option"] {
      all: unset;
      display: block;
      box-sizing: border-box;
      width: 100%;
      cursor: pointer;
      white-space: nowrap;
      font-weight: 300;
      padding: 0.2em 0.8em;
      border-radius: 0.6em;

      &:hover,
      &:focus-visible {
        color: rgba(var(--text-color-inverse-RGB), 1);
        background-color: rgba(var(--link-color-RGB), 1);
      }

      &[aria-selected="true"] {
        font-weight: 600;
      }
    }
  }


  & div {
    display: flex;
    align-items: center;
    gap: 1em;
  }

  & a {
    text-decoration: none;
  }

  & svg, img {
    width: 2.3em;
    @media (max-width: 768px) {
      width: 3em;
    }
  }

  & .nav-pages {
    --columns: 2;
    --gap: 0.05em;
    & a {
      padding: 0.4em 3em 2em 0.4em;
    }
  }
}

.nav-pages {
  display: flex;
  flex-wrap: wrap;

  --gap: 0.5em;
  --columns: 3;
  --gap-number: calc(var(--columns) - 1);

  gap: var(--gap);

  @media (max-width: 768px) {
    --columns: 2;
  }

  @media (min-width: 1000px) {
    --columns: 4;
  }

  @media (min-width: 1920px) {
    --columns: 5;
  }

  & a {
    width: calc((100% - var(--gap-number) * var(--gap)) / (var(--columns)));
    border-radius: 0.4em;
    padding: 0.4em 3em 4em 0.4em;

    text-decoration: none;
    color: rgba(var(--text-color-RGB), 1);
    background-color: rgba(var(--product-hover-color-RGB),0.4);
  }

  & a:not(.active):hover {
    background-color: rgba(var(--product-hover-color-RGB), 1);
    color: rgba(var(--hover-color-RGB),1);

    transition: background-color 0s ease, text-decoration-color 0s ease;
  }

  & .active {
    color: rgba(var(--text-color-inverse-RGB), 1);
    background-color: rgba(var(--text-color-RGB), 0.8);
  }
}

main header {
  position: relative;
  z-index: 0;
  font-size: 1em;
  display: block;
  font-weight: 400;
  letter-spacing: 0.01em;


  width: calc(var(--width-main-content) * 1%);
  margin: 0 auto;

  @media (max-width: 768px) {
    width: 100%;
    padding: 0 1em;
  }

  @media (max-width: 1300px) {
    width: 100%;
    padding: 0 1em;
  }
}

.page-of-table {
  --page-of-table-width: 100;
  /* Ширина nav и корзины при окне 1920px — шире они не растут,
     а лишнее место уходит в пустоту по бокам. rem вместо em, потому что
     у nav свой font-size (3rem = gap 3em при шрифте страницы). */
  --page-of-table-side-max: calc(
    (1920px * (100 - var(--width-main-content)) / 100 - 2 * 3rem) / 2
  );

  margin: auto;
  display: flex;
  justify-content: center;
  width: calc(var(--page-of-table-width) * 1%);
  gap: 3em;
  position: relative;

  @media (max-width: 768px) {
    width: 100%;
    padding: 0;
    margin: 0;

    display: block;
  }

  & nav {
    flex: 1 1 0;
    min-width: 0;
    max-width: var(--page-of-table-side-max);
    font-size: 0.9em;
    padding-left: 1em;

    @media (max-width: 768px) {
      max-width: none;
      position: sticky;
      top: 0;
      padding-top: 2em;
      padding-left: 0;
      /* display: none; */
      
      background-color: rgba(var(--background-color-RGB), 1);
      z-index: 1;
    }
  }

  & .content {
    flex: 0 0 calc(var(--width-main-content) / var(--page-of-table-width) * 100%);
    width: calc(var(--width-main-content) / var(--page-of-table-width) * 100%);

    @media (max-width: 768px) {
      width: 100%;
      padding: 0 1em;
    }
  }
  

  & .cart-panel {
    flex: 1 1 0;
    min-width: 0;
    max-width: var(--page-of-table-side-max);
    padding-right: 1em;

    @media (max-width: 768px) {
      max-width: none;
      position: fixed;
      bottom: 0;
      z-index: 10;
      width: 100%;

      padding: 0;
    }
  }
}

.page-of-table nav {
  & div {
    position: sticky;
    top: 2em;
    max-height: calc(100vh - 4em);
    overflow: hidden;

    @media (max-width: 768px) {
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: none;
      -ms-overflow-style: none;

      &::-webkit-scrollbar {
        display: none;
      }
    }
  }

  & ul {
    @media (max-width: 768px) {
      display: flex;
      flex-direction: row;
      padding: 0 1em 1em;
      width: fit-content;
      font-size: 1.2em;
    }
  }

  /* "родной" <li> с подразделом на мобилке всегда скрыт — после переноса
      JS-ом (см. script.js) он пустой; а если JS не выполнился — не показываем
      как есть, это фоллбэк */
  & ul.nav-section > li:has(> ul.nav-subsection) {
    @media (max-width: 768px) {
      display: none;
    }
  }

  /* мобилка: вторая строка — подразделы активного раздела, перенесённые
      сюда JS-ом; свой overflow-x, поэтому скроллится независимо от разделов */
  & .nav-subsection-row {
    display: none;

    @media (max-width: 768px) {
      display: block;
      /* overflow-x/overflow-y и скрытие скроллбара уже унаследованы от "& div"
          выше (.nav-subsection-row — тоже <div>) — тут только то, что отличается:
          обнуляем sticky/max-height, иначе вторая строка попытается прилипнуть
          на тот же top, что и первая, и окажется скрыта под ней */
      position: static;
      max-height: none;
    }

    & ul.nav-subsection {
      @media (max-width: 768px) {
        display: none;
      }
    }

    & ul.nav-subsection:has(li.nav-active) {
      @media (max-width: 768px) {
        display: flex;
      }
    }
  }

  & .nav-active {
    border-radius: 0.4em;
    background-color: rgba(var(--product-hover-color-RGB), 1);

    @media (max-width: 768px) {
      border-radius: 2em;
    }

    /* & a {
      color: rgba(var(--text-color-inverse-RGB),1);
    } */
  }


  & li {
    /* padding: 0 0 0 0.6em; */
    /* padding: 0 0 0 1em; */

    @media (max-width: 768px) {
      white-space: nowrap;
    }

  }

  & .nav-subsection {
    padding: 0 0 0 1em;

    @media (max-width: 768px) {
      padding: 0 1em 1em;
    }
  }

  & .nav-section {

    @media (max-width: 768px) {
      font-weight: 500;
    }
  }

  & a {
    color: rgba(var(--text-color-RGB),0.7);
    text-decoration: none;

    display: block;
    flex: 1;
    min-width: 0;
    border-radius: 0.4em;
    padding: 0.4em 0.7em 0.4em;
    margin: 0 0 0.1em;

    transition: background-color 0.5s ease, text-decoration-color 0.5s ease;

    @media (max-width: 768px) {
      border-radius: 1em;
      color: rgba(var(--text-color-RGB), 1);
    }
  }

  & a:hover {
    background-color: rgba(var(--product-hover-color-RGB), 0.4);
    transition: background-color 0s ease, text-decoration-color 0s ease;
  }

}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  /* margin-bottom: 1em; */
  margin: 0;
  padding: 0;

  --gap: 0.2em;
  --columns: 3;
  --gap-number: calc(var(--columns) - 1);

  gap: var(--gap);

  @media (max-width: 1300px) {
    --columns: 2;
  }

  @media (min-width: 1920px) {
    --columns: 4;
  }
  

  & li {
    font-size: 1.1em;
    position: relative;
    width: calc((100% - var(--gap-number) * var(--gap)) / (var(--columns)));
    padding: 0.4em;
    border-radius: 1.4em;

    transition: background-color 0.5s ease, text-decoration-color 0.5s ease;
  }

  & div {
    position: relative;

    & a {
      padding: 0;
      text-decoration: none;
    }
  }

  & img {
    height: 20svw;
    /* height: 45%; */
    object-fit: cover;
    border-radius: 1em;

    @media (max-width: 768px) {
      height: 60svw;    
    }

    @media (min-width: 769px) and (max-width: 1300px) {
      height: 35svw;    
    }

    @media (min-width: 1920px) {
      height: 16svw;    
    }
  }

  & .add-wishlist {
    all: unset;
    cursor: pointer;
    position: absolute;
    top: 0.4em;
    right: 0.4em;

    display: flex;
    align-items: center;
    border-radius: 2em;

    & svg {
      display: block;
      width: 2.5em;
      height: 2.5em;
      flex-shrink: 0;

      color: rgba(var(--text-color-inverse-RGB), 1);
    }

    &::after {
      content: '';
      white-space: nowrap;

      height: 2.5em;

      display: flex;
      align-items: center;
      justify-content: center;
    }
  }

  & li:not(.product-select) .add-wishlist:hover {
    background: rgba(var(--background-color-RGB), 1);
    padding: 0 0.8em 0 0;
  }
  
  & li:not(.product-select) .add-wishlist:hover::after {
    content: 'Выбрать';
  }
  
  & li.product-select .add-wishlist {
    background: rgba(var(--product-select-color-RGB), 1);
  }
  
  & li.product-select .add-wishlist svg {
    display: none;
  }
  
  & li.product-select .add-wishlist::after {
    content: 'Выбрано';
    padding: 0 0.8em;
    border-radius: 2em;

    background: rgba(var(--link-color-RGB), 1);


    & svg {
      color: rgba(var(--text-color-RGB),0.7);
    }
  }

  & li.product-select .add-wishlist:hover::after {
    content: 'Убрать';
  }

  & li.product-done .add-wishlist {
    background: rgba(var(--product-done-color-RGB), 1);
    cursor: default;
    pointer-events: none;
  }

  & li.product-done .add-wishlist svg {
    display: none;
  }

  & li.product-done .add-wishlist::after {
    content: 'Утверждено';
    padding: 0 0.8em;
  }

  & .comments {
    display: flex;
    flex-direction: column;
    gap: 0.3em;

    position: absolute;
    bottom: 0.6em;
    left: 0.6em;
    right: 0.6em;

    font-size: 0.9em;
    font-weight: 400;

    & .comments-list {
      display: flex;
      flex-direction: column;
      gap: 0.3em;

      & .comment {
        display: flex;
        align-items: flex-end;
        gap: 0.3em;
      }

      & p {
        font-size: 0.9em;
        color: rgba(var(--text-color-RGB), 1);
        margin: 0;
        min-width: 0;
        background-color: rgba(var(--background-color-RGB), 0.9);
        border-radius: 0.5em;
        padding: 0.3em 0.5em 0.4em 0.5em;

        overflow-wrap: break-word;
        word-break: break-word;
      }

      & .comment-author {
        display: block;
        /* font-size: 0.75em; */
        opacity: 0.6;
        font-style: italic;
      }
    }

    & .comments-form {
      display: flex;
      align-items: flex-end;
      gap: 0.3em;
    }

    & .comments-toggle,
    & .comments-send {
      all: unset;
      cursor: pointer;
      display: block;
      flex-shrink: 0;

      & svg {
        display: block;
        width: 2em;
        height: 2em;
      }
    }

    & .comments-send {
      display: none;
    }

    &:has(.comments-list:not(:empty)) .comments-toggle {
      display: none;
    }

    & textarea {
      font-size: 0.9em;
      all: unset;
      box-sizing: border-box;
      display: none;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      resize: none;

      overflow-wrap: break-word;
      word-break: break-word;

      color: rgba(var(--text-color-RGB), 1);
      background-color: rgba(var(--background-color-RGB), 0.9);
      border-radius: 1em;
      padding: 0.4em 0.8em;
    }

    &:hover textarea,
    &:focus-within textarea,
    &:has(textarea:not(:placeholder-shown)) textarea {
      display: block;
    }

    &:has(.comments-list:not(:empty)):hover .comments-toggle,
    &:has(.comments-list:not(:empty)):focus-within .comments-toggle,
    &:has(.comments-list:not(:empty)):has(textarea:not(:placeholder-shown)) .comments-toggle {
      display: block;
    }

    &:has(textarea:not(:placeholder-shown)) .comments-send {
      display: block;
    }
  }

  & hgroup {
    padding: 0.6em 0.8em 1em;

    @media (max-width: 768px) {
      padding: 0.6em 0.4em 0.6em;
    }

    & a {
      font-weight: 400;
      color: rgba(var(--text-color-RGB),1);
      text-decoration-color: rgba(var(--text-color-RGB),0.3);
    }

    & a:hover {
      color: rgba(var(--link-color-RGB),1);
      text-decoration-color: rgba(var(--link-color-RGB),0.3);
    }

    & .price {
      margin: 1em 0 0 0;
    }

    & .quantity {
      border: solid 1px rgba(var(--text-color-RGB),1);
      padding: 0.1em 0.6em;
      border-radius: 0.4em;
    }
  }

  & .product-done {
    background-color: rgba(var(--product-done-color-RGB), 1);
    color: rgba(var(--text-color-inverse-RGB), 1);

    & a {
      /* font-weight: 300; */
      color: rgba(var(--text-color-inverse-RGB), 1);
      text-decoration-color: rgba(var(--text-color-inverse-RGB),0.3);
    }
    
    & .quantity {
      border: solid 1px rgba(var(--text-color-inverse-RGB),1);
    }
  }

  & .product-select{
    background-color: rgba(var(--link-color-RGB), 1);
    color: rgba(var(--text-color-inverse-RGB), 1);

    & a {
      /* font-weight: 300; */
      color: rgba(var(--text-color-inverse-RGB), 1);
      text-decoration-color: rgba(var(--text-color-inverse-RGB),0.3);
    }
    
    & .quantity {
      border: solid 1px rgba(var(--text-color-inverse-RGB),1);
    }

    /* & p {
      background-color: rgba(var(--product-select-color-RGB), 1);
    } */

    & .comments-list {
      & p {
        color: rgba(var(--text-color-RGB), 1);
      }
    }
  }

  & li:not(.product-done, .product-select):hover {
    background-color: rgba(var(--product-hover-color-RGB), 0.4);

    transition: background-color 0s ease, text-decoration-color 0s ease;
  }
}

.cart-panel {
  
  padding: 2em 0 3em;
  
  display: flex;
  flex-direction: column;
  gap: 1.5em;

  position: sticky;
  height: 100vh;
  top: 0;

  @media (max-width: 768px) {
    display: block;
    top: auto;
    height: auto;
    padding: 0;
  }

  /* Мобилка: корзина на весь экран (кнопка «Корзина», класс ставит script.js).
     Списки идут одним потоком, скроллится вся панель, а не каждый список. */
  &.cart-open {
    @media (max-width: 768px) {
      top: 0;
      height: 100dvh;
      overflow-y: auto;
      /* Без боковых отступов у панели — иначе .cart-buttom сдвинется */
      padding: 2em 0 0;
      background-color: rgba(var(--background-color-RGB), 1);

      /* flex-колонка + margin-top: auto у .cart-buttom держат его внизу
         экрана, даже когда позиций мало */
      display: flex;
      flex-direction: column;

      & .cart-items-approved,
      & .cart-items-done {
        display: block;
        flex: none;
        padding: 0 1em;
        margin-bottom: 1.5em;
      }

      & .cart-items-approved ul,
      & .cart-items-done ul {
        overflow: visible;

        &::after {
          display: none;
        }
      }

      & .cart-buttom {
        margin-top: auto;
        position: sticky;
        bottom: 0;
      }
    }
  }

  & h1 {
    font-size: 1.3em;
    padding-bottom: 0.3em;

    @media (max-width: 768px) {
      font-size: 1.7em;
    }
  }
  
  & .cart-items-approved {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;

    @media (max-width: 768px) {
      display: none;
    }

    & ul {
      flex: 1 1 0;
      min-height: 0;
      overflow-y: auto;
      position: relative;

      &::after {
        content: '';
        display: block;
        position: sticky;
        bottom: 0;
        height: 5em;
        margin-top: -1.5em;
        background: linear-gradient(to bottom, rgba(var(--background-color-RGB), 0), rgba(var(--background-color-RGB), 1));
        pointer-events: none;
      }
    }

    & li {
      display: block;
      margin: 0 2em 1.5em 0;
    }

    & a {
      color: rgba(var(--product-done-color-RGB), 1);
    }
    & a:hover {
      color: rgba(var(--link-color-RGB), 1);
    }

  }

  & .cart-items-done {
    flex: 2 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;

    @media (max-width: 768px) {
      display: none;
    }
    & ul {
      flex: 1 1 0;
      min-height: 0;
      overflow-y: auto;
      position: relative;

      &::after {
        content: '';
        display: block;
        position: sticky;
        bottom: 0;
        height: 5em;
        margin-top: -1.5em;
        background: linear-gradient(to bottom, rgba(var(--background-color-RGB), 0), rgba(var(--background-color-RGB), 1));
        pointer-events: none;
      }
    }
  }
  
  
  & ul {
    font-size: 0.75em;  
    margin-top: 0.5em;

    @media (max-width: 768px) {
      font-size: 1.1em;
    }
  }
  
  & li {
    display: flex;
    justify-content: space-between;
    
    margin: 0 0.7em 1.5em 0;
    gap: 2em;
    border-radius: 0.4em;

    color: rgba(var(--text-color-RGB),0.7);

    & a{
      text-decoration: none;
      cursor: pointer;
      font-weight: 500;
    }

    & .price {
      color: rgba(var(--text-color-RGB), 1);
      font-weight: 600;
    }

    p {
      padding: 0.3em 0 0 0;
    }

    & div {
      display: block;
    }

    & button {
      background-color: rgba(var(--product-hover-color-RGB), 0.4);

      padding: 0.6em 1em;
      border-radius: 1.5em;
      height: fit-content;
    }

    & button:hover {
      color: rgba(var(--text-color-inverse-RGB),1);
      background-color: rgba(var(--text-color-RGB), 0.8);
    }
  }

  & .button-confirm,
  & .button-expand {
    font-weight: 300;
    font-size: 1.1em;
    letter-spacing: 0.013em;
    width: 100%;
    white-space: nowrap;
    padding: 1em;
    border-radius: 1em;
    color: rgba(var(--background-color-RGB), 1);
    background-color: rgba(var(--link-color-RGB),1);
  }

    & .button-confirm:hover,
    & .button-expand:hover {
    background-color: rgba(var(--text-color-RGB),1);
  }

  /* На мобилке «Подтвердить выбор» и «Корзина» стоят в одну строку */
  @media (max-width: 768px) {
    & .button-confirm {
      flex: 1 1 0;
      min-width: 0;
    }

    & .button-expand {
      flex: 0 0 auto;
      width: auto;
    }
  }

  & .cart-buttom {
    flex: 0 0 auto;

    color: rgba(var(--text-color-inverse-RGB), 1);
    font-size: 0.9em;
    font-weight: 300;
    border-radius: 1em 1em 0 0;
    background-color: rgba(var(--background-color-RGB), 1);

    padding: 0.4em 0.4em 1.3em;
    /* margin-bottom: -1em; */

    display: flex;
    flex-wrap: wrap;
    gap: 0.2em;

    @media (max-width: 768px) {
      font-size: 1em;
    }

    & p {
      width: calc(100% / 3 - 1%);
      /* white-space: nowrap; */
      display: block;
      font-size: 0.9em;

      padding: 0.4em 0.8em;
      border-radius: 1em;
      background-color: rgba(var(--text-color-RGB), 1);
      @media (max-width: 768px) {
        font-size: 1em;
      }
    }

    & span {
      /* width: 100%; */
      text-align: right;
    }

    & #sum-approved {
      background-color: rgba(var(--product-done-color-RGB), 1);
    }

    & #sum-done {
      background-color: rgba(var(--link-color-RGB), 1);
    }

    & #total {
      font-size: 1.2em;
      width: 100%;
      text-align: center;
      color: rgba(var(--text-color-RGB), 1);
      /* border: 1px solid rgba(var(--text-color-RGB), 1); */
      background-color: rgba(var(--background-color-RGB), 1);
      font-weight: 400;
    }

    /* Внешний вид — общий с .button-confirm, здесь только видимость */
    & .button-expand {
      display: none;

      @media (max-width: 768px) {
        display: block;
      }
    }
  }
}

.login {

}
/* Пока корзина открыта на весь экран, страница под ней не скроллится */
@media (max-width: 768px) {
  body:has(.cart-panel.cart-open) {
    overflow: hidden;
  }
}
