.main {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0.875rem 3rem 12.5rem;
  /*gap: 1.5rem;*/
  gap: 0.1rem;
}

/*.card-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.card-header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}*/

/*.link {
  color: #667085;
  line-height: 1.4;
  letter-spacing: -0.05em;
  transition: all 0.2s ease;
}

.current-link {
  color: #000000;
}*/

.main-link:hover {
  color: black;
  cursor: pointer;
}

.card-container {
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  gap: 5rem;
  margin: auto;
  padding-top: 60px;
}

.card-details {
  display: flex;
  gap: 2.5rem;
  max-height: 60rem;
  /* width: 100%; */
  margin: auto;
}

.card-gallery {
  display: flex;
  gap: 1rem;
  height: 42.5rem;
  width: 47.375rem;
}

.card-gallery--list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 8.75rem;
  height: 42.5rem;
  overflow-y: auto;
}

.card-gallery--list::-webkit-scrollbar {
  display: none;
}

.card-gallery--list-item {
  width: 100%;
  min-height: 11.25rem;
  max-height: 11.25rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.card-gallery--list-item:hover {
  border: 1px solid #000000;
  cursor: pointer;
}

.list-item--active {
  border: 1px solid #000000;
}

.card-gallery--list-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.card-gallery--main-image {
  width: 37.625rem;
  height: 100%;
  object-fit: cover;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: flex-start;
  width: 34.313rem;
}

.card-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #121011;
}

.card-title-container h1,
.card-title-container h2 {
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.card-title-container h2 {
  font-size: 1rem;
}

.card-title-container h1 {
  font-size: 1.5rem;
}

.card-price-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.card-price-container p {
  font-size: 2rem;
  letter-spacing: -0.05em;
  color: black;
}

.card-price-container div {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-to-cart-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  color: white;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.03em;
  background-color: #252324;
  border: none;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.add-to-cart-btn:hover {
  background-color: black;
}

.card-quantitiy {
  display: flex;
  justify-content: space-between;
  padding: 0.89rem;
  border: 1px solid black;
  border-radius: 0.25rem;
  max-height: 100%;
  max-width: 8.313rem;
}

.card-quantitiy button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  width: 1.5rem;
  height: 1.5rem;
  background-color: transparent;
  transition: all 0.2s ease;
}

.card-quantitiy button:hover {
  opacity: 0.7;
}

.card-quantitiy img {
  width: 0.875rem;
  height: 0.875rem;
}

.card-description-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1.5rem;
}

.discount-info-container {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
  border: none;
  border-radius: 0.2rem;
  background-color: #f1ebe6;
  width: 100%;
  color: #121011;
}

.discount-info-container h3 {
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.discount-tiers-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.discount-tiers-list--item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #667085;
}

.discount-info-note {
  font-size: 0.875rem;
  line-height: 1.4;
  letter-spacing: -0.05em;
  color: black;
}

.card-description {
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.05em;
}

.dimensions-container,
.specifications-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1rem;
}

.dimensions--title {
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: -0.05em;
  color: #121011;
}

.dimensions--list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dimensions--list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eaecf0;
  padding: 0.75rem 0;
}

.dimensions--list-item span {
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.05em;
  color: #121011;
}

.dimensions--list-item span:first-child {
  color: #475467;
}

/* ************************************************************************ */

.related-products {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  position: relative;
}

.related-products h2 {
  font-size: 3.5rem;
  letter-spacing: -0.05em;
}

.related-products__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
}

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

.related-products__item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 30.688rem;
  max-width: 21.5rem;
  flex-shrink: 0;
  position: relative;
}

.related-products__link {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #121011;
  transition: all 0.2s ease;
  text-decoration: none;
  flex: 1;
}

.related-products__link:hover {
  color: #e64410;
}

.related-products__image-wrapper {
  width: 100%;
  display: inline-block;
}

