/* СТИЛИ ДЛЯ СТРАНИЦ ПРОДУКТОВ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.product-detail-page {
    background: #f2f8f2;
    min-height: 100vh;
    padding: 70px 0 2rem 0;
}

.product-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Кнопка назад */
.back-link-wrapper {
    max-width: 1200px;
    margin: 0.8rem auto 1.2rem auto;
    padding: 0 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #555;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #2e7d32;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.back-link svg {
    transition: transform 0.2s ease;
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* Единый блок продукта */
.product-unified-block {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.2rem;
}

.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(76, 175, 80, 0.1);
    align-items: start;
}

/* Детальный контент */
.product-details-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Галерея изображений */
.product-gallery {
    position: relative;
}

/* ПЕРЕКЛЮЧАТЕЛЬ ВАРИАНТОВ */
.variant-switcher {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
}

.variant-btn {
    flex: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.variant-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #26a69a, #66bb6a);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.variant-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(38, 166, 154, 0.2);
    border-color: rgba(38, 166, 154, 0.4);
}

.variant-btn.active {
    background: linear-gradient(135deg, #26a69a, #66bb6a);
    border-color: #26a69a;
    box-shadow: 0 8px 25px rgba(38, 166, 154, 0.3);
    transform: translateY(-2px);
}

.variant-btn.active::before {
    opacity: 1;
}

.variant-icon {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
    color: #26a69a;
    transition: all 0.3s ease;
}

.variant-btn.active .variant-icon {
    color: white;
    transform: scale(1.1);
}

.variant-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.variant-btn.active .variant-name {
    color: white;
}

.variant-desc {
    font-size: 0.8rem;
    color: #7f8c8d;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.variant-btn.active .variant-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Анимация для главного изображения при смене варианта */
.main-image {
    transition: opacity 0.3s ease;
}

.main-image {
    width: 100%;
    height: 500px;
    background: #f8f9fa;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

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

.main-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.thumbnail {
    width: 100%;
    height: 100px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    overflow: hidden;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #4caf50;
    transform: scale(1.05);
}

.thumbnail img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

/* Информация о продукте */
.product-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: start;
}

.product-top-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.product-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Кнопка поделиться */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.share-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212121;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.product-article {
    color: #757575;
    font-size: 0.8rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

/* Цена + заказ как единый блок */
.product-price-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f5f9f5, #eef6ee);
    border-radius: 16px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.2rem;
}

.price-value {
    font-size: 0.72rem;
    font-weight: 500;
    color: #2e7d32;
    white-space: nowrap;
}

.price-note {
    font-size: 0.58rem;
    color: #888;
    display: inline-block;
    padding: 0.15rem 0;
    margin-bottom: 0;
    letter-spacing: 0.02em;
    border-left: 2px solid #ccc;
    padding-left: 0.4rem;
}

.btn-order {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
    border: none;
    padding: 0.2rem 0.55rem;
    border-radius: 14px;
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-order:hover {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(46, 125, 50, 0.3);
}

/* Секции детальной информации */
.info-section {
    margin-bottom: 0;
}

/* Заголовок секции с SVG иконкой */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(139, 195, 74, 0.05));
    border-radius: 8px;
    border-left: 3px solid #4caf50;
}

.section-icon {
    flex-shrink: 0;
    stroke: #4caf50;
    width: 22px;
    height: 22px;
    display: block;
}

.section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #2e7d32;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* КОМПАКТНЫЕ ДЕТАЛЬНЫЕ ХАРАКТЕРИСТИКИ */
.detailed-specs {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #e0e0e0;
}

.spec-row {
    display: flex;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.15s ease;
}

.spec-row:hover {
    background: #fafafa;
}

.spec-row-label {
    font-weight: 600;
    color: #616161;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: fit-content;
}

.spec-row-label::after {
    content: ':';
}

.spec-row-value {
    color: #212121;
    font-weight: 500;
    font-size: 0.85rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}



/* КОМПАКТНОЕ ПРИМЕНЕНИЕ */
.applications-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #e0e0e0;
}

.applications-list li {
    padding: 0.7rem 0.8rem 0.7rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.875rem;
    color: #212121;
    line-height: 1.6;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: relative;
}

.applications-list li::before {
    content: '•';
    position: absolute;
    left: 0.8rem;
    color: #4caf50;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.6;
}

.applications-list li:hover {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.05), transparent);
    padding-left: 2.2rem;
    color: #2e7d32;
}

/* Похожие товары */
.related-products {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1b5e20;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.6rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.related-card {
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-card img {
    max-width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.6rem;
}

.related-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 0.3rem;
}

.related-card p {
    color: #666;
    font-size: 0.8rem;
}

/* МОДАЛЬНОЕ ОКНО ДЛЯ ИЗОБРАЖЕНИЙ */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: slideIn 0.4s ease;
}

.modal-image {
    width: 100%;
    height: auto;
    max-width: 1000px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -45px;
    right: -15px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: scale(0.8) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 768px) {
    .product-unified-block {
        padding: 1.5rem;
    }

    .product-main {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .product-price-card {
        justify-content: space-between;
    }

    .product-details-content {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .section-header {
        padding: 0.5rem 0.8rem;
        gap: 0.6rem;
    }

    .section-icon {
        width: 20px;
        height: 20px;
    }

    .main-image {
        height: 300px;
    }
    
    /* Переключатель вариантов на мобильных */
    .variant-switcher {
        margin: 1rem 0;
        padding: 0.4rem;
        gap: 0.5rem;
    }
    
    .variant-btn {
        padding: 0.8rem 0.5rem;
        gap: 0.3rem;
    }
    
    .variant-icon {
        width: 24px;
        height: 24px;
    }
    
    .variant-name {
        font-size: 0.8rem;
    }
    
    .variant-desc {
        font-size: 0.7rem;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-title {
        font-size: 1.8rem;
    }

    .price-value {
        font-size: 1.5rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .section-heading {
        font-size: 1.1rem;
    }

    .spec-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .related-products {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .product-container {
        padding: 0 1rem;
    }

    .product-detail-page {
        padding: 1rem 0;
    }

    .product-unified-block {
        padding: 1rem;
        border-radius: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.7rem 1rem;
    }

    .section-heading {
        font-size: 0.95rem;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-order,
    .btn-whatsapp {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .related-products {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.2rem;
    }
}
