/* CART SIDEBAR – offcanvas корзины */

.cart_sidebar {
  width: 100%;
  max-width: 380px;
  background-color: #ffffff;
  border-left: 1px solid var(--border-soft, #e5e7eb);
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.18);
}

.cart_sidebar__header {
  align-items: flex-start;
  padding: 0.95rem 1.2rem 0.75rem;
  border-bottom: 1px solid var(--border-soft, #e5e7eb);
}

.cart_sidebar__title {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main, #111827);
}

.cart_sidebar__subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
}

.cart_sidebar__close {
  opacity: 0.7;
}

.cart_sidebar__body {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.2rem 1.25rem;
  gap: 0.9rem;
}

/* Табы */

.cart_sidebar__tabs {
  display: flex;
  gap: 0.4rem;
  background-color: #f3f4f6;
  padding: 0.25rem;
  border-radius: 999px;
}

.cart_sidebar__tab {
  flex: 1;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  color: var(--text-muted, #6b7280);
}

.cart_sidebar__tab-index {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
}

.cart_sidebar__tab--active {
  background-color: #ffffff;
  color: var(--accent, #16a34a);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
}

.cart_sidebar__tab--active .cart_sidebar__tab-index {
  border-color: var(--accent, #16a34a);
  background-color: var(--accent-soft, #dcfce7);
}

/* Шаги */

.cart_sidebar__step {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.cart_sidebar__step--active {
  display: flex;
}

/* Список товаров */

.cart_sidebar__items {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart_sidebar__item {
  position: relative;
  padding: 0.65rem 0.75rem 0.6rem;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}



.cart_sidebar__item-info {
  min-width: 0;
}

.cart_sidebar__item-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.cart_sidebar__item-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
}

.cart_sidebar__item-price {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.cart_sidebar__item-remove {
  position: absolute;
  right: 0.4rem;
  top: 0.4rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  color: #9ca3af;
  padding: 0.1rem 0.25rem;
}

.cart_sidebar__item-remove:hover {
  color: #ef4444;
}

/* Итого + кнопка */

.cart_sidebar__bottom {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px dashed #e5e7eb;
}

.cart_sidebar__total {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.cart_sidebar__total-sum {
  font-weight: 600;
}

.cart_sidebar__primary-btn {
  width: 100%;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border: none;
  background-color: var(--accent, #16a34a);
  color: #ffffff;
}

.cart_sidebar__primary-btn:hover {
  background-color: var(--accent-dark, #15803d);
}

/* Форма оформления */

.cart_sidebar__form {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cart_sidebar__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cart_sidebar__label {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
}

.cart_sidebar__input {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
}

.cart_sidebar__input:focus {
  border-color: var(--accent, #16a34a);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}

.cart_sidebar__textarea {
  resize: vertical;
  min-height: 70px;
}

/* Способ оплаты */

.cart_sidebar__pay-options {
  display: flex;
  gap: 0.5rem;
}

.cart_sidebar__pay-option {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.7rem;
  font-size: 0.86rem;
  background-color: #ffffff;
}

.cart_sidebar__pay-option--active {
  border-color: var(--accent, #16a34a);
  background-color: var(--accent-soft, #dcfce7);
  color: var(--accent-dark, #15803d);
}

/* Кнопки внизу формы */

.cart_sidebar__actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.cart_sidebar__secondary-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.86rem;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  color: var(--text-main, #111827);
}

.cart_sidebar__secondary-btn:hover {
  background: #eef2ff;
}

/* Адаптив */

@media (max-width: 575.98px) {
  .cart_sidebar {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .cart_sidebar__body {
    padding-inline: 1rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart_sidebar__header {
    padding-left: calc(1.2rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.2rem + env(safe-area-inset-right, 0px));
  }

  /* кнопки и табы — удобные для пальца */
  .cart_sidebar__tab {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  .cart_sidebar__close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}


/* Карточка товара в корзине */
.cart_sidebar__item {
    list-style: none;
    margin-bottom: 12px;
}

.cart_sidebar__item-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 10px 14px 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.cart_sidebar__item-card--empty {
    text-align: left;
}

.cart_sidebar__item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.cart_sidebar__item-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.cart_sidebar__item-remove {
    border: none;
    padding: 0 4px;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cart_sidebar__item-remove:hover {
    color: #ef4444;
}

/* нижняя часть карточки */
.cart_sidebar__item-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.cart_sidebar__item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* +/- количество */
.cart_sidebar__qty {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.cart_sidebar__qty-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cart_sidebar__qty-btn--minus {
    border-right: 1px solid #d1d5db;
}

.cart_sidebar__qty-btn--plus {
    border-left: 1px solid #d1d5db;
}

.cart_sidebar__qty-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.cart_sidebar__qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

/* текст "× 120,00 ₽" */
.cart_sidebar__item-meta {
    font-size: 12px;
    color: #6b7280;
}

/* итоговая сумма справа */
.cart_sidebar__item-price {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
