/**
 * СТО Каталог - Основные стили фронтенда
 * Version: 5.2.5
 */

/* ========================================
   ОБЩИЕ СТИЛИ
======================================== */

.sto-catalog-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   КАРУСЕЛЬ СТО НА СТРАНИЦЕ ТОВАРА
======================================== */

.product-sto-carousel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin: 40px 0;
    clear: both;
}

.sto-carousel-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.sto-carousel-container {
    position: relative;
}

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

/* ========================================
   КАРТОЧКА СТО
======================================== */

.sto-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.sto-card-header {
    margin-bottom: 15px;
}

.sto-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.sto-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.sto-card-title a:hover {
    color: #3498db;
}

.sto-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.sto-rating-stars {
    color: #f39c12;
    font-size: 14px;
}

.sto-rating-count {
    font-size: 13px;
    color: #7f8c8d;
}

.sto-card-body {
    margin-bottom: 15px;
}

.sto-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sto-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

.sto-info-item svg,
.sto-info-item i {
    width: 16px;
    height: 16px;
    color: #3498db;
    flex-shrink: 0;
    margin-top: 2px;
}

.sto-card-footer {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.sto-details-btn,
.sto-call-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.sto-details-btn {
    background: #3498db;
    color: white;
}

.sto-details-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.sto-call-btn {
    background: #27ae60;
    color: white;
}

.sto-call-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* ========================================
   БЛОК ОБСЛУЖИВАЕМЫХ БРЕНДОВ
======================================== */

.sto-brands-section {
    background: white;
    padding: 30px;
    margin: 30px 0;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sto-brands-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.sto-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.sto-brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.sto-brand-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sto-brand-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.sto-brand-name {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-align: center;
}

/* ========================================
   ФОТОГАЛЕРЕЯ
======================================== */

.sto-gallery {
    margin: 30px 0;
}

.sto-gallery h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.sto-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.sto-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.sto-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sto-gallery-item:hover img {
    transform: scale(1.1);
}

.sto-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s;
}

.sto-gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   ЯНДЕКС.КАРТЫ
======================================== */

.sto-map-section {
    margin: 30px 0;
}

.sto-map-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

#yandex-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* ========================================
   АРХИВ СТО
======================================== */

.sto-archive-header {
    margin-bottom: 30px;
}

.sto-archive-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.sto-archive-description {
    font-size: 16px;
    color: #7f8c8d;
}

/* Фильтры */
.sto-filters {
    background: white;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sto-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sto-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sto-filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.sto-filter-group select {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.sto-filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.sto-filter-actions {
    display: flex;
    gap: 10px;
}

.sto-filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.sto-filter-btn-primary {
    background: #3498db;
    color: white;
}

.sto-filter-btn-primary:hover {
    background: #2980b9;
}

.sto-filter-btn-secondary {
    background: #95a5a6;
    color: white;
}

.sto-filter-btn-secondary:hover {
    background: #7f8c8d;
}

/* Список СТО */
.sto-archive-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Пагинация */
.sto-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.sto-pagination a,
.sto-pagination span {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
}

.sto-pagination a:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.sto-pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* ========================================
   ОТЗЫВЫ
======================================== */

.sto-reviews-section {
    margin: 30px 0;
}

.sto-reviews-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
}

.sto-review {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sto-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sto-review-author {
    font-weight: 600;
    color: #2c3e50;
}

.sto-review-date {
    font-size: 13px;
    color: #7f8c8d;
}

.sto-review-body {
    color: #555;
    line-height: 1.6;
}

/* ========================================
   АДАПТИВНОСТЬ
======================================== */

/* Планшеты */
@media (max-width: 992px) {
    .product-sto-carousel {
        padding: 20px;
    }
    
    .sto-carousel-items {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .sto-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .product-sto-carousel {
        margin: 20px -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 20px 15px;
    }
    
    .sto-carousel-title {
        font-size: 20px;
    }
    
    .sto-carousel-items {
        grid-template-columns: 1fr;
    }
    
    .sto-archive-list {
        grid-template-columns: 1fr;
    }
    
    .sto-filters-grid {
        grid-template-columns: 1fr;
    }
    
    .sto-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .sto-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sto-card-footer {
        flex-direction: column;
    }
    
    #yandex-map {
        height: 300px;
    }
}

/* Маленькие мобильные */
@media (max-width: 480px) {
    .sto-carousel-title {
        font-size: 18px;
    }
    
    .sto-brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sto-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   УТИЛИТЫ
======================================== */

.sto-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.sto-no-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 8px;
}

.sto-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.sto-success {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* ========================================
   АНИМАЦИИ
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sto-card,
.sto-brand-item,
.sto-gallery-item {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   СТАТУСЫ
======================================== */

.sto-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.sto-status-badge.open {
    background: #d4edda;
    color: #155724;
}

.sto-status-badge.closed {
    background: #f8d7da;
    color: #721c24;
}