/* Общие стили для корзины */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

input, button {
  border: 0;
  outline: 0;
  background: none;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
  color: inherit;
}

body {
  font-family: "Nunito", sans-serif;
  max-width: 1600px;
  margin: 0 auto;
  background-color: #FFFDF8;
  font-size: 17px;
  font-weight: 700;
  color: #40595E;
  padding-bottom: 80px;
}

[class*=__container] {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: content-box;
}

/* Общие кнопки */
.btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #FFC83B;
  border-color: #FFC83B;
  color: #40595E;
}

.btn-primary:hover {
  background: #e6b800;
  border-color: #e6b800;
}

.btn-secondary {
  background: transparent;
  border-color: #40595E;
  color: #40595E;
}

.btn-secondary:hover {
  background: #40595E;
  color: white;
}

.header {
  background: #FFC83B;
  background-size: cover;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.header__links-wrap {
  display: inline-flex;
  align-items: end;
  gap: 30px
}

.header__logo {
  color: #40595E;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  column-gap: 5px;
  transition: color 0.3s;
}

.header__logo i {
  color: #7bb2b4;
}

.header__user-btn {
  color: #40595E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  transition: color 0.3s;
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 195, 59, 0.1);
  width: 40px;
  height: 40px;
  margin-left: 10px;
}

.header__user-btn:hover {
  color: #0d707d;
  background: rgba(255, 195, 59, 0.2);
}
.header__user-wrap {
  position: relative;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 8px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 10;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
}

.user-dropdown__link {
  display: inline-block;
  padding: 8px 16px;
  color: #40595E;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.user-dropdown__link:hover {
  background-color: #FFC83B;
  color: #40595E;
}

.user-dropdown__link:not(:last-child) {
  border-right: 1px solid #ddd;
}

.header__cart-wrap {
  position: relative;
  cursor: pointer;
}

.header__cart-btn {
  color: #40595E;
  display: flex;
  align-items: center;
  column-gap: 10.8px;
  font-size: 28px;
  font-weight: 800;
  transition: color 0.3s;
}

.header__cart-count {
  color: #5995A1;
  font-size: 28px;
  font-weight: 800;
}

.mobile-cart-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #40595E;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 195, 59, 0.1);
  transition: background-color 0.3s;
  justify-content: center;
  min-width: 60px;
}

.mobile-cart-toggle:hover {
  background: rgba(255, 195, 59, 0.2);
}

.mobile-cart-count {
  color: #5995A1;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.header__cart-block {
   position: absolute;
   width: 1000px;
   top: 100%;
   right: 0;
   background-color: #fff;
   z-index: 10;
   display: flex;
   flex-direction: column;
   opacity: 0;
   visibility: hidden;
   transition: all 0.1s;
   cursor: auto;
   padding: 45px 27px 89px 73px;
   border-radius: 18px;
   box-shadow: 20px 20px 50px 0 rgba(0,0,0,0.05);
}

.header__cart-block.active {
   opacity: 1;
   visibility: visible;
}

.cart-block-header__title {
  font-size: 64px;
  font-weight: 800;
  color: #FFC83B;
  margin-bottom: 136px;
}

.cart-block-header__items {
  margin-bottom: 95px;
}

.cart-block-header__item {
  display: grid;
  grid-template-columns: 100px 1fr 200px 80px auto;
  align-items: center;
  column-gap: 25px;
}

.cart-block-header__item:not(:last-child) {
  margin-bottom: 15px;
}

.item-cart-header__image {
  display: block;
}

.item-cart-header__image img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.item-cart-header__link {
  display: inline-block;
  justify-self: start;
  font-size: 16px;
  transition: color 0.3s;
}

.item-cart-header__price {
  font-size: 18px;
}

.item-cart-header__remove {
  transition: color 0.3s;
}

.cart-block-header__result {
  display: flex;
  justify-content: space-between;
  column-gap: 20px;
  margin-bottom: 26px;
}

.cart-block-header__result-price {
  font-size: 36px;
  font-weight: 900;
  color: #FFC83B;
}

.cart-block-header__result-title {
  font-size: 36px;
  font-weight: 900;
  color: #FFC83B;
}

.cart-block-header__links {
  display: flex;
  justify-content: space-between;
  column-gap: 10px;
}

.link1 {
   width: 343px;
   height: 57px;
   border: solid 1px #40595E;
   background-color: #40595E;
   border-radius: 45px;
   color: #fff;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: background-color 0.3s;
   font-size: 20px;
   font-weight: 900;
}

