/* ========== Product Page Styles ========== */

.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(24px, 4vw, 48px) 0;
  max-width: 1280px;
  margin: 0 auto;
}

/* ========== Left Column: Image Slider ========== */

.product-page__media {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-page__main-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  max-height: 65vh;
  background: linear-gradient(180deg, rgba(12, 13, 17, 0.08) 0%, rgba(12, 13, 17, 0.02) 100%);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(12, 13, 17, 0.08);
  box-shadow: 0 24px 56px rgba(12, 13, 17, 0.12);
}

.product-page__main-slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  backface-visibility: hidden;
}

.product-page__main-slider-image {
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-page__main-slider-image.loaded {
  opacity: 1;
}

/* Стрелки слайдера */
.product-page__slider-arrow {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  background: rgba(12, 13, 17, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.product-page__slider-arrow:hover {
  background: rgba(6, 7, 9, 0.85);
  transform: scale(1.1);
  box-shadow: 0 20px 40px rgba(6, 7, 9, 0.28);
}

.product-page__slider-arrow svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2;
}

.product-page__slider-arrow--right {
  right: 12px;
  bottom: 12px;
}

/* Thumbnails */
.product-page__thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}

.product-page__thumbnail {
  width: 80px;
  height: 120px;
  aspect-ratio: 2/3;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(12, 13, 17, 0.12);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(180deg, rgba(12, 13, 17, 0.06) 0%, rgba(12, 13, 17, 0.02) 100%);
  flex-shrink: 0;
}

.product-page__thumbnail:hover {
  border-color: rgba(12, 13, 17, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(12, 13, 17, 0.14);
}

.product-page__thumbnail.active {
  border-color: rgba(12, 13, 17, 0.72);
  box-shadow: 0 14px 32px rgba(12, 13, 17, 0.18);
}

.product-page__thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-page__thumbnail-image.loaded {
  opacity: 1;
}

/* ========== Right Column: Product Info ========== */

.product-page__info {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  padding-top: clamp(12px, 2vw, 24px);
}

.product-page__brand {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-page__title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
}

.product-page__meta {
  display: flex;
  gap: 16px;
  margin: -8px 0 0;
  flex-wrap: wrap;
}

.product-page__code,
.product-page__sku {
  font-size: 13px;
  color: rgba(12, 13, 17, 0.56);
  letter-spacing: 0.06em;
  margin: 0;
  font-weight: 500;
}

.product-page__code:not(:last-child)::after {
  content: '|';
  margin-left: 16px;
  color: rgba(12, 13, 17, 0.2);
}

.product-page__description {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(12, 13, 17, 0.78);
  margin: 0;
}

.product-page__description p {
  margin: 0 0 12px 0;
}

.product-page__description p:last-child {
  margin-bottom: 0;
}

.product-page__description ul,
.product-page__description ol {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.product-page__description li {
  margin-bottom: 6px;
}

.product-page__price-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 13, 17, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(12, 13, 17, 0.08);
}

.product-page__price {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.product-page__cart-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Кнопка "В корзину" на странице товара */
.product-page__add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  padding: 0 28px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(6, 7, 9, 0.96);
  border-radius: 16px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 12px 32px rgba(6, 7, 9, 0.24);
}

.product-page__add-to-cart-btn:hover {
  background: rgba(0, 0, 0, 0.88);
  border-color: rgba(6, 7, 9, 1);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(6, 7, 9, 0.32);
}

.product-page__add-to-cart-btn.is-hidden {
  display: none;
}

/* Контроль количества на странице товара */
.product-page__quantity-control {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 54px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(12, 13, 17, 0.16);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(6, 7, 9, 0.14);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.product-page__quantity-control[hidden] {
  display: none;
}

.product-page__quantity-control.is-active {
  opacity: 1;
  transform: translateY(0);
}

.product-page__qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(6, 7, 9, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 13, 17, 0.04);
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.product-page__qty-btn:hover {
  background: rgba(12, 13, 17, 0.12);
  border-color: rgba(12, 13, 17, 0.32);
  color: var(--accent);
  transform: scale(1.05);
}

.product-page__qty-btn:active {
  transform: scale(0.98);
}

.product-page__qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ========== Responsive Design ========== */

@media (max-width: 1024px) {
  .product-page {
    grid-template-columns: 1fr;
    gap: clamp(28px, 4vw, 40px);
  }

  .product-page__info {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  .product-page__main-image {
    aspect-ratio: 2/3;
    max-height: 55vh;
  }

  .product-page__slider-arrow {
    width: 38px;
    height: 38px;
    right: 12px;
    bottom: 12px;
  }

  .product-page__slider-arrow--right {
    right: 12px;
    bottom: 12px;
  }

  .product-page__thumbnail {
    width: 70px;
    height: 105px;
    aspect-ratio: 2/3;
  }

  .product-page__price-section {
    position: sticky;
    bottom: 0;
    z-index: 50;
    margin: 0 -20px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(12, 13, 17, 0.12);
  }
}

@media (max-width: 480px) {
  .product-page {
    padding: 16px 0;
  }

  .product-page__main-image {
    border-radius: 18px;
    aspect-ratio: 2/3;
    max-height: 45vh;
  }

  .product-page__title {
    font-size: 22px;
  }

  .product-page__price {
    font-size: 26px;
  }

  .product-page__add-to-cart-btn,
  .product-page__quantity-control {
    height: 50px;
  }

  .product-page__thumbnail {
    width: 60px;
    height: 90px;
    aspect-ratio: 2/3;
  }

  .product-page__meta {
    flex-direction: column;
    gap: 4px;
  }

  .product-page__code:not(:last-child)::after {
    display: none;
  }
}

/* Image Loading Indicator */
.product-page__image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.product-page__image-loading::before,
.product-page__image-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.product-page__image-loading::before {
  background: conic-gradient(#d8d8d8 0deg, #d8d8d8 360deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

.product-page__image-loading::after {
  background: conic-gradient(#111 0deg 96deg, transparent 96deg 360deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  transform-origin: 50% 50%;
  animation: product-image-loading-spin 0.8s linear infinite;
}

@keyframes product-image-loading-spin {
  to { transform: rotate(360deg); }
}

/* Image Loading Indicator for Cart */
.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  z-index: 2;
}

.image-loading::before,
.image-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.image-loading::before {
  background: conic-gradient(#d8d8d8 0deg, #d8d8d8 360deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

.image-loading::after {
  background: conic-gradient(#111 0deg 96deg, transparent 96deg 360deg);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  transform-origin: 50% 50%;
  animation: image-loading-spin 0.8s linear infinite;
}

@keyframes image-loading-spin {
  to { transform: rotate(360deg); }
}

/* Hide loading indicator when images are loaded */
.image-loading.is-hidden {
  display: none;
}

/* ========== Product Modal Styles ========== */

.product-modal {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  display: none;
}

.product-modal.is-open {
  display: block;
}

.product-modal__overlay {
  position: fixed;
  inset: var(--header-height) 0 0;
  background: rgba(12, 13, 17, 0.55);
  backdrop-filter: blur(6px);
  touch-action: pan-y;
}

.product-modal__container {
  position: fixed;
  inset: var(--header-height) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.product-modal__frame,
.product-modal__frame_product {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  width: min(860px, 100%);
  background: rgba(255, 255, 255, 1);
  border: 1px solid rgba(17, 17, 17, 0.08);
  padding: clamp(26px, 2vw, 32px) clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 1.4vw, 28px);
  align-items: stretch;
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 0;
  scrollbar-gutter: stable;
  box-shadow: 0 -18px 36px rgba(6, 7, 9, 0.12), 0 32px 64px rgba(15, 16, 24, 0.12);
  /* height: calc(100vh - var(--header-height)); */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  height: calc(100% - var(--header-height));
  padding-bottom: 50px;
}

.product-modal__frame_product {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.product-modal__frame_product .product-modal__content {
  box-shadow: 0 8px 32px rgba(6, 7, 9, 0.08), 0 16px 48px rgba(15, 16, 24, 0.08);
  border-radius: 24px;
}

.product-modal__frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 7, 9, 0.18) 0%, rgba(6, 7, 9, 0) 100%);
  opacity: 0.4;
}

.product-modal__frame > *,
.product-modal__frame_product > * {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 1280px) {
  .product-modal__frame,
  .product-modal__frame_product {
    --product-modal-scale: 0.96;
  }

  .product-modal__frame .product-modal__content,
  .product-modal__frame_product .product-modal__content {
    transform: scale(var(--product-modal-scale));
    transform-origin: top center;
  }

  .product-modal__frame .product-modal__close,
  .product-modal__frame_product .product-modal__close {
    transform: scale(var(--product-modal-scale));
    transform-origin: top right;
  }
}

.product-modal__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
}

.product-modal__price-row {
  display: flex;
  gap: clamp(18px, 2.4vw, 24px);
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: rgba(12, 13, 17, 0.04);
  border-radius: 14px;
  padding: 12px;
}

.product-modal__price-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-modal__stock-info {
  font-size: 13px;
  color: rgba(12, 13, 17, 0.64);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.product-modal__price {
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 13, 17, 0.56);
  margin: 0;
}

.product-modal__brand_product {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 13, 17, 0.56);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.product-modal__brand_product:focus-visible {
  outline: none;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.product-modal__brand_product:hover {
  color: var(--accent);
}

.product-modal__brand--placeholder {
  visibility: hidden;
}

.product-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
  grid-column: 3;
  justify-self: end;
}

.product-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(6, 7, 9, 0.14);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  outline: none;
  z-index: 10;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.product-modal__close:focus {
  outline: none;
}

.product-modal__close:active {
  background: rgba(0, 0, 0, 0.95);
  transform: scale(0.95);
}

.product-modal__close svg {
  width: 27px;
  height: 27px;
  color: rgba(255, 255, 255, 0.98);
}

.product-modal__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(20px, 3vw, 36px);
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 13, 17, 0.08);
  border-radius: 20px 20px 0 0;
  box-sizing: border-box;
}

.product-modal__media {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vw, 22px);
  width: 100%;
}

.product-modal__media {
  align-items: center;
  max-width: 100%;
  width: 100%;
}

.product-modal__sidebar {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.4vw, 28px);
  max-width: min(360px, 100%);
  width: 100%;
  height: 100%;
}

.product-modal__sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.product-image-slider--modal {
  position: relative;
  width: 100%;
  max-width: min(540px, 100%);
  aspect-ratio: 2/3;
  background: linear-gradient(180deg, rgba(12, 13, 17, 0.08) 0%, rgba(12, 13, 17, 0.02) 100%);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 56px rgba(12, 13, 17, 0.12);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.product-image-slider--modal .slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}

.product-image-slider--modal .slider-track img {
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-image-slider--modal .slider-track img.is-active {
  opacity: 1;
  transform: scale(1.02);
  will-change: opacity, transform;
}

.product-image-slider--modal .slider-arrow {
  opacity: 1;
  width: 38px;
  height: 38px;
  box-shadow: 0 20px 44px rgba(12, 13, 17, 0.22);
  top: auto;
  bottom: clamp(12px, 3vw, 12px);
  transform: none;
}

.product-image-slider--modal .slider-arrow-right {
  right: clamp(12px, 3vw, 12px);
  left: auto;
}

.product-image-slider--modal .slider-arrow:hover {
  transform: scale(1.08);
}

.product-image-slider__thumbnails {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  overflow-x: auto;
  padding: 4px 0;
}

.product-image-slider__thumbnail {
  width: 80px;
  height: 120px;
  aspect-ratio: 2/3;
  border-radius: 14px;
  border: 2px solid rgba(12, 13, 17, 0.12);
  background: linear-gradient(180deg, rgba(12, 13, 17, 0.06) 0%, rgba(12, 13, 17, 0.02) 100%);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-image-slider__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-slider__thumbnail:hover {
  border-color: rgba(12, 13, 17, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(12, 13, 17, 0.14);
}

.product-image-slider__thumbnail.is-active {
  border-color: rgba(12, 13, 17, 0.72);
  box-shadow: 0 14px 32px rgba(12, 13, 17, 0.18);
}

body.product-modal-open .product-image-slider:not(.product-image-slider--modal) {
  pointer-events: none;
  touch-action: none;
}

.product-modal__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: left;
}

.product-modal__availability {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--accent-contrast);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
  opacity: 0.9;
}

.product-modal__availability::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(125, 214, 154, 0.95), rgba(86, 178, 126, 0.95));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.product-modal__availability--out::before {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.95), rgba(255, 99, 72, 0.95));
}

