/* Собственная система модальных окон */

.modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal:before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  height: 100%;
}

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

.modal__container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 50px auto;
  display: inline-block;
  vertical-align: middle;
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  cursor: default;
  text-align: left;
  transform: translateY(-50px);
  transition: transform 0.3s ease;
}

.modal--open .modal__container {
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .modal__container {
    width: 90%;
    max-width: 90%;
  }
}

.modal__close {
  position: absolute;
  right: 10px;
  top: 10px;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  background-color: transparent;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.modal__close:hover {
  transform: scale(1.1);
}

.modal__close:before,
.modal__close:after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: #444B58;
  transition: background-color 0.2s ease;
}

.modal__close:hover:before,
.modal__close:hover:after {
  background-color: #F14F4F;
}

.modal__close:before {
  transform: rotate(45deg);
}

.modal__close:after {
  transform: rotate(-45deg);
}

/* Модальное окно продукта */
.prod-modal .modal__container {
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 4px;
  padding: 30px;
  width: 95%;
}

.prod-modal__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.prod-modal__video {
  width: 100%;
  height: 350px;
}

.prod-modal__video iframe {
  display: block;
  border: none;
  width: 100%;
  object-fit: cover;
  height: 100%;
}

.modal-slider {
  margin-right: 100px;
  width: calc(50% - (20px / 2));
}

.modal-slider__container {
  overflow: hidden;
  width: 100%;
  margin-bottom: 20px;
  font-size: 0;
}

.modal-slider__container img {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
}

.modal-info {
  width: calc(50% - (20px / 2));
}

.modal-info__top {
  display: flex;
  align-items: center;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  margin-bottom: 40px;
  font-weight: 600;
  font-size: 16px;
  line-height: 16px;
  color: #444B58;
}

.modal-info__vendor {
  margin-right: 40px;
}

.modal-info__quantity span {
  font-weight: 600;
  color: #444B58;
}

.modal-info__title {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  margin: 0 0 20px;
  font-weight: 600;
  font-size: 24px;
  line-height: 140%;
  color: #444B58;
}

.modal-info__rate {
  margin-bottom: 20px;
}

.modal-info__price {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.modal-info__current-price {
  font-family: 'Intro Regular', sans-serif;
  font-style: normal;
  margin-right: 30px;
  font-weight: 800;
  font-size: 28px;
  line-height: 30px;
  color: #444B58;
}

.modal-info__old-price {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 16px;
  text-decoration: line-through;
  color: #B2B5BB;
}

.modal-info__order {
  margin-top: 110px;
  width: 100%;
}

.modal-preview {
  display: grid;
  grid-template-columns: repeat(6, 78px);
  gap: 32px;
}

.modal-preview__item {
  border-radius: 4px;
  height: 75px;
  transition: opacity 0.3s;
  cursor: pointer;
}

.modal-preview__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-preview__item:hover {
  opacity: 0.7;
}

.modal-preview__item--active {
  opacity: 0.7;
  pointer-events: none;
}

.modal-note {
  margin-bottom: 40px;
}

.modal-note__item {
  padding-left: 25px;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 14px;
  color: #444B58;
  background-image: url("../img/check.svg");
  background-position: left center;
  background-size: 15px 12px;
  background-repeat: no-repeat;
}

.modal-note__item:not(:last-child) {
  margin-bottom: 10px;
}

.prod-bottom {
  display: flex;
  margin-bottom: 20px;
}

.prod-bottom__column {
  width: 100%;
}

.prod-bottom__column:first-child {
  margin-right: 20px;
}

.prod-bottom__title {
  margin: 20px 0 5px 0;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 24px;
  line-height: 24px;
  color: #444B58;
}

.prod-bottom__descr {
  width: 100%;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 400;
  text-align: justify;
  font-size: 16px;
  line-height: 140%;
  color: #444B58;
}

/* Модальное окно корзины */
.cart-modal .modal__container {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 4px;
  padding: 30px;
  width: 90%;
}

.cart-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.cart-modal__title {
  margin: 0;
  font-family: 'Intro Bold', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 20px;
  color: #444B58;
}

.cart-modal__order-number {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 14px;
  text-align: right;
  color: #444B58;
}

.cart-modal-order {
  margin-bottom: 40px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 30px;
}

.cart-modal-order__top {
  margin-bottom: 10px;
}

.cart-modal-order__list {
  display: none;
}

.cart-modal-order__list--visible {
  display: block;
}

.cart-modal-order__quantity {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
  margin-bottom: 20px;
}

.cart-modal-order__quantity span {
  font-family: 'Intro Bold', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
}

.cart-modal-order__item {
  margin-bottom: 15px;
}

.cart-modal-order__summ {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
  margin-bottom: 20px;
}

.cart-modal-order__summ span {
  font-family: 'Intro Bold', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
}

.cart-modal-order__show {
  display: inline-flex;
  align-items: center;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 800;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
  margin-bottom: 20px;
  cursor: pointer;
}

.cart-modal-order__show svg {
  margin-left: 5px;
  width: 10px;
  height: 10px;
  fill: currentColor;
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

.cart-modal-order__show--active svg {
  transform: rotate(180deg);
}

.cart-modal-product {
  display: flex;
  align-items: center;
}

.cart-modal-product__image {
  flex-shrink: 0;
  margin-right: 10px;
  width: 100px;
  height: 100px;
}

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

.cart-modal-product__content {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

.cart-modal-product__text {
  margin-right: auto;
  max-width: 268px;
}

.cart-modal-product__title {
  margin: 0;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 18px;
  line-height: 18px;
  color: #444B58;
  margin-bottom: 10px;
}

.cart-modal-product__price {
  font-family: 'Intro Bold', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 16px;
  color: #444B58;
}

.cart-modal-product__delete {
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 15px;
  line-height: 14px;
  text-align: right;
  color: #596171;
  cursor: pointer;
}

.cart-modal__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cart-modal__input {
  width: 100%;
  font-family: 'Intro Book', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 140%;
  padding: 20px;
  background: #F7F7F7;
  border-radius: 4px;
  border: none;
  margin-bottom: 10px;
}

.cart-modal__btn {
  margin-top: 30px;
}

/* Анимация появления */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal--open .modal__container {
  animation: modalFadeIn 0.3s ease forwards;
}
