/* catalog.css */

/* ========== ОСНОВНЫЕ СТИЛИ КАТАЛОГА ========== */
.catalog-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.catalog-h1 {
    color: #1e5799;
    margin-bottom: 30px;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-line {
    display: block;
    font-size: 20px;
    margin-top: 5px;
}

/* ========== СТИЛИ ПОИСКА ========== */
.search-container {
    margin-bottom: 40px;
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 18px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    font-size: 16px;
    border: 2px solid #eaeaea;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #1e5799;
    box-shadow: 0 0 0 3px rgba(30, 87, 153, 0.1);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

.clear-search {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

.clear-search:hover {
    color: #dc3545;
    background: #f8f9fa;
}

.search-stats {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* ========== РЕЗУЛЬТАТЫ ПОИСКА ========== */
.search-results {
    margin-top: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-results.active {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #eaeaea;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    background: white;
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(30, 87, 153, 0.1);
    border-color: #1e5799;
}

.search-result-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 5px;
    padding: 5px;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 15px;
}

.search-result-category {
    font-size: 13px;
    color: #999;
    margin-bottom: 5px;
}

.search-result-price {
    font-weight: 600;
    color: #1e5799;
    font-size: 16px;
}

.search-result-price .old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: normal;
}

.search-result-match {
    background-color: #fff3cd;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: #856404;
    display: inline-block;
    margin-top: 5px;
}

.no-results-message {
    text-align: center;
    padding: 30px;
    color: #666;
}

.no-results-message i {
    font-size: 40px;
    color: #ccc;
    margin-bottom: 15px;
}

/* ========== КАРТОЧКИ КАТЕГОРИЙ ========== */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.category-card {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(30, 87, 153, 0.15);
    border-color: #1e5799;
}

.category-image-container {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.category-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.category-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-title {
    color: #1e5799;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
    font-weight: 600;
}

.category-products {
    list-style: none;
    margin-bottom: 20px;
    flex-grow: 1;
}

.category-products li {
    margin-bottom: 10px;
}

.category-products a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-products a:hover {
    background: #f0f7ff;
    color: #1e5799;
    transform: translateX(5px);
}

.category-products a i {
    font-size: 14px;
    color: #1e5799;
    margin-right: 8px;
}

.more-products-indicator {
    color: #999;
    font-size: 14px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px dashed #eaeaea;
    margin-top: 5px;
}

.more-products-indicator i {
    font-size: 14px;
    color: #999;
}

.category-footer {
    margin-top: 15px;
    text-align: right;
}

.category-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e5799;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 0;
    transition: gap 0.3s;
}

.category-link:hover {
    gap: 12px;
    color: #0d3c6e;
}

.category-link i {
    font-size: 14px;
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    gap: 8px;
    width: 100%;
    height: 100%;
}

.loading-spinner {
    text-align: center;
    padding: 60px;
    color: #666;
    grid-column: 1 / -1;
    font-size: 16px;
}

.loading-spinner i {
    font-size: 30px;
    color: #1e5799;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .catalog-container {
        padding: 20px;
    }
    
    .catalog-h1 {
        font-size: 18px;
    }
    
    .brand-line {
        font-size: 18px;
    }
    
    .catalog-grid {
        grid-template-columns: 1fr;
    }
    
    .category-image-container {
        height: 180px;
    }
    
    .search-input {
        padding: 12px 40px 12px 40px;
        font-size: 14px;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .catalog-h1 {
        font-size: 16px;
    }
    
    .brand-line {
        font-size: 16px;
    }
    
    .category-content {
        padding: 15px;
    }
    
    .category-title {
        font-size: 20px;
    }
}

/* Стили для некликабельной кнопки с литражом */
.btn-order-static {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    padding: 0 15px;
    border-radius: 30px;
    height: 38px;
    line-height: 38px;
    border: 1px solid #ddd;
    white-space: nowrap;
    cursor: default;
}

.button-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.btn-order-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background-color: #1e5799;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
    text-align: center;
}

.btn-order-link:hover {
    background-color: #0d3c6e;
}

/* ===== СТИЛИ ДЛЯ КАРТОЧЕК КАТАЛОГА ===== */
.item-catalog {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.button-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.button-row .cat-title {
    flex: 1;
    font-size: 12pt;
    font-weight: 600;
    color: #333;
    margin: 0;
    text-align: left;
}

.btn-order-custom {
    flex: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0px 15px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    line-height: 38px !important;
    margin: 0 !important;
    border: 1px solid !important;
    height: 38px !important;
    white-space: nowrap !important;
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    min-width: 100px;
}

.btn-order-custom:hover {
    background: #b02a37 !important;
    color: white !important;
    transform: translateY(-2px) !important;
}

.btn-order {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #1e5799;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.btn-order:hover {
    background-color: #0d3c6e;
}

@media (max-width: 768px) {
    .button-row {
        flex-wrap: wrap;
    }
    .button-row .cat-title {
        flex: 0 0 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    .btn-order-custom {
        flex: 1;
        min-width: auto;
    }
}