* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: inherit;
    text-decoration: none;
}

.header {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.header-top-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.logo-icon {
    font-size: 24px;
}

.header-search {
    flex: 1;
    display: flex;
    gap: 8px;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.header-actions {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.header-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-light);
    position: relative;
    transition: color 0.2s;
}

.header-action:hover {
    color: var(--primary);
}

.action-icon {
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-nav {
    padding: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
    overflow-x: auto;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.main {
    padding: 24px 0;
    min-height: 60vh;
}

.hero {
    margin-bottom: 40px;
}

.hero-slide {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 16px;
    padding: 60px 40px;
    color: var(--white);
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    width: 100%;
    padding: 8px;
    margin-top: 8px;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

.categories {
    margin-bottom: 40px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-count {
    font-size: 12px;
    color: var(--text-light);
}

.products {
    margin-bottom: 40px;
}

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

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg);
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
}

.product-old-price {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-rating {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 8px;
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.product-card {
    position: relative;
}

.features {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.feature-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-text {
    font-size: 13px;
    color: var(--text-light);
}

.newsletter {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.newsletter-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.newsletter-text {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.newsletter-input:focus {
    border-color: var(--primary);
}

.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
}

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

.footer-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.footer-links a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    transition: background 0.2s, color 0.2s;
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--primary);
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.catalog-sidebar {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    height: fit-content;
}

.filter-block {
    margin-bottom: 24px;
}

.filter-block:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-link {
    font-size: 13px;
    color: var(--text);
    transition: color 0.2s;
}

.filter-link:hover,
.filter-link.active {
    color: var(--primary);
    font-weight: 500;
}

.filter-checkbox {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.price-input:focus {
    border-color: var(--primary);
}

.price-sep {
    color: var(--text-light);
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.catalog-title {
    font-size: 22px;
    font-weight: 700;
}

.catalog-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--white);
    cursor: pointer;
    outline: none;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.product-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-gallery {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.product-gallery img {
    width: 100%;
    height: auto;
}

.product-details {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    border: 1px solid var(--border);
}

.product-details h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.product-details .product-price {
    font-size: 28px;
    margin-bottom: 20px;
}

.product-description {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.7;
}

.product-actions {
    display: flex;
    gap: 12px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 44px;
    border: none;
    background: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: var(--bg);
}

.quantity-value {
    width: 48px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.cart-empty {
    background: var(--white);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid var(--border);
}

.cart-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.cart-empty h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.cart-empty p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-item-total {
    font-size: 16px;
    font-weight: 700;
    min-width: 100px;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: var(--danger);
}

.cart-summary {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    font-size: 18px;
    font-weight: 700;
}

.cart-summary .btn {
    min-width: 200px;
}

@media (max-width: 768px) {
    .header-top-inner {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .hero-slide {
        padding: 40px 24px;
    }

    .hero-title {
        font-size: 24px;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .product-page {
        grid-template-columns: 1fr;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-actions .action-text {
        display: none;
    }
}
