/* Корзина магазина — 2 шага, стиль сайта (золото / Oswald) */
:root,
.shop-cart-modal {
  --shop-cart-accent: #d6a354;
  --shop-cart-accent-soft: rgba(214, 163, 84, 0.1);
  --shop-cart-text: #707070;
  --shop-cart-heading: #252525;
  --shop-cart-border: #e8e8e8;
  --shop-cart-bg: #fff;
  --shop-cart-bg-soft: #faf8f5;
  --shop-cart-font-body: "Rubik", sans-serif;
  --shop-cart-font-heading: "Oswald", sans-serif;
  --shop-cart-radius: 5px;
}

.shop-cart-host {
  position: static;
  width: 0;
  height: 0;
  overflow: visible;
}

/* Кнопка — как fresha-cart__btn, слева от scroll-top */
.shop-cart {
  position: fixed;
  bottom: 25px;
  right: 86px;
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.shop-cart.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shop-cart__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--shop-cart-radius);
  background: #d69838;
  color: #fff;
  font-family: var(--shop-cart-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(214, 163, 84, 0.35);
  min-height: 50px;
}

.shop-cart__btn:hover {
  filter: brightness(1.06);
}

.shop-cart__btn i {
  font-size: 18px;
}

.shop-cart__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #fff;
  color: var(--shop-cart-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

/* Modal */
.shop-cart-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.shop-cart-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.shop-cart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.shop-cart-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(92vw, 760px);
  max-height: min(90vh, 820px);
  background: var(--shop-cart-bg);
  border-radius: var(--shop-cart-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  font-family: var(--shop-cart-font-body);
  color: var(--shop-cart-text);
}

.shop-cart-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--shop-cart-accent);
}

.shop-cart-modal__title {
  flex: 1;
  margin: 0;
  min-width: 0;
  font-family: var(--shop-cart-font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}

.shop-cart-modal__steps {
  padding: 0;
  background: var(--shop-cart-bg);
  border-bottom: 1px solid var(--shop-cart-border);
}

.shop-cart-modal__steps[hidden] {
  display: none !important;
}

.shop-cart-modal__steps-inner {
  display: flex;
  flex-wrap: nowrap;
}

.shop-cart-modal__step {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 12px 8px;
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--shop-cart-border);
  background: var(--shop-cart-bg);
  color: #a8a8a8;
  font-family: var(--shop-cart-font-heading);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.shop-cart-modal__step:last-child {
  border-right: none;
}

.shop-cart-modal__step:hover:not(:disabled):not(.is-current) {
  color: var(--shop-cart-heading);
  background: var(--shop-cart-bg-soft);
}

.shop-cart-modal__step.is-current {
  position: relative;
  z-index: 1;
  border: 1px solid var(--shop-cart-accent);
  background: var(--shop-cart-accent-soft);
  color: var(--shop-cart-heading);
}

.shop-cart-modal__step.is-disabled,
.shop-cart-modal__step:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.shop-cart-modal__back,
.shop-cart-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--shop-cart-radius);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.shop-cart-modal__clear {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--shop-cart-radius);
  background: transparent;
  color: #fff;
  font-family: var(--shop-cart-font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.shop-cart-modal__clear:hover,
.shop-cart-modal__back:hover,
.shop-cart-modal__close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.shop-cart-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px;
}

.shop-cart-modal__empty,
.shop-cart-modal__success {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  font-family: var(--shop-cart-font-heading);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--shop-cart-heading);
}

.shop-cart-modal__success {
  text-transform: none;
  font-family: var(--shop-cart-font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

/* Step 1 — таблица товаров */
.shop-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.shop-cart-table thead th {
  padding: 0 8px 12px;
  border-bottom: 2px solid var(--shop-cart-border);
  font-family: var(--shop-cart-font-heading);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shop-cart-heading);
}

.shop-cart-table thead th:last-child,
.shop-cart-table tbody td:last-child {
  text-align: right;
}

.shop-cart-table tbody td {
  padding: 16px 8px;
  border-bottom: 1px solid var(--shop-cart-border);
  vertical-align: middle;
}

.shop-cart-table tbody tr:last-child td {
  border-bottom: none;
}

.shop-cart-table__product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.shop-cart-table__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: var(--shop-cart-radius);
  overflow: hidden;
  background: var(--shop-cart-bg-soft);
}