.product-modal__sale-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--accent-contrast);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
  opacity: 0.9;
}

.product-modal__sale-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.95), rgba(255, 99, 72, 0.95));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.product-modal__identifiers {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.product-modal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
}

.product-modal__meta-item {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(12, 13, 17, 0.56);
  text-transform: uppercase;
}

.product-modal__description {
  font-size: 14px;
  line-height: 1.7;
  display: grid;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  color: rgba(12, 13, 17, 0.88);
}

.product-modal__description-link {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.product-modal__description-link-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 13, 17, 0.08);
  color: rgba(12, 13, 17, 0.72);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  opacity: 0.5;
}

.product-modal__description-link-btn:hover {
  background: rgba(12, 13, 17, 0.14);
  color: rgba(12, 13, 17, 0.92);
  transform: translateY(-1px);
}

.product-modal__description-link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.product-modal__description p,
.product-modal__reviews p,
.product-modal__characteristics p {
  margin: 0;
}

.product-modal__details {
  box-sizing: border-box;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 13, 17, 0.08);
  border-radius: 0 0 20px 20px;
  display: grid;
  gap: 10px;
  margin-top: -1px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(12, 13, 17, 0.88);
}

.product-modal__tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 10px;
  background: rgba(12, 13, 17, 0.04);
  padding: 12px;
  border-radius: 14px;
  position: relative;
}

