* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e1e8ed;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-brand h1 {
    margin: 0;
    font-size: 1.5rem;
}

.nav-brand img {
    max-height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

.theme-btn:hover {
    background: var(--light-bg);
}

/* Hero секция */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: white;
}

/* Секции */
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* Преимущества */
.features {
    padding: 60px 0;
    background: var(--light-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Мобильная версия преимуществ */
@media (max-width: 768px) {
    .features-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.75rem;
        padding: 0.5rem 0 1rem 0;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .feature-card {
        flex: 0 0 auto;
        width: 160px;
        scroll-snap-align: start;
        padding: 1rem;
    }
    
    .feature-icon {
        font-size: 1.75rem;
    }
    
    .feature-card h3 {
        font-size: 0.9rem;
    }
    
    .feature-card p {
        font-size: 0.75rem;
    }
}

/* Сетка товаров и услуг - ЕДИНАЯ */
.products-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Карточка товара */
.product-card,
.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.product-card:hover,
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

body.dark-theme .product-card,
body.dark-theme .service-card {
    background: var(--secondary-color);
}

.product-image,
.service-image {
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

.product-image img,
.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img,
.service-card:hover .service-image img {
    transform: scale(1.05);
}

.product-info,
.service-info {
    padding: 1rem;
}

.product-info h3,
.service-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-description,
.service-description {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.product-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.service-category {
    font-size: 0.7rem;
    color: #999;
}

.service-order {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--accent-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.service-order:hover {
    background: rgba(52,152,219,0.1);
}

/* === МОБИЛЬНАЯ ВЕРСИЯ - КОМПАКТНО === */
@media (max-width: 768px) {
    .products-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card,
    .service-card {
        border-radius: 8px;
    }
    
    .product-image,
    .service-image {
        height: 110px;
    }
    
    .product-info,
    .service-info {
        padding: 6px;
    }
    
    .product-info h3,
    .service-info h3 {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .product-description,
    .service-description {
        display: none;
    }
    
    .product-price {
        font-size: 0.7rem;
        margin: 2px 0;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .product-actions .btn {
        padding: 3px 5px;
        font-size: 0.55rem;
        text-align: center;
    }
    
    .service-footer {
        margin-top: 4px;
        padding-top: 4px;
    }
    
    .service-category {
        font-size: 0.55rem;
    }
    
    .service-order {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    /* Кнопка корзины в карточке */
    .cart-add {
        width: 24px;
        height: 24px;
        bottom: 6px;
        right: 6px;
    }
    
    .cart-add svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .products-grid,
    .services-grid {
        gap: 6px;
    }
    
    .product-image,
    .service-image {
        height: 90px;
    }
    
    .product-info,
    .service-info {
        padding: 4px;
    }
    
    .product-info h3,
    .service-info h3 {
        font-size: 0.6rem;
    }
    
    .product-price {
        font-size: 0.6rem;
    }
}

/* Контакты */
.contacts {
    padding: 60px 0;
    background: var(--light-bg);
}

.contacts-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Формы */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Алерты */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--light-bg);
    font-weight: 600;
}

.table tr:hover {
    background: var(--light-bg);
}

/* Корзина */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 2;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-quantity input {
    width: 60px;
    padding: 0.3rem;
    text-align: center;
}

.cart-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* Футер */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Адаптивность навигации */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        padding: 5px 10px;
        color: var(--text-color);
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 20px 0;
        order: 3;
        background: white;
        border-radius: 8px;
        margin-top: 10px;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-menu a {
        padding: 12px 0;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Поиск */
.search-bar {
    margin: 30px 0 20px;
}

.search-wrapper {
    position: relative;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Категории чипсы */
.categories-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.category-chip {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-chip:hover {
    border-color: var(--accent-color);
}

.category-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.chip-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Тулубар */
.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.result-count {
    font-size: 0.85rem;
    color: #666;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    font-size: 0.85rem;
}

.page-btn:hover {
    border-color: var(--accent-color);
}

.page-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

/* Минимальная цена */
.minimal-price-warning {
    font-size: 0.8rem;
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    text-align: center;
}

body.dark-theme .minimal-price-warning {
    background: rgba(243, 156, 18, 0.2);
}

/* Скелетон */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.skeleton-card {
    background: var(--light-bg);
    border-radius: 12px;
    overflow: hidden;
}

.skeleton-image {
    height: 200px;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--light-bg) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
}

.skeleton-line {
    height: 14px;
    margin: 12px;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--light-bg) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
    border-radius: 4px;
}

.skeleton-price {
    height: 20px;
    margin: 12px;
    width: 60%;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--light-bg) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Убираем подчеркивания в карточках */
.product-card a,
.service-card a,
.product-link,
.service-link {
    text-decoration: none !important;
}

.product-card h3,
.service-card h3,
.product-price,
.product-description,
.service-description {
    text-decoration: none !important;
}