.shop-cart-table__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-cart-table__name {
  margin: 0 0 4px;
  font-family: var(--shop-cart-font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--shop-cart-heading);
}

.shop-cart-table__unit {
  font-size: 13px;
  color: var(--shop-cart-text);
}

.shop-cart-modal__qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shop-cart-modal__qty-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--shop-cart-border);
  border-radius: var(--shop-cart-radius);
  background: #fff;
  color: var(--shop-cart-heading);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.shop-cart-modal__qty-btn:hover {
  border-color: var(--shop-cart-accent);
  color: var(--shop-cart-accent);
}

.shop-cart-modal__qty-input {
  width: 40px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--shop-cart-border);
  border-radius: var(--shop-cart-radius);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--shop-cart-heading);
}

.shop-cart-table__line-total {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--shop-cart-heading);
}

.shop-cart-modal__item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid var(--shop-cart-border);
  border-radius: 50%;
  background: #fff;
  color: #9a9a9a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.shop-cart-modal__item-remove:hover {
  border-color: #d9b3b3;
  color: #b3261e;
  background: #fdf4f4;
}

.shop-cart-summary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px solid var(--shop-cart-border);
}

.shop-cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
}

.shop-cart-summary__row--total {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--shop-cart-border);
  font-family: var(--shop-cart-font-heading);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--shop-cart-accent);
}

/* Step 2 — форма */
.shop-cart-checkout {
  max-width: none;
  margin: 0;
  padding: 0;
}

.shop-cart-checkout__title {
  margin: 0 0 18px;
  font-family: var(--shop-cart-font-heading);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--shop-cart-heading);
}

.shop-cart-modal__form .form-control {
  width: 100%;
  margin-bottom: 14px;
  border-radius: 0;
  padding: 0 0 10px;
  border: none;
  border-bottom: 2px solid var(--shop-cart-border);
  font-family: var(--shop-cart-font-body);
  font-size: 15px;
  color: var(--shop-cart-heading);
  background: transparent;
}

.shop-cart-modal__form .form-control:focus {
  outline: none;
  border-bottom-color: var(--shop-cart-accent);
}

.shop-cart-modal__form textarea.form-control {
  min-height: 72px;
  resize: vertical;
}

.shop-cart-modal__error {
  margin: 0 0 12px;
  color: #b3261e;
  font-size: 13px;
}

.shop-cart-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--shop-cart-border);
  background: var(--shop-cart-bg);
}

.shop-cart-modal__foot.is-hidden {
  display: none;
}

.shop-cart-modal__secondary {
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--shop-cart-text);
  font-family: var(--shop-cart-font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.shop-cart-modal__secondary:hover {
  color: var(--shop-cart-heading);
}

.shop-cart-modal__primary {
  flex: 1 1 auto;
  margin: 0;
  margin-left: auto;
  max-width: 280px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shop-cart-modal__primary:disabled {
  opacity: 0.55;
  cursor: default;
}

body.shop-cart-open {
  overflow: hidden;
}

body.shop-cart-open .scroll-top {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media only screen and (max-width: 767px) {
  .shop-cart {
    bottom: 15px;
    right: 66px;
  }

  .shop-cart__btn {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    gap: 8px;
  }

  .shop-cart-modal {
    padding: 0;
    align-items: flex-end;
  }

  .shop-cart-modal__dialog {
    max-width: none;
    max-height: 92vh;
    border-radius: var(--shop-cart-radius) var(--shop-cart-radius) 0 0;
  }

  .shop-cart-modal__body {
    padding: 16px;
  }

  .shop-cart-table thead {
    display: none;
  }

  .shop-cart-table tbody tr {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--shop-cart-border);
  }

  .shop-cart-table tbody td {
    display: block;
    padding: 4px 0;
    border: none;
  }

  .shop-cart-table tbody td:last-child {
    text-align: left;
  }

  .shop-cart-modal__foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .shop-cart-modal__primary {
    max-width: none;
    width: 100%;
  }

  .shop-cart-modal__secondary {
    text-align: center;
  }
}