.product-modal__tab {
  position: relative;
  flex: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  padding: clamp(10px, 2.4vw, 14px) clamp(14px, 3vw, 18px);
  font-family: var(--font-heading);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(12, 13, 17, 0.56);
  text-align: left;
  overflow: hidden;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .product-modal__tab:hover {
    color: #000;
  }
}

.product-modal__tab.is-active {
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
  background: #fff;
  color: rgba(12, 13, 17, 0.92);
  
}

.product-modal__tab--moving {
  animation: product-modal-tab-move 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
}

.product-modal__tab--moving::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
}

.product-modal__tab--moving.product-modal__tab::after {
  opacity: 1;
}

@keyframes product-modal-tab-move {
  0% {
    transform: translateY(-8px);
    opacity: 0;
  }

  60% {
    transform: translateY(4px);
    opacity: 1;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.product-modal__tab:focus {
  outline: none;
}

.product-modal__tab-panels {
  display: flex;
  flex-direction: column;
}

.product-modal__tab-panel {
  display: none;
}

.product-modal__tab-panel.is-active {
  display: block;
}

.product-modal__characteristics {
  font-size: 14px;
  line-height: 1.7;
  display: grid;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  color: rgba(12, 13, 17, 0.88);
}

.product-modal__characteristics-list {
  display: grid;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.product-modal__characteristic-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0px 10px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.product-modal__characteristic-name {
  font-size: 14px;
  font-weight: 400;
  flex-shrink: 1;
  flex-basis: auto;
  min-width: 0;
  max-width: 50%;
  letter-spacing: 0.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.5;
  color: rgba(12, 13, 17, 0.72);
}

.product-modal__characteristic-item--short-value .product-modal__characteristic-name {
  max-width: 75%;
}

.product-modal__characteristic-value {
  font-size: 14px;
  font-weight: 400;
  color: rgba(12, 13, 17, 0.88);
  text-align: right;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.product-modal__characteristics-empty {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(12, 13, 17, 0.56);
  text-align: center;
  padding: 24px;
  margin: 0;
}

.product-modal__reviews {
  font-size: 14px;
  line-height: 1.7;
  display: grid;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  color: rgba(12, 13, 17, 0.88);
}

.product-modal__review-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(12, 13, 17, 0.04);
}

.product-modal__review-form > div {
  display: grid;
  gap: 6px;
}

.product-modal__review-label {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 13, 17, 0.6);
}

.product-modal__review-input,
.product-modal__review-select,
.product-modal__review-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(12, 13, 17, 0.16);
  background: rgba(255, 255, 255, 0.96);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-modal__review-input:focus,
.product-modal__review-select:focus,
.product-modal__review-textarea:focus {
  outline: none;
  border-color: rgba(12, 13, 17, 0.32);
  box-shadow: 0 0 0 2px rgba(12, 13, 17, 0.12);
}

.product-modal__review-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(12, 13, 17, 0.32) 50%),
    linear-gradient(135deg, rgba(12, 13, 17, 0.32) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 4px), calc(100% - 12px) calc(50% - 4px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.product-modal__review-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.product-modal__review-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(6, 7, 9, 0.18);
}

.product-modal__review-submit:hover {
  background: rgba(0, 0, 0, 0.88);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(6, 7, 9, 0.22);
}

.product-modal__review-submit:disabled {
  background: rgba(12, 13, 17, 0.28);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.product-modal__review-feedback {
  margin: 0;
  font-size: 13px;
  color: rgba(12, 13, 17, 0.72);
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.product-modal__review-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.product-modal__details [hidden] {
  display: none !important;
}

.product-modal__price {
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text);
  text-align: center;
  flex: 0 0 auto;
  margin-left: 4px;
}

.product-modal__actions {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 16px);
  width: 100%;
}

.product-modal__actions--inline {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 1.6vw, 16px);
  width: auto;
  flex: 0 1 auto;
  flex-wrap: nowrap;
}

