@import 'reset.css';
@import 'fonts.css';
@import 'global.css';
@import 'header.css';
@import 'footer.css';
@import 'cart.css';

.back-btn {
  display: inline-flex;
  border: 1px solid var(--gray-medium);
  color: var(--gray-medium);
  align-items: center;
  padding: clamp(0.5rem, 1vw, 0.7rem) clamp(1rem, 1.5vw, 3.2rem);
  gap: clamp(1rem, 1vw, 1.2rem);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  text-wrap: nowrap;
  margin-bottom: clamp(1.5rem, 3vw, 4rem);
}

.back-btn svg {
  width: clamp(1.2rem, 2vw, 3rem);
}

.main {
  margin: clamp(3rem, 5vw, 7rem) 0;
}

.product {}

.product__inner {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: clamp(2rem, 4vw, 5rem);
}

.product__gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 3vw, 3.5rem);
}

.product__image {}

.product__image--main {
  max-width: 770px;
  max-height: clamp(30rem, 35vw, 77rem);
  aspect-ratio: 1 / 1;
  border: 2px solid var(--border-color);
}

.product__image--main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.product__thumbnails {
  display: flex;
  justify-content: space-evenly;
  gap: clamp(2rem, 4vw, 5rem);
}

.product__image--thumb {
  max-width: 140px;
  max-height: 140px;
}

.product__image--thumb img {
  width: 100%;
  height: 100%;
}

.product__info {}

.product__title {
  font-size: clamp(2.5rem, 4vw, 6rem);
  margin-bottom: clamp(1rem, 1.5vw, 1.8rem);
}

/* Скрываем мобильный заголовок на больших экранах */
.product__title--mobile {
  display: none;
}

.product__subtitle {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  margin-bottom: clamp(2rem, 4vw, 5rem);
}

.product__price {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px clamp(2rem, 3vw, 4rem);
  font-size: clamp(2.4rem, 3vw, 3.8rem);
  font-weight: 600;
  margin-bottom: clamp(1.6rem, 2vw, 2.6rem);
}

.product__price span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #EF9325;
}

.product__price span svg {
  width: clamp(2rem, 2vw, 2.9rem);
  height: clamp(2.2rem, 2vw, 3.4rem);
}

.product__buy-btn {
  grid-column: 1 / 3;
  background-color: #982BF7;
  color: #FFF;
  padding: 10px;
  font-size: clamp(1.6rem, 2vw, 2rem);
}

.product__options {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.product__option {
  padding: clamp(1.6rem, 2vw, 2.5rem) 0;
  border-top: 2px solid #737373;
  color: #737373;
}

.product__option:last-child {
  border-bottom: 2px solid #737373;
}

.product__option--color {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 1.5vw, 1.8rem);
}

.color-list {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 1.8rem);
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.color-item svg {
  width: 25px;
  height: 21px;
}

.product__option--pieces {}

.product__option--box-size {}

.product__description {
  grid-column: 1 / 3;
  margin-top: clamp(3rem, 4vw, 6rem);
}

.product__description-text {
  max-width: 1370px;
  font-size: clamp(1.6rem, 2vw, 2.5rem);
  font-weight: 400;
}

.product__description-text span {
  font-weight: 600;
}

.product__description-btn {
  margin-top: clamp(2rem, 3vw, 4rem);
  display: inline-flex;
  background-color: #982BF7;
  color: #fff;
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  padding: 5px 10px;
}

.product__related {
  grid-column: 1 / 3;
}

.related__title {
  font-size: clamp(2rem, 2vw, 2.4rem);
  margin-bottom: clamp(1.6rem, 2vw, 2.2rem);
}

.related__list {
  display: grid;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-content: center;
}

.related__item {
  aspect-ratio: 1 / 1;
  max-width: 300px;
  width: 100%;
}

.related__img {
  max-width: 300px;
  max-height: 300px;
  width: 100%;
}

.related__img img {
  background-color: #FFFFC7;
  border: 1px solid #8F8F8F;
  width: 100%;
  height: 100%;
}

.related__item-title {
  font-size: clamp(1.2rem, 1.5vw, 1.5rem);
  color: #797979;
}

/* Стили для секции инструкции */
.product__instruction {
  margin-top: 1rem;
  width: 100%;
}

.instruction__title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.instruction__controls {
  margin-bottom: 0;
}

.instruction__btn {
  background: none;
  color: var(--main-text-color);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  margin-bottom: 0.5rem;
  text-align: center;
}

.instruction__btn--link {
  text-decoration: none;
  display: block;
}

/* Полноэкранный режим */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-container {
  width: 95vw;
  height: 95vh;
  background-color: white;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fullscreen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

.fullscreen-title {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: #333;
  margin: 0;
  font-weight: 600;
}

.close-fullscreen-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--gray-medium);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-fullscreen-btn:hover {
  color: var(--accent-color);
}

.fullscreen-frame-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.fullscreen-frame {
  width: 100%;
  height: 100%;
  border: none;
  background-color: white;
}