.detail-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 900px;
    margin: 0px auto;
    font-family: Arial, sans-serif;
}

/* Основное изображение */
.image-gallery {
    display: flex;
    flex-direction: column;

}



/* Миниатюры */
.image-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.image-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
}

.image-thumbnails img:hover {
    transform: scale(1.1);
    border: 2px solid #0099cc;
}

/* Информация о товаре */
.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.detail-info h2 {
    font-size: 24px;
    margin: 0 0 10px;
    color: #222;
}

.detail-price {
    font-size: 22px;
    font-weight: bold;
    color: #0099cc;
    margin-bottom: 10px;
    margin-top: 0px;
}

.detail-shop {
    font-size: 14px;
    color: #888;
    margin-top: auto;
}

/* Описание */
.detail-description {
    max-width: 900px;
    margin: 20px auto;
    background-color: #fafafa;
    border-radius: 10px;
    padding: 20px;
}

.detail-description h3 {
    margin-top: 0;
    font-size: 22px;
}

.detail-description p {
    font-size: 16px;
    line-height: 1.5;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* затемнение фона */
}

.modal-content {
    background-color: #fff;
    margin: 5% auto; /* было 10% */
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-sizing: border-box;
}


.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
.application-button-wrapper {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}
.btn-za,
.write-button {
    background-color: #00b894;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 153, 204, 0.2);
    width: 100%;
    max-width: 300px;
    text-align: center;
}

/* Эффекты при наведении и нажатии */
.btn-za:hover,
.write-button:hover {
    background-color: #01856b;
}

.btn-za:active,
.write-button:active {
    transform: scale(0.97);
}
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}


#in-cart-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap; /* запрет переносов */
    margin-top: 10px;
}

#in-cart-section form {
    margin: 0; /* убрать лишние отступы */
    display: flex;
    align-items: center;
    height: 36px; /* совпадает с .quantity-control */
}

.cart-button {
    height: 40px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    line-height: 40px;
    min-width: 120px;
    color: #fff;
    background-color: #2a9d8f;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.cart-button:hover {
    background-color: #23867d;
}
#add-to-cart-section button {
    background-color: #00b894;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 153, 204, 0.2);
    width: 100%;
    max-width: 300px;
    text-align: center;
}

#add-to-cart-section button:hover {
    background-color: #01856b;
}

#add-to-cart-section button:active {
    transform: scale(0.97);
}

.product-slider-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
}

.product-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.product-slide-img,
.product-slide-video {
  min-width: 100%;
  object-fit: contain;
}

.product-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

#product-prev-btn { left: 0; }
#product-next-btn { right: 0; }