.product-modal__actions--inline .cart-actions--modal {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 14px);
  width: auto;
}

.product-modal__actions--inline .add-to-cart-btn {
  width: auto;
  max-width: none;
  margin: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.product-modal__actions--inline .add-to-cart-btn--modal {
  min-width: clamp(120px, 14.4vw, 160px);
  background: white;
  color: var(--text);
  border: 0px solid rgba(6, 7, 9, 0.24);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
  font-size: 13px;
}

.product-modal__actions--inline .quantity-control {
  width: auto;
  min-width: 0;
  flex-shrink: 1;
  transform: none;
  opacity: 0;
  pointer-events: none;
}

.product-modal__actions--inline .quantity-control--modal {
  border-radius: 14px;
  min-width: clamp(120px, 14.4vw, 160px);
}

.product-modal__actions--inline .quantity-control--modal.is-active {
  opacity: 1;
  pointer-events: auto;
  display: inline-flex;
  background: white;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
}

.product-modal__price-row .product-modal__actions--inline {
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .product-modal__price-row {
    gap: clamp(12px, 4vw, 18px);
  }

  .product-modal__price-row .product-modal__price {
    font-size: clamp(22px, 6vw, 25px);
  }

  .product-modal__price-row .product-modal__actions--inline {
    width: auto;
    justify-content: flex-end;
  }

  .product-modal__actions--inline .cart-actions--modal {
    gap: clamp(10px, 4vw, 16px);
  }
}
.product-modal__add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(42px, 5.2vw, 48px);
  padding: 0 clamp(22px, 4vw, 30px);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid transparent;
  border-radius: 14px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 32px rgba(6, 7, 9, 0.24);
}