.link--2 {
  width: 343px;
  height: 57px;
  border: solid 1px #FFC83B;
  border-radius: 45px;
  background-color: #FFC83B;
  transition: background-color 0.3s;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Стили для основной корзины */
.cart-section {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.cart-container {
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cart-title {
  font-size: 36px;
  font-weight: 900;
  color: #FFC83B;
  margin-bottom: 30px;
  text-align: center;
}

.empty-cart {
  text-align: center;
  padding: 40px 20px;
}

.empty-cart p {
  font-size: 20px;
  margin-bottom: 20px;
  color: #40595E;
}

.cart-items {
  margin-bottom: 30px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 2px solid #FFC83B;
  border-radius: 12px;
  margin-bottom: 15px;
  background: #FFFDF8;
}

.cart-item__image {
  flex-shrink: 0;
}

.cart-item__image img {
  width: 80px;
  height: 100px;
  object-fit: contain;
}

.cart-item__info {
  flex: 1;
}

.cart-item__title {
  font-size: 18px;
  font-weight: 700;
  color: #40595E;
  margin-bottom: 8px;
}

.cart-item__price {
  font-size: 16px;
  font-weight: 900;
  color: #40595E;
}

.cart-item__remove {
  background: #FFC83B;
  border: 1px solid #FFC83B;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #40595E;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cart-item__remove:hover {
  background: #e6b800;
}

.cart-total {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #FFC83B;
  border-radius: 12px;
}

.cart-total__text {
  font-size: 24px;
  font-weight: 900;
  color: #40595E;
}

.cart-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Стили для каталога товаров */
.hero {
  margin: 32px 0;
  margin-bottom: 84px;
  padding: 0 57px;
}

.hero__title {
  font-size: 64px;
  font-weight: 900;
  line-height: 100%;
  color: #FFC83B;
  margin-bottom: 18px;
}

.hero__sub-title {
  font-size: 20px;
  color: #FFC83B;
  margin-bottom: 91px;
}

.hero__body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 34px;
  row-gap: 50px;
  justify-content: center;
  justify-items: center;
}

.item-hero {
  width: 258px;
  height: 555px;
  background-color: #FFC83B;
  border-radius: 45px;
  border: solid 1px #FFC83B;
  padding: 16px;
  position: relative;
}

.item-hero__image img {
  display: block;
  max-width: 100%;
  width: 214px;
  height: 267px;
  margin: 0 auto 11px;
}

.item-hero__title {
  font-size: 16px;
  font-weight: 700;
  color: #40595E;
  margin-bottom: 30px;
  max-width: 214px;
  margin-left: auto;
  margin-right: auto;
}

.item-hero__info {
  font-size: 16px;
  font-weight: 700;
  color: #40595E;
  max-width: 214px;
  margin-left: auto;
  margin-right: auto;
}

.item-hero__price {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 21px;
  color: #fff;
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.item-hero__status {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 21px;
  color: #40595E;
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.item-hero__add-btn {
  color: #40595E;
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 900;
  width: 216px;
  height: 57px;
  border: solid 1px #FFC83B;
  background-color: #FFFDF8;
  border-radius: 45px;
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.item-hero__add-btn:hover {
  background-color: lightgray;
}

.item-hero__add-btn.ordered {
  background-color: #F07401;
  color: #fff;
  pointer-events: auto;
  cursor: pointer;
}
.item-hero__add-btn.completed {
  background-color: #5995A1;
  color: #fff;
  pointer-events: auto;
  cursor: pointer;
}
.item-hero__add-btn.in-cart {
  background-color: #4caf50;
  color: #fff;
  pointer-events: auto;
  cursor: pointer;
}

.btn-return {
  margin: 0 auto;
  width: 216px;
  height: 57px;
  background-color: #FFC83B;
  color: #40595E;
  text-transform: uppercase;
  border: solid 1px #FFC83B;
  border-radius: 45px;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.btn-return:hover,
.btn-return:focus,
.btn-return:active {
  background-color: lightgray;
  border: solid 1px #FFC83B;
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #000;
}

.modal-buttons {
  margin-top: 20px;
}

.modal-buttons .btn {
  margin: 0 10px;
}

/* Hover эффекты */
@media (any-hover:hover) {
  .item-cart-header__link:hover,
  .item-cart-header__remove:hover {
    color: #0d707d;
  }
  .header__logo:hover {
    color: #0d707d;
  }
  .link1:hover {
    background-color: #0d707d;
  }
  .link--2:hover {
    background-color: lightgray;
  }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .header__container {
    gap: 10px;
  }

  .header__user-btn {
    font-size: 18px;
    width: 35px;
    height: 35px;
    padding: 6px;
  }

  .header__cart-wrap {
    position: relative;
  }

  .header__cart-btn {
    display: none;
  }

  .header__cart-block {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    padding: 20px !important;
    box-sizing: border-box !important;
  }

  .header__cart-block.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    align-items: center;
    justify-content: center;
  }

  .header__cart-block.active > * {
    max-width: 95vw;
    width: 100%;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 18px;
    box-shadow: 20px 20px 50px 0 rgba(0,0,0,0.05);
    padding: 20px 20px 20px 20px;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .header__cart-block.active .cart-block-header__title {
    font-size: 24px !important;
    margin: -35px 0 15px 0 !important;
    text-align: center;
    color: #FFC83B;
    font-weight: 800;
    position: relative;
  }

  .cart-close-title-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    font-weight: bold;
    z-index: 10;
  }

  .cart-close-title-btn:hover {
    background: #e8e8e8;
    transform: scale(1.05);
  }

  .cart-close-title-btn:active {
    transform: scale(0.95);
  }

  .header__cart-block.active .cart-block-header__items {
    margin-bottom: 10px !important;
    flex: 1;
    overflow-y: auto;
  }

  .header__cart-block.active .cart-block-header__item {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .header__cart-block.active .cart-block-header__item:last-child {
    border-bottom: none;
  }

  .header__cart-block.active .item-cart-header__image img {
    width: 40px !important;
    height: 40px !important;
  }

  .header__cart-block.active .item-cart-header__link {
    flex: 1;
    font-size: 14px !important;
    line-height: 1.2;
  }

  .header__cart-block.active .item-cart-header__title {
    margin: 0;
    font-size: 14px !important;
  }

  .header__cart-block.active .item-cart-header__price {
    font-size: 16px !important;
    font-weight: 700;
    color: #40595E;
    white-space: nowrap;
  }

  .header__cart-block.active .item-cart-header__remove {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #FFC83B;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #40595E;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  .header__cart-block.active .item-cart-header__remove:hover {
    background: #e6b800;
  }

  .header__cart-block.active .cart-block-header__result {
    margin-bottom: 10px !important;
    border-top: 2px solid #FFC83B;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header__cart-block.active .cart-block-header__result-text {
    font-size: 18px !important;
    font-weight: 900;
    color: #FFC83B;
    margin: 0 !important;
  }

  .header__cart-block.active .cart-block-header__links {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .header__cart-block.active .link1,
  .header__cart-block.active .link--2 {
    width: 100% !important;
    font-size: 16px !important;
    min-height: 45px;
  }

  .cart-section {
    padding: 20px 15px;
  }

  .cart-container {
    padding: 20px;
  }

  .cart-title {
    font-size: 28px;
  }

  .cart-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .cart-item__info {
    text-align: center;
  }

  .cart-actions {
    flex-direction: column;
  }

  .cart-actions .btn {
    width: 100%;
  }
}

@media (min-width: 769px) {
  .mobile-cart-toggle {
    display: none;
  }

  .header__cart-btn {
    display: block;
  }
}

/* Медиа-запросы для каталога */
@media (max-width: 1200px) {
  .hero__body {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .hero__body {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 0 20px;
  }

  .hero__body {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .item-hero {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}
/* ==========================================================================
   СТРАНИЦА КНИГИ (BOOK VIEW)
   ========================================================================== */

.section-buch {
    padding: 40px 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.name h1 {
    color: #FFC83B;
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 30px;
    line-height: 1.2;
}

.text {
    color: #40595E;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.text p {
    margin-bottom: 15px;
}

.text img {
    max-width: 100% !important;
    max-height: 500px !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    margin: 15px 0;
    border-radius: 8px;
}

.price {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(64, 89, 94, 0.1);
}

.span-price {
    font-size: 26px;
    color: #40595E;
    font-weight: 900;
}

.buttons {
    display: flex;
    margin-top: 35px;
    flex-wrap: wrap;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    .btn-action {
        width: 100%;
        max-width: 300px;
    }
}

/* Базовая кнопка (общие параметры) */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 216px;
    height: 57px;
    border-radius: 45px;
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: "Nunito", sans-serif;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* В КОРЗИНУ (Главное действие) */
.btn-buy-action {
    background-color: #FFC83B;
    color: #40595E !important;
    border: 1px solid #FFC83B;
    margin-right: 140px;
}

.btn-buy-action:hover {
    background-color: #e6b800;
    box-shadow: 0 4px 12px rgba(255, 200, 59, 0.4);
    transform: none;
}

/* Спец. статусы (как в каталоге) */
.btn-completed {
    background-color: #5995A1 !important;
    color: #fff !important;
}

.btn-ordered {
    background-color: #F07401 !important;
    color: #fff !important;
}

.in-cart {
    background-color: #4caf50 !important;
    color: #fff !important;
    border: 1px solid #4caf50 !important;
}

/* В КАТАЛОГ (Вспомогательное действие) */
.btn-return-action {
    background-color: #FFFDF8;
    color: #40595E !important;
    border: 1px solid #FFC83B;
    margin-left: 140px;
}

.btn-return-action:hover {
    background-color: lightgray;
    box-shadow: 0 4px 12px rgba(64, 89, 94, 0.15);
    transform: none;
}
