.product-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 2px 0;
}

.product-page {
    display: flex;
    gap: 20px; 
    align-items: flex-start;
    margin: 0 auto;
    padding: 0px;
    width: 100%;
}

.product-info-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 20px;
}

.product-image-block {
    flex: 0 0 30%;
    background-color: #fff;
    border: 1px solid #cacaca;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

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

.product-info-block,
.product-description-block {
    background-color: #fff;
    border: 1px solid #cacaca;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.product-info-block h1 {
    text-align: left;
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    width: 100%;
}

.product-description-block h3 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.description-content {
    line-height: 1.6;
    color: #555;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.wholesale-price {
    color: #666;
    margin-bottom: 5px;
}

.price-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.price-value .original-price {
    text-decoration: line-through;
    color: #666;
    margin-right: 10px;
    font-size: 1.2rem;
}

.price-value .discounted-price {
    color: #e72630;
    font-size: 1.5rem;
    font-weight: bold;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quantity-input {
    width: 50px;
    margin-right: 10px;
    padding: 5px;
}

.add-to-cart {
    background-color: #e72630;
    border-radius: 4px;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
}

.add-to-cart:hover {
    background-color: #ff000d;
}

.min-order-notice {
    color: #d9534f;
    font-size: 0.9rem;
}

.main-image-container {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.main-image:hover {
    transform: scale(1.02);
}

.thumbnail-carousel {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 0 15px;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px 0;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.thumbnails::-webkit-scrollbar {
    height: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: #e72630;
    border-radius: 2px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: center;
}

.thumbnail.active {
    border-color: #e72630;
}

.thumbnail:hover {
    opacity: 0.8;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    z-index: 100;
}

.carousel-button:hover {
    background: #e0e0e0;
}

.carousel-button.prev {
    left: -15px;
}

.carousel-button.next {
    right: -15px;
}

.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #e72630;
}

.ps-gallery a {
    display: block;
    text-decoration: none;
}


.pswp__caption__center {
    text-align: center;
    max-width: 80%;
    margin: 0 auto;
    font-size: 14px;
}

.pswp .pswp__button {
    background-color: transparent !important;
    opacity: 0.5 !important;
}



.ps-gallery a, .main-image-link {
    display: block;
    cursor: zoom-in;
    user-select: none;
}

/* Кастомизация PhotoSwipe */
.pswp.pswp--open .pswp__bg {
    background: rgba(0, 0, 0, 0.3) !important;
    opacity: 1 !important;
}
.pswp__button {
    background-color: transparent !important;
    border-radius: 8px !important;
    width: 48px !important;
    height: 48px !important;
    transition: background-color 0.2s ease !important;
}
.pswp__button:hover {
    background-color: transparent !important;
    opacity: 1 !important;
}

.pswp__button--arrow--left,
.pswp__button--arrow--right {
    background-size: 28px 28px !important;
    background-color: transparent !important;
    filter: invert(100%) sepia(0%) saturate(7500%) hue-rotate(180deg) brightness(100%) contrast(100%) drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    opacity: 0.5 !important; /* Прозрачность стрелок */
}

.pswp__button--arrow--left:hover,
.pswp__button--arrow--right:hover {
    background-color: transparent !important;
    filter: invert(100%) sepia(0%) saturate(7500%) hue-rotate(180deg) brightness(100%) contrast(100%) drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    opacity: 1 !important; /* Полная непрозрачность при наведении */
}



.pswp__counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 16px;
    padding: 5px 10px;
    background: transparent !important; /* Прозрачный фон для счетчика */
    border-radius: 4px;
    z-index: 1200;
    opacity: 0.9 !important; /* Прозрачность счетчика */
    background: transparent !important;
}


.pswp__custom-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
}

/* Стили для блока с требованием авторизации */
.auth-required-notice {
    display: block;
    padding: 15px;
    background-color: #fff8f8;
    border: 1px solid #ffe0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.notice-icon {
    display: inline-block;
    vertical-align: top;
    margin-right: 15px;
}

.notice-icon svg {
    width: 24px;
    height: 24px;
}

.notice-text {
    display: inline-block;
    vertical-align: top;
    color: #333;
    line-height: 1.5;
    max-width: calc(100% - 50px);
    text-align: left;
    margin-bottom: 15px;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #e72630;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.auth-button:hover {
    background-color: #d11a24;
    color: white;
}

.auth-button svg {
    width: 16px;
    height: 16px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .product-container {
        padding: 15px 10px 0;
        max-width: 100%;
    }
    
    .product-page {
        flex-direction: column;
        gap: 15px;
    }
    
    .product-image-block {
        flex: none;
        width: 100%;
        padding: 15px;
        margin-bottom: 0;
    }
    
    .main-image-container {
        height: 250px;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .thumbnail-carousel {
        padding: 0 10px;
    }
    
    .carousel-button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .product-info-block,
    .product-description-block {
        padding: 15px;
    }
    
    .product-info-block h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .product-price {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
        margin-bottom: 15px;
    }
    
    .wholesale-price {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    .price-value {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
    
    .price-value .original-price {
        font-size: 1.1rem;
    }
    
    .quantity-selector {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .quantity-input {
        width: 80px;
        padding: 8px;
        font-size: 16px;
        border: 1px solid #ccc;
        border-radius: 4px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .add-to-cart {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
        font-weight: bold;
    }
    
    .min-order-notice {
        font-size: 0.85rem;
        text-align: center;
        margin-top: 10px;
    }
    
    .auth-required-notice {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .notice-text {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .auth-button {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
}

/* Мелкие мобильные устройства */
@media (max-width: 480px) {
    .product-container {
        padding: 10px 5px 0;
    }
    
    .product-image-block,
    .product-info-block,
    .product-description-block {
        padding: 12px;
        border-radius: 12px;
    }
    
    .main-image-container {
        height: 200px;
    }
    
    .product-info-block h1 {
        font-size: 18px;
    }
    
    .product-price {
        gap: 10px;
    }
    
    .price-value {
        font-size: 1.2rem;
    }
    
    .thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .carousel-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .carousel-button.prev {
        left: -10px;
    }
    
    .carousel-button.next {
        right: -10px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .product-page {
        flex-direction: row;
    }
    
    .product-image-block {
        flex: 0 0 45%;
    }
    
    .main-image-container {
        height: 200px;
    }
}