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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    background-image:
        linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)),
        url('https://cdn1.dizkon.ru/images/contests/2015/03/08/54fc2adfca4b7.80.jpg');
    background-size: cover, cover;
    background-position: center, center;
    background-attachment: fixed;
    color: #1e293b;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: white;
    border-radius: 24px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 span {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Burger menu */
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.menu-btn:hover {
    color: #2563eb;
    background: #f1f5f9;
}

.menu-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
    color: #2563eb;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #2563eb;
    color: #2563eb;
}

.btn-outline:hover {
    background: #2563eb;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

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

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Search */
.search-input {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 60px;
    background: white;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Filters */
.filters-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.filter-chip label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-group {
    display: flex;
    gap: 8px;
}

.price-group input,
.filter-chip select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    background: white;
}

/* Banner */
.banner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.banner-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 20px;
    border-radius: 20px;
    text-decoration: none;
    transition: transform 0.2s;
}

.banner-item:hover {
    transform: translateY(-4px);
}

.banner-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: white;
    border-radius: 16px;
    padding: 10px;
}

.banner-item h4 {
    color: white;
    font-size: 18px;
    margin-bottom: 6px;
}

.banner-item p {
    color: #94a3b8;
    font-size: 13px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #2563eb;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* Results */
.results-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.column h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #e2e8f0;
}

/* Product cards - uniform size grid */
.results-columns .column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: 180px;
    align-items: flex-start;
}

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

.product-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 22px;
    font-weight: 800;
    color: #2563eb;
}

.product-old-price {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 10px;
}

.product-marketplace {
    font-size: 13px;
    color: #64748b;
}

.product-rating {
    font-size: 13px;
    color: #f59e0b;
}

.delivery {
    font-size: 12px;
    color: #10b981;
}

.product-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.product-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.cart-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.cart-btn:hover {
    background: #059669;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-size: 13px;
    margin-top: 40px;
}

/* Sidebar - right side */
.sidebar {
    position: fixed;
    top: 0;
    left: -340px;
    width: 340px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h3 {
    font-size: 20px;
    color: #1e293b;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h4 {
    margin-bottom: 14px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.sidebar-category-item {
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 15px;
}

.sidebar-category-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.sidebar-category-item.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
}

.sidebar-brand-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sidebar-brand-select:focus {
    outline: none;
    border-color: #2563eb;
}

.sidebar .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 8px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 32px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.modal-logo {
    text-align: center;
    margin-bottom: 20px;
}

.modal-logo img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 8px;
}

.modal-sub {
    text-align: center;
    color: #64748b;
    margin-bottom: 24px;
}

.modal-content input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-buttons .btn {
    flex: 1;
}

/* Admin Panel */
.admin-panel {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.admin-panel h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #1e293b;
}

.admin-three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.admin-col {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.admin-col .admin-form {
    margin-top: auto;
}

.admin-col h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 18px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form input,
.admin-form select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
}

.admin-search {
    margin-bottom: 16px;
}

.admin-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
}

.admin-products-grid {
    max-height: 500px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-product-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

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

.admin-product-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 8px;
}

.admin-product-info {
    flex: 1;
}

.admin-product-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 14px;
}

.admin-product-price {
    color: #2563eb;
    font-weight: 700;
    font-size: 14px;
}

.admin-product-marketplace {
    font-size: 11px;
    color: #64748b;
}

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

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 60px;
    font-size: 14px;
    z-index: 1200;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px;
    color: #64748b;
}

.no-results {
    text-align: center;
    padding: 60px;
    color: #64748b;
    font-size: 16px;
}

.parsing-notice {
    text-align: center;
    padding: 20px;
    color: #2563eb;
    font-size: 15px;
    font-weight: 600;
    margin-top: 16px;
    background: rgba(37,99,235,0.08);
    border-radius: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-three-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .results-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .banner {
        grid-template-columns: 1fr;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        gap: 8px;
    }

    .btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    .product-card {
        flex-direction: column;
    }

    .product-image {
        width: 100%;
        height: 200px;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .modal-content {
        padding: 24px;
    }
}
