/* Интерактивные карточки товаров для каталога рукавов высокого давления */

/* Основные стили карточек */
.interactive-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
    gap: 20px;
    padding: 20px 0;
    justify-content: center;
}

.interactive-product-card {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.interactive-product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Заголовок карточки */
.interactive-card-header {
    background-color: #707372;
    color: white;
    padding: 15px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.interactive-product-card:hover .interactive-card-header {
    background-color: #da291c;
}

.interactive-card-header h3 {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

.interactive-card-header .product-type {
    font-size: 12px;
    opacity: 0.9;
}

/* Изображение товара */
.interactive-card-image {
    height: 80px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.interactive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.interactive-product-card:hover .interactive-card-image img {
    transform: scale(1.05);
}

.interactive-card-image::before {
    content: "🏔️";
    font-size: 48px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
    position: absolute;
    z-index: 1;
}

.interactive-card-image:has(img)::before {
    display: none;
}

.interactive-product-card:hover .interactive-card-image::before {
    color: #da291c;
}

.interactive-card-image::after {
    content: "Изображение товара";
    position: absolute;
    bottom: 20px;
    font-size: 14px;
}

.interactive-card-image:has(img)::after {
    display: none;
}

/* Категория товара */
.interactive-card-category {
    padding: 8px 15px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
    margin: 0;
}

/* Параметры товара */
.interactive-card-params {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.interactive-param-box {
    border: 1px solid #707372;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.interactive-product-card:hover .interactive-param-box {
    border-color: #da291c;
}

.interactive-param-name {
    font-size: 12px;
    color: #707372;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.interactive-product-card:hover .interactive-param-name {
    color: #da291c;
}

.interactive-param-value {
    font-size: 16px;
    font-weight: bold;
}

/* Подвал карточки */
.interactive-card-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.interactive-product-code {
    font-size: 14px;
    color: #666;
}

.interactive-details-btn {
    background-color: #707372;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.interactive-product-card:hover .interactive-details-btn {
    background-color: #da291c;
}

.interactive-details-btn:hover {
    transform: scale(1.05);
}

/* Модальное окно для деталей */
.interactive-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

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

.interactive-modal-content {
    background-color: white;
    margin: 2% auto 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 85%;
    max-width: 700px;
    max-height: 96vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.interactive-modal-header {
    background-color: #da291c;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.interactive-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    border-radius: 50%;
}

.interactive-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.interactive-modal-body {
    padding: 20px;
}

.interactive-product-details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.interactive-product-image-large {
    height: 250px;
    background-color: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    position: relative;
}

.interactive-product-image-large::before {
    content: "🏔️";
    font-size: 64px;
}

.interactive-product-image-large::after {
    content: "Изображение товара";
    position: absolute;
    bottom: 20px;
    font-size: 16px;
}

.interactive-product-info h3 {
    margin-bottom: 10px;
    color: #333;
}

.interactive-product-info p {
    margin-bottom: 8px;
    color: #666;
}

/* Таблица характеристик */
.interactive-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.interactive-specs-table th,
.interactive-specs-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.interactive-specs-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.interactive-specs-table tr:nth-child(even) {
    background-color: #fafafa;
}

.interactive-specs-table tr:hover {
    background-color: #f0f0f0;
}

/* Состояния загрузки */
.interactive-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.interactive-error {
    text-align: center;
    padding: 40px;
    color: #da291c;
}

/* Адаптивность */
@media (max-width: 768px) {
    .interactive-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 260px));
        gap: 15px;
        justify-content: center;
    }
    
    .interactive-card-params {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .interactive-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .interactive-product-details-grid {
        grid-template-columns: 1fr;
    }
    
    .interactive-product-image-large {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .interactive-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 280px));
        gap: 10px;
        justify-content: center;
        padding: 10px 0;
    }
    
    .interactive-card-params {
        grid-template-columns: 1fr;
    }
    
    .interactive-card-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .interactive-modal-content {
        width: 98%;
        margin: 5% auto;
    }
}

/* Стили для кнопки "Назад" в модальном окне */
.interactive-modal-back-btn {
    background-color: #da291c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.interactive-modal-back-btn:hover {
    background-color: #c41e22;
}

/* Стили для описания товара */
.interactive-product-description {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #da291c;
}

.interactive-product-description h3 {
    color: #333;
    margin-bottom: 10px;
}

.interactive-product-description p {
    color: #666;
    line-height: 1.6;
}

/* Стили для таблицы технических характеристик */
.specs-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.specs-header {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    font-weight: 600;
    height: 120px;
    width: 100%;
}

.specs-header-cell {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.specs-header-cell:last-child {
    border-right: none;
}

.specs-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-align: center;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.specs-header-middle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.specs-header-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-align: center;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #d1d5db;
}

.specs-header-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    display: block;
}

.specs-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border-bottom: 1px solid #e5e7eb;
    min-height: 50px;
    align-items: center;
    background: white;
    width: 100%;
}

.specs-cell {
    padding: 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    min-height: 50px;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

/* Убираем padding для первой ячейки с диаметрами */
.specs-cell:first-child {
    padding: 0;
}

/* Стили для пустых значений */
.specs-cell:empty::before,
.specs-cell:has(span:only-child:empty)::before {
    content: '-';
    color: #9ca3af;
    font-style: italic;
}

.specs-cell:last-child {
    border-right: none;
}

.specs-cell .diameter-values-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
}

.specs-cell .diameter-values-wrapper .diameter-dn-value,
.specs-cell .diameter-values-wrapper .diameter-in-value {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
}

/* Стили для колонки с фитингами */
.specs-cell.fitting-cell {
    font-size: 11px;
}

.specs-cell.fitting-cell span {
    font-size: 11px;
    line-height: 1.2;
    word-break: break-all;
}

.specs-cell .diameter-values-wrapper::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
    transform: translateX(-50%);
}

/* Разделитель между DN и in в заголовке */
.specs-header-cell:first-child .specs-header-bottom {
    position: relative;
}

.specs-header-cell:first-child .specs-header-bottom::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
}

.specs-header-cell:first-child .specs-header-bottom span {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive для таблицы спецификаций */
@media (max-width: 768px) {
    .specs-header {
        grid-template-columns: repeat(2, 1fr);
        height: 180px;
    }
    
    .specs-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .specs-header-top {
        font-size: 10px;
        height: 60px;
    }
    
    .specs-header-middle {
        height: 60px;
    }
    
    .specs-header-bottom {
        height: 60px;
        font-size: 11px;
    }
    
    .specs-header-icon {
        width: 20px;
        height: 20px;
    }
    
    .specs-cell {
        font-size: 12px;
        padding: 8px 4px;
        min-height: 40px;
    }
    
    /* Скрываем некоторые колонки на мобильных для лучшей читаемости */
    .specs-header-cell:nth-child(6),
    .specs-header-cell:nth-child(7),
    .specs-header-cell:nth-child(8),
    .specs-header-cell:nth-child(9),
    .specs-cell:nth-child(6),
    .specs-cell:nth-child(7),
    .specs-cell:nth-child(8),
    .specs-cell:nth-child(9) {
        display: none;
    }
} 