.delivery-button {
    background-color: #00b894;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 153, 204, 0.2);
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.btn-za:hover,
.delivery-button:hover {
    background-color: #01856b;
}

.btn-za:active,
.delivery-button:active {
    transform: scale(0.97);
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-top: 15px;
    margin-left: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.media-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90vh;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Контейнер с медиа */
.zoom-media-container-product {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Стили фото и видео — уменьшены */
.zoom-media-container-product img,
.zoom-media-container-product video {
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background-color: transparent;
}
.zoom-media-container-product img {
    max-height: 80vh;
}
.zoom-media-container-product video {
    max-height: 60vh;
}

/* Кнопки навигации */
.zoom-nav-btn {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 10px 14px;
    margin: 0 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.zoom-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.product-slide-img {
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.product-slide-video {
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  transform: scale(0.9); /* 90% от обычного размера */
}
.product-review-stars {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-star {
    font-size: 16px;
    color: #ccc;
}

.product-star.filled {
    color: #ffc107;
}

.product-rating-number {
    font-size: 14px;
    color: #333;
}

.product-user-info-rating {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
}

.btn-sold {
    background-color: #d9534f;
    color: white;
    padding: 0.5em 1em;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}
.btn-sold.disabled {
    background-color: gray;
    cursor: not-allowed;
}
.sold-label {
    font-size: 28px;
    color: red;
    margin-top: 10px;
}

.detail-characteristics {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 3px solid #ccc;
    background-color: #f9f9f9;
}

.detail-characteristics h4 {
    margin-bottom: 8px;
}

.detail-characteristics ul {
    list-style: none;
    padding-left: 0;
}

.detail-characteristics li {
    margin-bottom: 5px;
}


.pc-back-btn,
.desktop-actions {
    display: none;
}
@media screen and (min-width: 769px) {
    #zoomModal .zoom-content {
        max-width: 100vw !important;
        max-height: 100vh !important;
        width: 80vw;
        height: 80vh;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden; /* скрываем скроллы, но сам элемент может трансформироваться */
        position: relative;
    }

    .zoom-media-container-product {
        width: 80vw;
        height: 80vh;
        overflow: hidden;
        touch-action: none;
        position: relative;
    }

    .zoom-slide {
        position: absolute;
        transform: translate(-50%, -50%) scale(1);
        transition: transform 0.1s ease-out;
        max-width: none; /* убираем ограничения */
        max-height: none;
    }
    .pc-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 8px 16px;
        font-size: 14px;
        background-color: #f5f5f5;
        border: 1px solid #ccc;
        border-radius: 6px;
        color: #333;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .pc-back-btn:hover {
        background-color: #e0e0e0;
        border-color: #999;
    }
    .back-btn {
        display: none;
    }
    .mobile-topbar {
        display: none !important;
    }

    .desktop-actions {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 10px; /* можно под названием товара */
    }

    .desktop-actions button {
        padding: 8px 16px;
        font-size: 20px;
        border-radius: 6px;
        border: 1px solid #ccc;
        background: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
    }
}

@media screen and (max-width: 768px) {

    .pc-back-btn {
        display: none;
    }
    /* Контейнер карточки товара */
    .detail-container {
      display: flex;
      flex-direction: column;
      padding: 0px;
      background-color: #fff;
      gap: 0px;
      margin: 0px auto;
    }

    /* Галерея */
    .detail-image {
      position: relative;
      width: 100%;
      overflow: hidden;
      border-radius: 10px;

    }

    .product-slider-wrapper {
      overflow: hidden;
    }

    .product-slider-track {
      display: flex;
      transition: transform 0.3s ease;
    }

    .product-slide-img,
    .product-slide-video {
      width: 100%;
      height: auto;
      object-fit: contain;
      border-radius: 10px;
    }

    /* Стрелки */
    .gallery-click-area {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 15%;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2;
      background: rgba(0, 0, 0, 0.1);
      cursor: pointer;
    }

    .gallery-click-area.left {
      left: 0;
    }

    .gallery-click-area.right {
      right: 0;
    }

    .gallery-arrow {
      font-size: 24px;
      color: #fff;
    }

    /* Информация о товаре */
    .detail-info {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 16px;
    }


    .detail-info h2 {
      font-size: 20px;
      margin: 0;
    }

    .detail-price {
      font-size: 22px;
      font-weight: bold;
      color: #2e7d32;
    }

    .contact-buttons {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 12px;
    }

    .contact-buttons button {
      padding: 12px;
      font-size: 16px;
      border: none;
      border-radius: 8px;
      color: white;

      cursor: pointer;
    }

    .contact-buttons .btn-sold {
      background-color: #f44336;
    }

    .contact-buttons .btn-sold.disabled {
      background-color: #ccc;
      cursor: not-allowed;
    }

    /* Профиль пользователя */
    .user-profile-link {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 16px;
      text-decoration: none;
      color: inherit;
    }

    .user-avatar {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      object-fit: cover;
    }

    .user-name {
      font-weight: bold;
      font-size: 16px;
    }

    .product-review-stars {
      font-size: 14px;
      color: #ffaa00;
    }

    .product-rating-number {
      color: #667;
    }

    /* Характеристики */
    .detail-characteristics {
      margin-top: 16px;
      background-color: #fafafa;
      padding: 10px;
      border-radius: 6px;
      font-size: 14px;
    }

    .detail-characteristics ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .detail-characteristics li {
      margin: 4px 0;
    }

    /* Описание */
    .detail-description {
      font-size: 14px;
      line-height: 1.5;
      padding: 10px;
      margin: 0px auto;
    }



    /* Зум-модал */
    .u-modal {
      position: fixed;
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 2000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.8);
    }

    .u-modal__content_product {
      position: relative;
      max-width: 100vw;
      max-height: 80vh;
    }

    .u-modal__close {
      position: absolute;
      top: 8px;
      right: 12px;
      font-size: 28px;
      color: #fff;
      cursor: pointer;
      z-index: 10;
    }

    /* Модалка звонка */
    .modal {
      position: fixed;
      z-index: 2001;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.4);
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .modal-content {
      background: white;
      padding: 20px;
      width: 90%;
      max-width: 400px;
      border-radius: 8px;
      text-align: center;
    }

    .modal-close {
      position: absolute;
      top: 12px;
      right: 16px;
      font-size: 24px;
      cursor: pointer;
    }
    .contact-buttons {
        display: flex;           /* сделали флекс-контейнером */
        flex-direction: row;     /* расположение по горизонтали */
        justify-content: flex-start; /* выравнивание по левому краю */
        align-items: center;     /* выровнять кнопки по вертикали */
    }

    .btn-za,
    .write-button {

        padding: 12px 20px;
    }

    .mobile-topbar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        background: #fff;
        border-bottom: 2px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        z-index: 1000;
    }

    .topbar-title {
        font-size: 16px;
        font-weight: 600;
        color: #222;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
        text-align: center;
    }

    .topbar-btn {
        background: none;
        border: none;
        font-size: 30px;
        cursor: pointer;
        padding: 0px 5px;
        text-decoration: none;
        color: black;

    }
    .topbar-btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(0,0,0,0.6);
        border-radius: 100%;
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        z-index: 10000;
    }
    .topbar-actions {
        display: flex;
        gap: 5px;
    }
    .topbar-actions button {
        font-size: 24px;
    }

    /* Чтобы контент не налезал под панель */
    .detail-container {
        margin-top: 50px;
    }

    .share-btn-product {
        background: none;
        border: none;
        cursor: pointer;
        color: #555;
        font-size: 16px;
        transition: color 0.3s;
    }

    .share-btn-product {
        color: #0077ff;
    }

}