.product-modal__add-to-cart:hover {
  background: rgba(0, 0, 0, 0.88);
}

.product-modal__quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: clamp(42px, 5.2vw, 48px);
  padding: 0 clamp(11.2px, 2.4vw, 16px);
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(6, 7, 9, 0.24);
}

.product-modal__quantity[hidden] {
  display: none;
}

.product-modal__qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(12, 13, 17, 0.16);
  background: rgba(255, 255, 255, 0.98);
  color: rgba(12, 13, 17, 0.88);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.product-modal__qty-btn:hover {
  background: rgba(12, 13, 17, 0.12);
  border-color: rgba(12, 13, 17, 0.28);
  transform: scale(1.05);
}

.product-modal__qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 1024px) {
  .product-modal__frame,
  .product-modal__frame_product {
    padding: clamp(22px, 3.8vw, 44px) clamp(14px, 6vw, 28px);
    width: min(640px, 100%);
  }

  .product-modal__frame > *,
  .product-modal__frame_product > * {
    width: 100%;
  }

  .product-modal__body {
    gap: clamp(20px, 3vw, 32px);
    display: flex;
    flex-direction: column;
  }

  .product-modal__media {
    max-width: 100%;
    order: 1;
  }

  .product-modal__sidebar {
    max-width: 100%;
    order: 2;
  }

}

