/* cond_detail.css - Единые стили для карточек товаров и галереи */
/* Обеспечивает одинаковое отображение всех изображений: главное фото, карточки похожих товаров */

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.breadcrumbs {
    margin-bottom: 30px;
    font-size: 14px;
}

.breadcrumbs a {
    color: #f97316;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: #fb923c;
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
    color: #94a3b8;
}

.product-main {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.product-gallery {
    flex: 1;
    min-width: 300px;
}

/* ========== ЕДИНЫЙ СТИЛЬ ДЛЯ ВСЕХ КОНТЕЙНЕРОВ ИЗОБРАЖЕНИЙ ========== */
/* Главное изображение в галерее */
.main-image {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.main-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ========== КАРТОЧКИ ТОВАРОВ - ЕДИНЫЙ РАЗМЕР ДЛЯ ВСЕХ ИЗОБРАЖЕНИЙ ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex: 1;
}

/* ФИКСИРОВАННЫЙ КОНТЕЙНЕР ДЛЯ ИЗОБРАЖЕНИЙ - ОДИНАКОВЫЙ РАЗМЕР ДЛЯ ВСЕХ КАРТОЧЕК */
.product-card .image-wrapper {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ФИКСИРОВАННАЯ ВЫСОТА - все контейнеры одинаковые */
    width: 100%;
    height: 200px;
    overflow: hidden;
}

/* ВСЕ ИЗОБРАЖЕНИЯ В КАРТОЧКАХ ОДИНАКОВО МАСШТАБИРУЮТСЯ */
.product-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease;
}

.product-card:hover img {
    transform: scale(1.03);
}

.product-card h3 {
    font-size: 16px;
    margin: 10px 0 8px 0;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .price {
    font-size: 20px;
    color: #f97316;
    font-weight: bold;
    margin-top: 5px;
}

/* ========== ИНФОРМАЦИЯ О ТОВАРЕ ========== */
.product-info {
    flex: 1;
    min-width: 300px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
}

.badge.hit {
    background: linear-gradient(135deg, #f97316, #fb923c);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.badge.new {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.product-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #1e293b;
    font-weight: 700;
}

.product-meta {
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
}

.product-meta p {
    margin-bottom: 8px;
    font-size: 16px;
    color: #475569;
}

.product-meta strong {
    color: #1e293b;
}

.product-price {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #fff5eb, #ffe8dc);
    border-radius: 12px;
}

.old-price {
    font-size: 18px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-right: 15px;
}

.current-price {
    font-size: 36px;
    color: #f97316;
    font-weight: 700;
}

.product-actions {
    margin-bottom: 20px;
}

.btn-buy-primary {
    width: 100%;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-buy-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-buy-primary:active {
    transform: translateY(0);
}

.btn-favorite {
    background: white;
    color: #475569;
    border: 2px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn-favorite:hover {
    border-color: #f97316;
    color: #f97316;
    transform: translateY(-2px);
}

.service-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.service-title {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
    font-weight: 600;
}

.service-buttons {
    display: flex;
    gap: 10px;
}

.btn-service {
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #475569;
}

.btn-service.turnkey {
    border-color: #10b981;
    color: #10b981;
}

.btn-service:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-service.active {
    background: linear-gradient(135deg, #f97316, #fb923c);
    border-color: #f97316;
    color: white;
}

.btn-service.turnkey.active {
    background: linear-gradient(135deg, #10b981, #34d399);
    border-color: #10b981;
    color: white;
}

/* ========== ВКЛАДКИ ХАРАКТЕРИСТИК ========== */
.product-details {
    margin-bottom: 50px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 15px 25px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #f97316;
    background: white;
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #f97316;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th,
.specs-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.specs-table th {
    width: 35%;
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.specs-table td {
    color: #475569;
}

/* ========== БЛОК ПОХОЖИХ ТОВАРОВ ========== */
.similar-products {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #eef2f6;
}

.similar-products h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1f2e;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.similar-products h2:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #f97316;
    border-radius: 3px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.similar-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
}

.similar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.similar-link {
    text-decoration: none;
    display: block;
    padding: 20px 16px 20px 16px;
}

.similar-image {
    background: #f8fafc;
    border-radius: 12px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.similar-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.similar-card:hover .similar-image img {
    transform: scale(1.03);
}

.similar-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.similar-price {
    font-size: 20px;
    font-weight: 700;
    color: #f97316;
}

@media (max-width: 1100px) {
    .similar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .similar-products h2 {
        font-size: 22px;
    }
    
    .similar-image {
        height: 150px;
    }
    
    .similar-title {
        font-size: 14px;
    }
    
    .similar-price {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .similar-grid {
        grid-template-columns: 1fr;
    }
    
    .similar-image {
        height: 180px;
    }
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    position: relative;
    animation: slideIn 0.3s;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s;
}

.close:hover {
    color: #f97316;
}

.modal-content h3 {
    margin-bottom: 25px;
    font-size: 24px;
    color: #1e293b;
    font-weight: 700;
}

.form-group {
    margin-bottom: 18px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

#selectedServiceBlock {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

#selectedServiceBlock p {
    margin: 5px 0;
    color: #475569;
}

#selectedServiceBlock strong {
    color: #1e293b;
}

#selectedServiceText {
    color: #f97316;
    font-weight: 600;
}

#totalPrice {
    color: #f97316;
    font-size: 20px;
    font-weight: 700;
}

.submit-order {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.submit-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.submit-order:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .product-main {
        flex-direction: column;
        gap: 20px;
    }

    .product-info h1 {
        font-size: 24px;
    }

    .current-price {
        font-size: 28px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    /* На планшетах контейнер изображения чуть меньше */
    .product-card .image-wrapper {
        height: 180px;
    }

    .main-image {
        min-height: 320px;
        padding: 20px;
    }

    .main-image img {
        max-height: 280px;
    }

    .tab-btn {
        padding: 12px 18px;
        font-size: 14px;
    }

    .tab-content {
        padding: 20px;
    }

    .service-buttons {
        flex-direction: column;
    }
}

@media (max-width: 580px) {
    .detail-container {
        padding: 15px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    /* На телефонах карточка на всю ширину, изображение фиксированной высоты */
    .product-card .image-wrapper {
        height: 200px;
    }

    .product-card img {
        max-height: 160px;
    }

    .main-image {
        padding: 15px;
        min-height: 260px;
    }

    .main-image img {
        max-height: 220px;
    }

    .specs-table th,
    .specs-table td {
        padding: 10px;
        font-size: 14px;
    }

    .btn-buy-primary {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ========== ДОПОЛНИТЕЛЬНЫЕ ПРАВИЛА ДЛЯ ЕДИНООБРАЗИЯ ========== */
/* Любые другие изображения на странице */
.product-description img,
.tab-content img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

/* Галерея миниатюр, если будет добавлена */
.thumbnail-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.thumbnail-item {
    width: 70px;
    height: 70px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail-item:hover {
    border-color: #f97316;
}

.thumbnail-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}