  /* Стили только для контейнера товара, не ломая body */
  .product-container {
    display: flex;
    max-width: 1400px; /* Ограничиваем ширину для красоты */
    margin: 0 auto;
    position: relative;
  }

  /* --- ГАЛЕРЕЯ --- */
.gallery {
  position: sticky; /* Магия: липнет при скролле */
    top: 0;
    width: 50%;
    height: 100vh; /* Занимает экран, пока мы в зоне карточки */
    overflow: hidden;
}

  .slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    height: 100%;
    scrollbar-width: none;
  }
  .slides::-webkit-scrollbar { display: none; }
  .slides section { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; }
  .slides img { width: 100%; height: 100%; object-fit: cover; display: block; object-position: center top; }

  /* --- ПРАВАЯ ЧАСТЬ --- */
  .details {
    width: 50%;
    padding: 40px;
    box-sizing: border-box;
    background: #fff;
  }

  .purchase-group { margin-bottom: 30px; }
  .desktop-title { font-size: 32px; margin: 0 0 20px 0; color: #000; }
  
  .cart-block button {
    width: 100%;
    padding: 18px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: 0.3s;
  }
  .cart-block button:hover { background: #333; }

  /* Скрываем мобильный оверлей на десктопе */
  .mobile-overlay { display: none; }

  /* --- МОБИЛЬНАЯ ВЕРСИЯ --- */
  @media (max-width: 768px) {
    .product-container {
      flex-direction: column;
    }

    .gallery {
      position: relative; /* На мобилках не липнет */
      top: 0;
      width: 100%;
      height: 80vh; /* Видно кусочек контента снизу */
    }

    .mobile-overlay {
      display: block;
      position: absolute;
      bottom: 40px;
      left: 5%;
      width: 90%;
      z-index: 20;
    }

    .mobile-overlay .desktop-title {
      color: white;
      text-shadow: 0 2px 10px rgba(0,0,0,0.7);
      font-size: 24px;
      margin-bottom: 10px;
    }

    .details {
      width: 100%;
      padding: 20px;
    }

    /* Прячем дубль заголовка в деталях на мобилке */
    .details .purchase-group { display: none; }
  }

  /* Для демонстрации футера */
  .footer-placeholder {
    height: 400px;
    background: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Навигация слайдера */
  .nav-dots {
    position: absolute; bottom: 15px; left: 50%;
    transform: translateX(-50%); display: flex; gap: 8px; z-index: 15;
  }
  .dot { width: 8px; height: 8px; background: rgba(255,255,255,0.4); border-radius: 50%; }
  .dot.active { background: #fff; transform: scale(1.2); }

  .arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.5); border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer; z-index: 10;
  }
  @media (max-width: 768px) { .arrow { display: none; } }