/* FIREBOOKS — мобильный кабинет, вариант №1 */
/* На компьютере дополнительные элементы скрыты */

.cabinet .sidebar__item--mobile-only,
.cabinet .sidebar__mobile-icon,
.cabinet .sidebar__mobile-count {
  display: none;
}

@media (max-width: 768px) {

  .cabinet {
    padding: 22px 0 36px;
  }

  .cabinet .cabinet__wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .cabinet .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex: none;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
  }

  .cabinet .sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin: 0;
  }

  .cabinet .sidebar__avatar {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .cabinet .sidebar__name {
    font-size: 16px;
  }

  /* Четыре кнопки в два столбца */
  .cabinet .sidebar__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .cabinet .sidebar__item,
  .cabinet .sidebar__item--mobile-only {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    min-height: 52px;
    gap: 6px;
    padding: 9px 8px;
    margin: 0;
    border-radius: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(11px, 3.2vw, 13px);
    line-height: 1.25;
  }

  /* Активная кнопка */
  .cabinet .sidebar__item--active,
  .cabinet .sidebar__item[aria-current="page"] {
    background: rgba(255, 255, 255, 0.19);
    color: #fff;
  }

  /* Иконки */
  .cabinet .sidebar__item svg,
  .cabinet .sidebar__mobile-icon {
    display: block;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
  }

  .cabinet .sidebar__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
  }

  /* Счётчики */
  .cabinet .sidebar__badge,
  .cabinet .sidebar__mobile-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    box-sizing: border-box;
  }

  .cabinet .sidebar__badge[hidden] {
    display: none;
  }

  /* Нижние ссылки */
  .cabinet .sidebar__bottom {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    padding: 12px;
    margin: 0;
  }

  .cabinet .sidebar__bottom-link {
    font-size: 12px;
  }

  /* Содержимое кабинета */
  .cabinet .cabinet__title {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 16px;
  }

  .cabinet .cabinet__content {
    width: 100%;
    min-width: 0;
  }

  .cabinet .cabinet__content > .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
  }

  .cabinet .cabinet__content
  > .section-head .cabinet__title {
    margin-bottom: 0;
  }

  .cabinet .btn--logout {
    padding: 8px 11px;
    font-size: 12px;
  }

  .cabinet .profile__heading {
    font-size: 19px;
    margin-bottom: 14px;
  }

  /* Компактная библиотека */
  .cabinet .library__notice,
  .cabinet .library__empty {
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.55;
  }

  .cabinet .library__empty p + p {
    margin-top: 8px;
  }
}

/* FIREBOOKS — компактные закладки на телефоне */
@media (max-width: 768px) {

  /* Две книги в ряд */
  .cabinet #bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
  }

  .cabinet #bookmarks-grid .cabinet__card {
    min-width: 0;
  }

  .cabinet #bookmarks-grid .book-card {
    width: 100%;
    min-width: 0;
    height: 100%;
  }

  /* Обложка */
  .cabinet #bookmarks-grid .book-card__cover {
    width: 100%;
    aspect-ratio: 3 / 4;
  }

  .cabinet #bookmarks-grid .book-card__cover > a {
    display: block;
    width: 100%;
    height: 100%;
  }

  .cabinet #bookmarks-grid .book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Информация о книге */
  .cabinet #bookmarks-grid .book-card__info {
    padding: 10px;
  }

  .cabinet #bookmarks-grid .book-card__title {
    font-size: 13px;
    line-height: 1.35;
  }

  .cabinet #bookmarks-grid .book-card__author,
  .cabinet #bookmarks-grid .book-card__type {
    font-size: 11px;
  }

  .cabinet #bookmarks-grid .book-card__prices {
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .cabinet #bookmarks-grid .book-card__new-price {
    font-size: 15px;
  }

  .cabinet #bookmarks-grid .book-card__old-price {
    font-size: 11px;
  }

  /* Рейтинг */
  .cabinet #bookmarks-grid .star {
    font-size: 12px;
  }

  .cabinet #bookmarks-grid .book-card__reviews {
    font-size: 11px;
    margin-left: 3px;
  }

  /* Кнопки */
  .cabinet #bookmarks-grid .book-card__btn {
    padding: 10px 6px;
    font-size: 13px;
  }

  .cabinet #bookmarks-grid .book-card__fav {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .cabinet #bookmarks-grid .book-card__discount {
    font-size: 11px;
    padding: 4px 6px;
  }
}

@media (max-width: 768px) {
  #bookmarks-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  #bookmarks-grid > .cabinet__card {
    min-width: 0;
    width: 100%;
  }

  #bookmarks-grid .book-card {
    width: 100%;
    min-width: 0;
  }

  #bookmarks-grid .book-card__cover {
    aspect-ratio: 3 / 4;
  }

  #bookmarks-grid .book-card__info {
    padding: 10px;
  }

  #bookmarks-grid .book-card__title {
    font-size: 13px;
  }
}