.related-products__image-wrapper img {
  width: 100%;
  height: 23.125rem;
  object-fit: cover;
  display: block;
}

.related-products__cart-btn {
  position: absolute;
  bottom: 8.5rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.related-products__cart-btn img {
  width: 1.25rem !important;
  height: 1.25rem !important;
  object-fit: contain;
  transition: filter 0.3s ease;
  filter: brightness(0);
  pointer-events: none;
}

.related-products__item:hover .related-products__cart-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.related-products__cart-btn:hover {
  background-color: #e64410;
}

.related-products__cart-btn:hover img {
  filter: brightness(0) invert(1);
}

.related-products__cart-btn:active {
  transform: scale(0.95);
}

.related-products__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-products__product-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.related-products__product-info h4,
.related-products__product-info h3,
.related-products__price {
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.related-products__product-info h4 {
  font-size: 1rem;
}

.related-products__product-info h3,
.related-products__price {
  font-size: 1.5rem;
}

.related-products__list--slider-btn {
  position: absolute;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background-color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prev-btn {
  left: -1.5rem;
}

.prev-btn img {
  transform: rotate(180deg);
}

.next-btn {
  right: -1.5rem;
}

.related-products__list--slider-btn img {
  filter: invert(1);
  transition: filter 0.3s ease;
}

.related-products__list--slider-btn:hover {
  background-color: #e64410;
}

.related-products__list--slider-btn:hover img {
  filter: invert(0);
}
/* ********************************************************************** */

.related-products {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  position: relative;
}

.related-products h2 {
  font-size: 3.5rem;
  letter-spacing: -0.05em;
}

.related-products__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
}

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

.catalog__list-item {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 33.688rem;
  max-width: 21.5rem;
  flex-shrink: 0;
  position: relative;
}

.catalog__list-link {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: #121011;
  transition: all 0.2s ease;
  text-decoration: none;
  flex: 1;
}

.catalog__list-link:hover {
  color: #e64410;
}

.catalog__list-image-wrapper {
  width: 100%;
  display: inline-block;
}

.catalog__list-image-wrapper img {
  width: 100%;
  height: 23.125rem;
  object-fit: cover;
  display: block;
}

.catalog__list-cart-btn {
  position: absolute;
  bottom: 11.5rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.catalog__list-cart-btn img {
  width: 1.25rem !important;
  height: 1.25rem !important;
  object-fit: contain;
  transition: filter 0.3s ease;
  filter: brightness(0);
  pointer-events: none;
}

.catalog__list-item:hover .catalog__list-cart-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.catalog__list-cart-btn:hover {
  background-color: #e64410;
}

.catalog__list-cart-btn:hover img {
  filter: brightness(0) invert(1);
}

.catalog__list-cart-btn:active {
  transform: scale(0.95);
}

.list-item__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-item__product-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-item__product-info h4,
.list-item__product-info h3,
.list-item__price {
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.list-item__product-info h4 {
  font-size: 1rem;
}

.list-item__product-info h3,
.list-item__price {
  font-size: 1.5rem;
}

.related-products__list--slider-btn {
  position: absolute;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background-color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prev-btn {
  left: -1.5rem;
}

.prev-btn img {
  transform: rotate(180deg);
}

.next-btn {
  right: -1.5rem;
}

.related-products__list--slider-btn img {
  filter: invert(1);
  transition: filter 0.3s ease;
}

.related-products__list--slider-btn:hover {
  background-color: #e64410;
}

.related-products__list--slider-btn:hover img {
  filter: invert(0);
}
/* ********************************************************************** */

.cart-notification {
  position: fixed;
  top: 1rem;
  right: 4rem;
  width: 26.188rem;
  height: 6rem;
  background-color: #fcf7f3;
  box-shadow: 0px 4px 10px 0px #7a7a7a1a;
  box-shadow: 0px 0px 10px 0px #b9b9b940;
  border: none;
  border-radius: 0.5rem;
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.cart-notification__container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  position: relative;
}

.notification-image {
  width: 5rem;
  height: 5rem;
  border: none;
  border-radius: 0.25rem;
  object-fit: cover;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #121011;
}

.notification-content span {
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.notification-content a {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -0.05em;
  color: #475467;
  border-bottom: 1px solid #475467;
  display: block;
  width: fit-content;
  transition: all 0.2s ease;
}

.notification-content a:hover {
  color: #121011;
  border-bottom: 1px solid #121011;
}

.cart-notification--close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: none;
  width: 1.5rem;
  height: 1.5rem;
  transition: all 0.2s ease;
}

.cart-notification--close-btn:hover {
  opacity: 0.7;
}

/* Адаптив  */

@media (max-width: 960px) {
  .main {
    padding: 0.875rem 3rem 12.5rem 3rem;
  }

  .card-container {
    margin: 0;
    gap: 0;
  }

  .card-details {
    flex-direction: column;
    max-height: none;
    gap: 2rem;
  }

  .card-gallery {
    width: 100%;
    height: auto;
    flex-direction: column;
  }

  .card-gallery--list {
    flex-direction: row;
    width: 100%;
    height: 42.5rem;
    overflow-x: auto;
    gap: 0.75rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .card-gallery--list::-webkit-scrollbar {
    display: none;
  }

  .card-gallery--list-item {
    min-width: 100%;
    max-width: 100%;
    min-height: 42.5rem;
    max-height: 42.5rem;
    scroll-snap-align: start;
  }

  .card-gallery--list-item:hover {
    border: none;
  }

  .list-item--active {
    border: none;
  }

  .card-gallery--main-image {
    display: none;
  }

  .card-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    order: 2;
  }

  .card-gallery__dots span {
    width: 0.375rem;
    height: 0.375rem;
    background-color: #d1d5db;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
  }

  .card-gallery__dots span.active {
    background-color: #475467;
  }

  .card-info {
    width: 100%;
    gap: 2rem;
  }

  .card-price-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eaecf0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .card-price-container p {
    font-size: 1.5rem;
    margin: 0;
    white-space: nowrap;
  }

  .card-price-container > div {
    width: fit-content;
  }

  .add-to-cart-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-width: 9.063rem;
  }

  .card-quantitiy {
    min-width: 8rem;
    height: 3.5rem;
  }

  .card-quantitiy button {
    width: 1.25rem;
    height: 1.25rem;
  }

  .card-description-container {
    margin-bottom: 5rem;
  }

  .discount-tiers-list {
    gap: 1rem;
  }

  .related-products {
    gap: 2rem;
  }

  .related-products h2 {
    font-size: 3.5rem;
  }

  .related-products__list {
    gap: 1rem;
  }

  .related-products__product-info h3,
  .related-products__price {
    font-size: 1.5rem;
  }

  .related-products__cart-btn {
    bottom: 9rem;
    width: 2.5rem;
    height: 2.5rem;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .related-products__list--slider-btn {
    display: none;
  }

  .cart-notification {
    right: 1rem;
    max-width: 26.188rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 0.875rem 1rem 12.5rem;
  }

  .card-header {
    gap: 1rem;
    /*margin-bottom: 1.5rem;*/
  }

  .card-header-nav {
    overflow-x: auto;
    gap: 0.5rem;
  }

  .card-header-nav .link,
  .card-header-nav span {
    font-size: 1rem;
    /*display: block;*/
    min-width: fit-content;
  }

  .card-header-nav::-webkit-scrollbar {
    display: none;
  }

  .card-gallery {
    width: 100%;
    gap: 0.75rem;
    height: 24.5rem;
  }

  .card-gallery--list {
    gap: 0.5rem;
    height: 24.5rem;
  }

  .card-gallery--list-item {
    min-width: 100%;
    max-width: 100%;
    max-height: 22rem;
    min-height: 22rem;
  }

  .card-title-container h1 {
    font-size: 1.25rem;
  }

  .card-title-container h2 {
    font-size: 0.875rem;
  }

  .related-products__cart-btn {
    bottom: 9.25rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .related-products__cart-btn img {
    width: 1rem !important;
    height: 1rem !important;
  }

  .discount-info-container {
    padding: 0.875rem;
  }

  .discount-info-container h3 {
    font-size: 1rem;
  }

  .discount-tiers-list {
    gap: 0.75rem;
  }

  .discount-tiers-list--item {
    font-size: 0.813rem;
    padding: 0.5rem 0;
  }

  .discount-info-note {
    font-size: 0.75rem;
  }

  .card-description {
    font-size: 0.875rem;
  }

  .dimensions--title {
    font-size: 1rem;
  }

  .dimensions--list-item span {
    font-size: 0.875rem;
  }

  .related-products h2 {
    font-size: 2.5rem;
            margin-top: 2rem;
  }

  .related-products__item {
    width: 14rem;
    height: 22.5rem;
  }

  .related-products__image-wrapper img {
    height: 14rem;
  }

  .related-products__product-info h4 {
    font-size: 0.813rem;
  }

  .related-products__product-info h3,
  .related-products__price {
    font-size: 1.5rem;
  }

  .related-products__content {
    gap: 0.75rem;
  }
}

@media (max-width: 360px) {
  .main {
    padding: 1rem 1rem 5rem;
  }

  .card-header-nav .link,
  .card-header-nav span {
    font-size: 1rem;
  }

  .card-gallery {
    width: 100%;
    gap: 0.75rem;
    height: 16.125rem;
  }

  .card-gallery--list {
    gap: 0.5rem;
    height: 16.125rem;
  }

  .card-gallery--list-item {
    min-width: 100%;
    max-width: 100%;
    max-height: 16.125rem;
    min-height: 16.125rem;
  }

  .card-title-container h1 {
    font-size: 1.125rem;
  }

  .card-price-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .card-price-container p {
    font-size: 1.125rem;
  }

  .add-to-cart-btn {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
  }

  .card-quantitiy {
    max-width: 5rem;
    height: 2.3rem;
  }

  .card-quantitiy button {
    width: 1rem;
    height: 1rem;
  }

  .card-quantitiy img {
    width: 0.625rem;
    height: 0.625rem;
  }

  .card-quantitiy span {
    font-size: 1rem;
  }

  .discount-tiers-list {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .discount-tiers-list--item {
    min-width: calc(33.33% - 0.5rem);
    font-size: 0.75rem;
  }

  .related-products__item {
    width: 14rem;
    height: 17.875rem;
  }

  .related-products__cart-btn {
    bottom: 7rem;
  }

  .related-products__image-wrapper img {
    height: 12rem;
  }

  .related-products__product-info h3,
  .related-products__price {
    font-size: 0.875rem;
  }
  .cart-notification {
    max-width: 20.5rem;
  }

  .cart-notification__container {
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .notification-content {
    gap: 0.5rem;
  }

  .notification-content span {
    font-size: 1rem;
    display: block;
    max-width: 8.125rem;
  }

  .notification-content a {
    font-size: 1rem;
  }
}




/* === ДОБАВИТЬ В КОНЕЦ CSS === */
.card-gallery__main-carousel {
  width: 37.625rem; /* Идентично старой .card-gallery--main-image */
  flex-shrink: 0;   /* Защита от сжатия в flex-контейнере */
  height: 100%;
  overflow: hidden;
  position: relative;
  cursor: grab;
}

.card-gallery__main-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.card-gallery__main-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-gallery__main-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none; /* Убираем лишние события перетаскивания картинки */
}

.card-gallery__main-carousel:active {
  cursor: grabbing;
}

/* На мобильных скрываем главную карусель, чтобы полностью сохранить ваше текущее поведение */
@media (max-width: 960px) {
  .card-gallery__main-carousel {
    display: none;
  }
}