/**
 * @file
 * Стили клиентской корзины Vesta.
 */

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

.cart-block__open {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-block__open:hover,
.cart-block__open:focus {
  text-decoration-thickness: 2px;
}

.cart-block__count {
  font-weight: 700;
}

.add-to-cart-form,
.add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.cart-quantity-control__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.cart-quantity-control__btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.cart-quantity-control__input {
  width: 44px;
  height: 32px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  text-align: center;
  background: #fff;
}

.add-to-cart-btn__button,
.cart-drawer__actions button,
.cart-remove-btn {
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.add-to-cart-btn__button {
  padding: 8px 14px;
}

.add-to-cart-btn__button:disabled,
.cart-drawer__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.cart-inline-error {
  color: #b00020;
  font-size: 12px;
}

.user-cart {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  max-height: min(80vh, 720px);
  transform: translateY(105%);
  transition: transform 0.32s ease;
  background: #fff;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
  visibility: hidden;
}

.user-cart--mounted {
  visibility: visible;
}

.user-cart--open {
  transform: translateY(0);
}

.user-cart-is-open {
  overflow: hidden;
}

.cart-drawer {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 720px);
  padding: 20px;
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cart-drawer__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.cart-drawer__close {
  display: flex;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #cfcfcf;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 120%;
}

.cart-drawer-table-wrap {
  overflow: auto;
}

.cart-drawer-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-drawer-table th,
.cart-drawer-table td {
  padding: 10px;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}

.cart-drawer-table th {
  background: #f7f7f7;
  text-align: left;
  font-weight: 700;
}

.cart-product-image {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.cart-product-image--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cfcfcf;
  color: #888;
}

.cart-remove-btn {
  padding: 7px 12px;
  color: #b00020;
  border-color: #b00020;
}

.cart-drawer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cart-drawer__actions button {
  padding: 8px 14px;
}

.cart-drawer__actions .button-danger {
  color: #b00020;
  border-color: #b00020;
}

.cart-drawer-empty {
  padding: 24px 0;
}

@media (max-width: 720px) {
  .cart-drawer {
    padding: 16px;
  }

  .cart-drawer-table th,
  .cart-drawer-table td {
    padding: 8px;
  }

  .cart-product-image {
    width: 56px;
    height: 56px;
  }
}

.cart-product-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-customer-form {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fafafa;
}

.cart-customer-form__title {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.3;
}

.cart-customer-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cart-customer-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.cart-customer-form__field input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

@media (max-width: 720px) {
  .cart-customer-form__grid {
    grid-template-columns: 1fr;
  }
}

.cart-drawer__steps {
  overflow: hidden;
}

.cart-drawer__steps-inner {
  display: flex;
  width: 200%;
  transition: transform 0.28s ease;
}

.cart-drawer__steps-inner--contacts {
  transform: translateX(-50%);
}

.cart-drawer__step {
  display: flex;
  flex-direction: column;
  width: 50%;
  min-width: 50%;
}

.cart-customer-form__intro {
  margin: 0 0 14px;
}

@media (max-width: 720px) {
  .cart-drawer__actions button {
    flex: 1 1 100%;
  }
}

.cart-drawer__step[aria-hidden="true"] {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.cart-product-link.vesta-product-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: #0E8CCC;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-product-link.vesta-product-modal-link:hover,
.cart-product-link.vesta-product-modal-link:focus {
  text-decoration-thickness: 2px;
  color: #b00020;
}
