/* ===== Details page ===== */

.details-page {
  flex: 0 0 100%;
  width: 100%;
  max-width: none;

  display: flex;
  flex-direction: column;
  align-items: center;

  box-sizing: border-box;
}

.image-details {
  width: 100%;
  max-width: 1440px;
  margin: 110px auto 90px;
  padding: 0 32px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;

  opacity: 0;
  transition: opacity .3s ease-in-out;
}

.image-details.ready {
  opacity: 1;
}

.image-details .content-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-details .image-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.image-details .image-container img {
  width: 100%;
  height: auto;
}

.image-details .image-title,
.image-details .image-container h1 {
  margin: 0 0 25px;
  padding: 0;

  font-size: 30px;
  line-height: 1.2;
  font-weight: bold;
  color: #353535;
}

/* ===== Под fotorama: размер / год ===== */

.details-under-fotorama {
  width: 100%;
  margin-top: 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  font-size: 21px;
  line-height: 1.35;
  color: #353535;
  text-align: center;
}

.details-medium-size-block,
.details-year-block {
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}

.details-under-fotorama p,
.details-under-fotorama h3,
.details-under-fotorama div {
  margin: 0;
  padding: 0;
}

/* ===== Нижнее описание под изображением ===== */

.details-description {
  width: 100%;
  margin-top: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;

  text-align: center;
}

.details-purchase-row {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  text-align: center;
}

.details-below-meta {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;

  text-align: center;
  font-weight: bold;
}

.details-below-meta .description-location {
  display: inline-block;
  margin: 0;
  border-bottom: 1px solid #353535;
  text-align: center;
}

.details-below-meta .description-technique {
  display: block;
  margin: 0;
  padding: 5px;
  text-align: center;
}

/* ===== Кнопка "Приобрести" ===== */

.details-buy-button {
  min-width: 160px;
  padding: 10px 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background-color: #716f6f;
  color: #fff;

  border: none;
  border-radius: 5px;

  text-decoration: none;
  cursor: pointer;

  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
  transition: background-color .3s, box-shadow .3s;
}

.details-buy-button:hover {
  background-color: #5f5d5d;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3);
}

.details-buy-button.is-unavailable {
  background-color: #b8b8b8;
  color: #fff;
  border-color: #a8a8a8;
  box-shadow: none;
}

.details-buy-button.is-unavailable:hover {
  background-color: #a9a9a9;
  color: #fff;
}

.product-availability-note {
  font-size: 14px;
  color: #777;
  font-style: italic;
}

/* ===== Related works ===== */

.related-slider {
  width: 100%;
  max-width: 1440px;
  margin: 60px auto 90px;
  padding: 0 32px;
  box-sizing: border-box;
  clear: both;
}

.related-slider__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  border-top: 1px solid rgba(38, 33, 26, .14);
  padding-top: 30px;
  margin-bottom: 26px;
}

.related-slider__head h2 {
  margin: 0;
  padding: 0;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 400;
  color: #2a261f;
}

.related-slider__controls {
  display: flex;
  gap: 10px;
}

.related-slider__btn {
  width: 42px;
  height: 42px;

  border: 1px solid rgba(122, 106, 77, .35);
  border-radius: 999px;

  background: rgba(255, 255, 255, .7);
  color: #2c2822;

  font-size: 30px;
  line-height: 1;
  cursor: pointer;

  transition: background .2s ease, opacity .2s ease, transform .2s ease;
}

.related-slider__btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.related-slider__btn:disabled {
  opacity: .28;
  cursor: default;
  transform: none;
}

.related-slider__viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.related-slider__viewport::-webkit-scrollbar {
  display: none;
}

.related-slider__track {
  display: flex;
  align-items: stretch;
  gap: 28px;
}

.related-card {
  flex: 0 0 calc((100% - 84px) / 4);
  min-width: 0;
}

.related-card__image {
  display: block;
  overflow: hidden;
  background: #e8e1d6;
}

.related-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .35s ease;
}

.related-card:hover .related-card__image img {
  transform: scale(1.035);
}

.related-card__body {
  padding-top: 13px;
}

.related-card__body h3 {
  margin: 0 0 9px;
  padding: 0;

  font-size: 16px;
  line-height: 1.25;
  font-weight: 400;
  color: #2c2822;
}

.related-card__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.related-card__links a {
  position: relative;
  z-index: 5;

  font-size: 13px;
  color: #7a6a4d;
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 106, 77, .35);
  pointer-events: auto;
}

.related-card__links a:hover {
  color: #2c2822;
  border-color: rgba(44, 40, 34, .55);
}

/* ===== Mobile ===== */

@media (max-width: 1000px) {
  .related-card {
    flex-basis: calc((100% - 28px) / 2);
  }
}

@media (max-width: 820px) {
  .image-details {
    margin-top: 95px;
    margin-bottom: 60px;
    padding: 0 16px;
    gap: 15px;
  }

  .image-details .content-container,
  .image-details .image-container {
    max-width: 100%;
  }

  .image-details .image-title,
  .image-details .image-container h1 {
    font-size: 20px;
    text-align: center;
  }

  .details-under-fotorama {
    margin-top: 10px;
    gap: 8px;

    font-size: 16px;
    text-align: center;
  }

  .details-medium-size-block,
  .details-year-block {
    text-align: center;
  }

  .details-description {
    align-items: center;
    gap: 12px;
  }

  .details-below-meta {
    align-items: center;
    text-align: center;
  }

  .details-buy-button {
    min-width: 140px;
    font-size: 14px;
  }

  .related-slider {
    padding: 0 16px;
    margin: 50px auto 70px;
  }

  .related-slider__head {
    padding-top: 24px;
    margin-bottom: 20px;
  }

  .related-slider__head h2 {
    font-size: 28px;
  }

  .related-slider__btn {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }

  .related-slider__track {
    gap: 18px;
  }

  .related-card {
    flex-basis: 78%;
  }
}

@media (max-width: 480px) {
  .image-details .image-title,
  .image-details .image-container h1 {
    font-size: 18px;
  }

  .details-buy-button {
    min-width: 120px;
    padding: 8px 15px;
  }

  .details-below-meta .description-location,
  .details-below-meta .description-technique {
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .image-details .image-title,
  .image-details .image-container h1 {
    font-size: 16px;
  }

  .details-buy-button {
    width: 100%;
    font-size: 13px;
  }
}
/* ===== Details desktop layout: как старое расположение ===== */

@media (min-width: 821px) {
  .details-under-fotorama {
    width: 100%;

    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;

    text-align: left;
  }

  .details-medium-size-block,
  .details-year-block {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
  }

  .details-medium-size-block {
    text-align: left;
  }

  .details-year-block {
    text-align: right;
  }

  .details-description {
    width: 100%;

    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    text-align: left;
  }

  .details-purchase-row {
    width: auto;
    flex: 0 0 auto;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    text-align: left;
  }

  .details-below-meta {
    width: auto;
    flex: 0 1 auto;
    margin-left: auto;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;

    text-align: right;
  }

  .details-below-meta .description-location,
  .details-below-meta .description-technique {
    text-align: right;
  }
}

/* отступ между работой и похожими */
.related-slider {
  margin-top: 90px;
}