@media (max-width: 768px) {
  .product-modal {
    top: var(--header-height);
    z-index: 260;
  }

  .product-modal__overlay {
    inset: var(--header-height) 0 0;
    z-index: 250;
    touch-action: pan-y;
  }

  .product-modal__container {
    inset: var(--header-height) 0 0;
    padding: 0;
    z-index: 255;
  }

  .product-modal__frame,
  .product-modal__frame_product {
    top: var(--header-height);
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    padding: clamp(12px, 4vw, 20px) clamp(12px, 4vw, 16px);
    padding-top: clamp(16px, 5vw, 24px);
    padding-bottom: clamp(16px, 4vw, 24px);
    border-radius: 0;
    z-index: 260;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .product-modal__characteristic-item {
    padding: 0px 5px 0 5px;
  }

  /* Убираем торчащую полосу над картинкой */
  .product-modal__frame::before {
    display: none;
  }


  .product-modal__reviews p {
    padding: 0 5px;
  }
  .product-modal__details {
    border: none;
  }

  .product-modal__description {
    padding: 0px 5px 10px 5px;
    margin-top: -5px;
  }

  .product-modal__body {
    border: none;
    padding: clamp(16px, 3vw, 20px);
    gap: clamp(16px, 3vw, 24px);
  }

  .product-modal__header {
    gap: clamp(10px, 2vw, 14px);
    padding: 0;
  }

  .product-modal__media {
    width: 100%;
    max-width: 100%;
    gap: clamp(12px, 2vw, 16px);
  }

  .product-modal__sidebar {
    width: 100%;
    max-width: 100%;
    gap: clamp(14px, 2vw, 18px);
  }

  .product-modal__close {
    margin: 0;
    position: fixed;
    top: clamp(109px, 3vw, 16px);
    right: clamp(12px, 3vw, 16px);
    border-radius: 12px;
    z-index: 270;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  .product-modal__close svg {
    width: 22px;
    height: 22px;
  }

  .product-modal__frame > * {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    padding: 0 35px 0 10px;
  }

  .product-image-slider--modal {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 16px;
  }

  .product-modal__slider {
    aspect-ratio: 2/3;
    max-width: 100%;
  }

  .product-modal__details {
    padding: clamp(12px, 0vw, 20px);
    margin-bottom: 50px;
  }

  .product-modal__price {
    font-size: clamp(20px, 5vw, 28px);
  }

  .product-modal__title {
    font-size: clamp(16px, 2vw, 24px);
    line-height: 1.3;
  }
  .product-modal__description {
    font-size: 13px;
  }
}

/* Дополнительные оптимизации для очень маленьких экранов */
@media (max-width: 480px) {
  .product-modal__frame {
    padding: clamp(10px, 3vw, 16px) clamp(10px, 3vw, 14px);
    padding-top: clamp(14px, 4vw, 20px);
    padding-bottom: clamp(14px, 3vw, 20px);
  }

  .product-modal__characteristic-name {
    font-size: 12px;
  }

  .product-modal__characteristic-value {
    font-size: 12px;
  }

  .product-modal__close {
    top: clamp(80px, 2.5vw, 14px);
    right: clamp(18px, 2.6vw, 14px);
    width: 42px;
    height: 42px;
  }

  .product-modal__close svg {
    width: 20px;
    height: 20px;
  }

  .product-modal__body {
    padding: clamp(12px, 2.5vw, 16px);
    gap: clamp(12px, 2.5vw, 18px);
  }
  .product-modal__frame {
    padding: 0 30px 0 10px;
  }

  .product-image-slider--modal {
    border-radius: 12px;
  }
}

@media (max-width: 420px) {
  .product-modal__frame {
    padding: 0 10px 0 10px;
  }
  .product-modal__close {
    top: clamp(81.5px, 2.5vw, 14px);
    right: clamp(10px, 2.6vw, 14px);
    width: 40px;
    height: 40px;
  }
  .product-modal__availability {
    font-size: 10px;
  }
  .product-modal__sale-badge {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .product-modal__close {
    top: clamp(79.5px, 2.5vw, 14px);
    right: clamp(12px, 2.6vw, 14px);
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* ========== Product Modal Loading Indicator ========== */

.product-modal__loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
  backdrop-filter: blur(2px);
}

.product-modal__loading.is-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .product-modal__loading {
    display: none;
    pointer-events: none;
  }
}

.product-modal__loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top: 4px solid #fff;
  border-right: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.product-modal__new-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--accent-contrast);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 6px rgba(6, 7, 9, 0.14);
  opacity: 0.9;
}

.product-modal__new-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(67, 160, 71, 0.95));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

@media (max-width: 420px) {
  .product-modal__new-badge {
    font-size: 10px;
  }
}

/* Product Page Styles (Non-modal) */
.product-page__frame {
  position: relative;
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.product-page__content {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(6, 7, 9, 0.08), 0 16px 48px rgba(15, 16, 24, 0.08);
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .product-page__content {
    padding: 32px;
  }
}

@media (min-width: 1280px) {
  .product-page__frame {
    width: min(1200px, 100%);
  }
}

.low-end .product-page__content,
.low-end .product-page__thumbnail,
.low-end .product-page__slider-arrow {
  box-shadow: none !important;
}
