/* Product Page Styles */

/* Skeleton Loader */
.product-skeleton {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: white;
    padding: 40px;
    border-radius: 8px;
}

.skeleton-pulse {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
}

.skeleton-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.skeleton-thumb {
    aspect-ratio: 1;
    border-radius: 4px;
}

.skeleton-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 20px;
}

.skeleton-title {
    height: 36px;
    width: 80%;
}

.skeleton-sku {
    height: 20px;
    width: 40%;
}

.skeleton-price {
    height: 32px;
    width: 30%;
}

.skeleton-attributes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-attr {
    height: 24px;
    width: 60%;
}

.skeleton-button {
    height: 50px;
    width: 100%;
    margin-top: 20px;
}

/* Mobile skeleton */
@media (max-width: 768px) {
    .product-skeleton {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    
    .skeleton-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .skeleton-title {
        height: 28px;
    }
    
    .skeleton-price {
        height: 28px;
    }
}

.product-page {
    padding: 40px 0;
    background: #f8f8f8;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: white;
    padding: 40px;
    border-radius: 8px;
}

/* Gallery */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail:hover {
    border-color: #B8860B;
}

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

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Кнопки прижаты к левому краю */
}

.product-name {
    font-size: 24px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-article {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.article-label::after {
    content: ' ';
}

.product-price {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

.price-currency {
    font-size: 18px;
    font-weight: 400;
}

/* Tabs */
.product-tabs {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
    font-family: 'Comfortaa', cursive, sans-serif;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #333;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #B8860B;
}

.tab-content {
    display: none;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #666;
}

.tab-content.active {
    display: block;
}

/* Size Selection */
.product-size {
    margin-bottom: 30px;
}

.product-size label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.size-options {
    display: flex;
    gap: 10px;
}

.size-btn {
    width: 50px;
    height: 50px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.size-btn:hover {
    border-color: #B8860B;
}

.size-btn.active {
    border-color: #B8860B;
    background: #B8860B;
    color: white;
}

/* Details Grid */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item h4 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.detail-item p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.detail-link {
    font-size: 13px;
    color: #B8860B;
    text-decoration: underline;
}

.detail-link:hover {
    text-decoration: none;
}

/* Availability */
.product-availability {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.availability-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
}

/* Availability */
.product-availability {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.availability-label {
    text-transform: uppercase;
    font-weight: 500;
}

/* Quantity */
.product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 14px;
}

.quantity-label {
    text-transform: uppercase;
    font-weight: 500;
}

.quantity-value {
    font-weight: 600;
    color: #333;
}

.quantity-value.preorder {
    color: #ff9800;
    font-weight: 700;
}

/* Variation Selector */
.product-variations {
    margin-bottom: 25px;
}

.variations-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.variations-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variation-btn {
    padding: 10px 16px;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-family: 'Comfortaa', cursive, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.variation-btn:hover {
    border-color: #B8860B;
    background: #fafafa;
}

.variation-btn.active {
    border-color: #B8860B;
    background: #B8860B;
    color: white;
}

.variation-btn.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.variation-name {
    font-weight: 600;
    font-size: 14px;
}

.variation-value {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.variation-btn.active .variation-value {
    color: rgba(255, 255, 255, 0.9);
}

/* Product Navigation Buttons */
.product-navigation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-btn {
    flex: 1;
    padding: 12px 20px;
    background: white;
    border: 1px solid #ddd;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-btn:hover {
    border-color: #B8860B;
    color: #B8860B;
}

.nav-btn .nav-arrow {
    font-size: 16px;
    font-weight: normal;
}

@media (max-width: 768px) {
    .product-navigation-buttons {
        display: flex !important; /* Показываем навигационные кнопки на мобильных */
        flex-direction: row;
        gap: 8px;
        padding: 0 !important; /* Убираем padding - кнопки внутри product-info */
        margin-bottom: 15px;
    }
    
    .nav-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 11px;
        letter-spacing: 0.3px;
    }
    
    .nav-btn .nav-arrow {
        font-size: 14px;
    }
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 50%;
    padding: 12px 24px;
    background: #000;
    color: white;
    border: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Comfortaa', cursive, sans-serif;
    text-transform: uppercase;
}

.add-to-cart-btn:hover {
    background: #333;
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Breadcrumb links */
.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #B8860B;
}

/* Previously Viewed Section */
.previously-viewed {
    margin-top: 60px;
    padding: 40px 0;
}

.section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 500;
    color: #333;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.carousel-container {
    position: relative;
    padding: 0 50px;
}

.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.carousel-track .carousel-item {
    flex: 0 0 calc(25% - 15px);
    min-width: 230px;
    max-width: 280px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.carousel-btn:hover {
    background: #B8860B;
    color: white;
    border-color: #B8860B;
}

.carousel-btn.prev {
    left: 0;
}

.carousel-btn.next {
    right: 0;
}

.carousel-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.carousel-item-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.carousel-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item-code {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.carousel-item-info {
    padding: 15px;
}

.carousel-item-title {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.carousel-item-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carousel-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.carousel-item-price small {
    font-size: 12px;
    font-weight: 400;
}

.carousel-item-btn {
    padding: 8px 12px;
    background: none;
    border: 1px solid #ddd;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    align-self: flex-end;
    white-space: nowrap;
    text-transform: uppercase;
}

.carousel-item-btn:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.carousel-item-btn.out-of-stock {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .carousel-track .carousel-item {
        flex: 0 0 calc(25% - 15px);
        min-width: 220px;
    }
}

@media (max-width: 1024px) {
    .carousel-track .carousel-item {
        flex: 0 0 calc(33.333% - 14px);
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    /* Переопределяем базовый margin цены */
    .product-price {
        margin-bottom: 8px !important;
    }
    
    .product-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr;
        gap: 0 !important;
        padding: 0 !important;
    }
    
    .product-details-grid {
        grid-template-columns: 1fr;
    }
    
    .thumbnail-images {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .carousel-track .carousel-item {
        flex: 0 0 calc(50% - 10px);
        min-width: 200px;
    }
    
    .carousel-container {
        padding: 0 40px;
    }
}

@media (max-width: 480px) {
    .carousel-track .carousel-item {
        flex: 0 0 calc(50% - 5px);
        min-width: calc(50% - 5px);
        max-width: calc(50% - 5px);
    }
}

/* Pre-order button styles for product page */
#add-to-cart-btn.preorder {
    background: #ff9800;
}

#add-to-cart-btn.preorder:hover {
    background: #f57c00;
}

.carousel-item-btn.preorder {
    background: #ff9800;
}

.carousel-item-btn.preorder:hover {
    background: #f57c00;
}

.carousel-item-btn.out-of-stock {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}


/* Lightbox для просмотра изображений */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10001;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 20px;
    z-index: 10001;
    transition: background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Курсор для увеличения */
.main-image img {
    cursor: zoom-in;
}


/* Product Attributes Info */
.product-attributes-info {
    margin-bottom: 15px;
}

.product-attributes-info .attribute-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.product-attributes-info .attribute-label {
    font-weight: 400;
    color: #333;
    text-transform: uppercase;
}

.product-attributes-info .attribute-value {
    font-weight: 400;
    color: #666;
}

.product-attributes-info .attribute-link {
    color: #B8860B;
    text-decoration: none;
    transition: color 0.3s;
}

.product-attributes-info .attribute-link:hover {
    color: #8B6914;
    text-decoration: underline;
}


/* Product Description Section */
.product-description-section {
    margin: 20px 0;
    line-height: 1.6;
    color: #666;
}

.product-description-section p {
    margin: 0;
}


/* Marketplace Buttons */
.marketplace-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.marketplace-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.marketplace-btn .btn-icon {
    font-size: 18px;
}

.etsy-btn {
    background: #F1641E;
    color: white;
}

.etsy-btn:hover {
    background: #D9541A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(241, 100, 30, 0.3);
}

.amazon-btn {
    background: #FF9900;
    color: #232F3E;
}

.amazon-btn:hover {
    background: #FFA724;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

/* Production time notice */
.production-time-notice {
    margin-top: 12px;
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}


/* Product Page Discount Price Styles */
#product-price .price-with-discount {
    display: flex;
    align-items: center;
    gap: 12px;
}

#product-price .price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 20px;
    font-weight: 400;
}

#product-price .price-discount {
    color: #e74c3c;
    font-weight: 700;
    font-size: 28px;
}

.carousel-item-price-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.carousel-item-price-container .price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
}

.carousel-item-price-container .price-discount {
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
}


/* Мобильная версия страницы товара - убираем все отступы */
@media (max-width: 768px) {
    .product-page {
        padding: 0 !important;
        background: white !important;
    }
    
    .product-page .container {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .product-gallery {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .main-image {
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    /* Миниатюры - с отступами */
    .thumbnail-images {
        padding: 10px 15px !important;
    }
    
    /* Информация о товаре - с отступами */
    .product-info {
        padding: 15px !important;
        text-align: left !important;
    }
    
    .product-info * {
        text-align: left !important;
    }
    
    /* Название товара - уменьшить в 2 раза */
    .product-name {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    /* Артикул */
    .product-article {
        font-size: 12px !important;
    }
    
    /* Цена - такой же размер как название, выровнять по левому краю */
    .product-price-display,
    .product-price,
    #product-price {
        font-size: 20px !important;
        text-align: left !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: block !important;
        width: 100% !important;
    }
    
    .product-price .price-value,
    .product-price .price-currency,
    #product-price .price-value,
    #product-price .price-currency {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Вариации на мобильных */
    .product-variations {
        margin-bottom: 15px !important;
    }
    
    .variations-label {
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }
    
    .variation-btn {
        min-width: 70px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .variation-name {
        font-size: 13px;
    }
    
    .variation-value {
        font-size: 10px;
    }
    
    /* Описание - уменьшить отступ сверху в 2 раза */
    .product-description,
    .product-description-section {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .product-info > * + .product-description-section {
        margin-top: 10px !important;
    }
}

@media (max-width: 480px) {
    .thumbnail-images {
        padding: 8px 12px !important;
    }
    
    .product-info {
        padding: 12px !important;
    }
    
    .product-name {
        font-size: 18px !important;
    }
    
    .product-price-display,
    .product-price {
        font-size: 18px !important;
    }
}


/* Аккордеон описания для мобильных */
@media (max-width: 768px) {
    .product-description-accordion {
        margin: 0 !important;
    }
    
    .description-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 2px 0 10px 0;
        margin-top: 0 !important;
        background: none;
        border: none;
        border-bottom: 1px solid #ddd;
        font-size: 16px;
        font-weight: 500;
        color: #333;
        cursor: pointer;
        text-align: left;
    }
    
    .description-toggle .arrow-icon {
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .description-toggle.active .arrow-icon {
        transform: rotate(180deg);
    }
    
    .product-description-section {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .product-description-section.open {
        max-height: 1000px;
        padding-top: 10px;
    }
}

/* На десктопе аккордеон не нужен */
@media (min-width: 769px) {
    .description-toggle {
        display: none;
    }
    
    .product-description-section {
        max-height: none !important;
    }
}

/* Mobile: Marketplace buttons */
@media (max-width: 768px) {
    .marketplace-buttons {
        gap: 10px;
    }
    
    .marketplace-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Mobile: reduced spacing between button and Previously Viewed */
@media (max-width: 768px) {
    .previously-viewed {
        margin-top: 15px !important;
        padding: 20px 0 !important;
    }
    
    /* Все заголовки секций одинакового размера и выровнены по левому краю на мобильных */
    .section-title {
        font-size: 16px !important;
        margin-bottom: 15px !important;
        text-align: left !important;
        padding-left: 15px !important;
    }
    
    /* Кнопка Add to Cart - по размеру контента на мобильных */
    .add-to-cart-btn {
        width: fit-content !important;
        min-width: unset !important;
        max-width: unset !important;
        padding: 12px 24px !important;
    }
    
    .carousel-container {
        padding: 0 !important;
    }
    
    .carousel-item {
        box-shadow: none !important;
        border: 1px solid #eee;
    }
    
    .carousel-track {
        gap: 10px !important;
    }
    
    .footer {
        margin-top: 0 !important;
    }
}

/* Same Type Products Section */
.same-type-products {
    margin: 40px 0;
    padding: 30px;
    background: white;
    border-radius: 8px;
}

.same-type-products .section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    color: #333;
}

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

.same-type-item {
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.same-type-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.same-type-item-image {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.same-type-item-image .product-code {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.same-type-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.same-type-item-info {
    padding: 15px;
}

.same-type-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.same-type-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.same-type-item-btn {
    width: 100%;
    padding: 10px;
    background: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.same-type-item-btn:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.same-type-item-btn.preorder {
    background: none;
    color: #ff9800;
    border-color: #ff9800;
}

.same-type-item-btn.preorder:hover {
    background: #ff9800;
    color: white;
}

.same-type-item-btn.out-of-stock {
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    .same-type-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    /* На мобильных - горизонтальный скролл */
    .same-type-products {
        padding: 20px 0;
        margin: 20px 0;
    }
    
    .same-type-products .section-title {
        padding: 0 15px;
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .same-type-grid,
    #same-type-grid,
    #same-color-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        gap: 12px;
        padding: 0 15px;
        padding-bottom: 10px;
    }
    
    .same-type-grid::-webkit-scrollbar,
    #same-type-grid::-webkit-scrollbar,
    #same-color-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .same-type-grid .same-type-item,
    #same-type-grid .same-type-item,
    #same-color-grid .same-type-item {
        flex: 0 0 45%;
        min-width: 45%;
        max-width: 45%;
        scroll-snap-align: start;
    }
    
    /* Скрываем hidden-products-wrapper на мобильных - все товары в основном grid */
    .hidden-products-wrapper {
        display: none !important;
    }
    
    /* Скрываем кнопку View All на мобильных */
    .same-type-products .view-all-btn,
    .same-color-section .view-all-btn,
    #same-type-section .view-all-btn,
    #same-color-section .view-all-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .same-type-grid .same-type-item,
    #same-type-grid .same-type-item,
    #same-color-grid .same-type-item {
        flex: 0 0 70%;
        min-width: 70%;
        max-width: 70%;
    }
}


/* Full-width Description Section */
.product-description-full {
    background: white;
    padding: 40px;
    border-radius: 8px;
    margin: 30px 0;
}

.product-description-full .description-content {
    font-size: 16px;
    line-height: 1.8;
    color: #666;
}

.product-description-full .description-content p {
    margin-bottom: 15px;
}

.product-description-full .description-content p:last-child {
    margin-bottom: 0;
}

/* Mobile: reduce padding */
@media (max-width: 768px) {
    .product-description-full {
        padding: 20px;
        margin: 20px 0;
    }
    
    .product-description-full .description-content {
        font-size: 14px;
        line-height: 1.6;
    }
}


/* View All Button */
.view-all-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    padding: 12px 30px;
    background: white;
    border: 1px solid #ddd;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.view-all-btn:hover {
    border-color: #B8860B;
    color: #B8860B;
}

/* Hidden products wrapper - обертка для анимации высоты */
.hidden-products-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    grid-column: 1 / -1; /* Занимает всю ширину grid */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out;
}

.hidden-products-wrapper.expanded {
    max-height: 5000px; /* Достаточно большое значение */
    opacity: 1;
}

.hidden-products-wrapper .same-type-item {
    display: block;
}

/* Responsive для wrapper */
@media (max-width: 1024px) {
    .hidden-products-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hidden-products-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hidden-products-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Mobile: smaller button */
@media (max-width: 768px) {
    .view-all-btn {
        max-width: 100%;
        padding: 10px 20px;
        font-size: 13px;
        margin-top: 15px;
    }
}


/* ============================================
   RTL STYLES FOR PRODUCT PAGE
   ============================================ */

/* RTL: Product variations - align to right */
[dir="rtl"] .product-variations {
    width: auto !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

[dir="rtl"] .variations-label {
    text-align: right;
}

[dir="rtl"] .variations-options {
    justify-content: flex-end;
}

/* RTL: Navigation buttons - align to right */
[dir="rtl"] .product-navigation-buttons {
    width: auto !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    justify-content: flex-end;
}

[dir="rtl"] .product-navigation-buttons .nav-btn {
    flex: 0 0 auto;
    min-width: 150px;
}

/* RTL: Production time notice - align to right */
[dir="rtl"] .production-time-notice {
    text-align: right;
    margin-left: auto !important;
    margin-right: 0 !important;
    width: fit-content;
}

/* LTR: Navigation buttons - keep original width when only one button */
.product-navigation-buttons .nav-btn {
    min-width: 150px;
}
