/* СтройМаркет - Современный адаптивный дизайн */

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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

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

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

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

.search-btn, .cart-btn, .profile-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--surface-hover);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.search-btn:hover, .cart-btn:hover, .profile-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.cart-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

/* Navigation Tabs */
.nav-tabs {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs-list {
    display: flex;
    min-width: max-content;
}

.nav-tab {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-tab:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--surface-hover);
}

.nav-tab .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--error-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Catalog */
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.catalog-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.catalog-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sort-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 180px;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.category-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-card.tools {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #f87171;
}

.category-card.materials {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-color: #4ade80;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.category-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    background: var(--surface-hover);
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

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

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #fbbf24;
    font-size: 14px;
}

.star.empty {
    color: var(--border);
}

.rating-text {
    font-size: 12px;
    color: var(--text-muted);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Корзина - ИСПРАВЛЕННАЯ МОБИЛЬНАЯ ВЕРСИЯ */
.cart-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.cart-item-main {
    display: flex;
    padding: 20px;
    gap: 16px;
    align-items: flex-start;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-hover);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface-hover);
    border-top: 1px solid var(--border);
}

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

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    transition: var(--transition);
}

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

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    color: var(--text-primary);
}

.remove-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--error-color);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.cart-summary {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.clear-cart-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--error-color);
    background: transparent;
    color: var(--error-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: var(--transition);
}

.clear-cart-btn:hover {
    background: var(--error-color);
    color: white;
}

/* Мобильная адаптивность для корзины */
@media (max-width: 768px) {
    .cart-item-main {
        padding: 16px;
        gap: 12px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-name {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .cart-item-price {
        font-size: 16px;
    }
    
    .cart-item-controls {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .quantity-controls {
        align-self: center;
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 50px;
        height: 36px;
        font-size: 14px;
    }
    
    .remove-btn {
        width: 36px;
        height: 36px;
        align-self: center;
    }
    
    .cart-summary {
        padding: 20px;
        margin-top: 20px;
    }
    
    .checkout-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* Модальные окна - ИСПРАВЛЕННАЯ АДАПТИВНОСТЬ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-hover);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
}

.modal-body {
    padding: 24px;
}

/* Модальное окно товара - ИСПРАВЛЕНО */
.product-modal-image {
    width: 100%;
    height: 250px;
    background: var(--surface-hover);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-modal-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.product-modal-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.product-modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

.meta-value {
    color: var(--text-primary);
    font-weight: 600;
}

.product-modal-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

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

.modal-action-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
}

.modal-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.modal-action-btn.primary:hover {
    box-shadow: var(--shadow-md);
}

/* Оформление заказа - ИСПРАВЛЕННАЯ АДАПТИВНОСТЬ */
.checkout-step {
    margin-bottom: 24px;
}

.checkout-step h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.delivery-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.delivery-method {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.delivery-method:hover {
    border-color: var(--primary-color);
}

.delivery-method input[type="radio"] {
    margin: 0;
}

.delivery-method input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.delivery-method:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

#region-select, #delivery-address {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition);
}

#region-select:focus, #delivery-address:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#delivery-address {
    resize: vertical;
    min-height: 80px;
}

.checkout-summary {
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 16px;
    margin: 20px 0;
}

.checkout-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.checkout-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.checkout-actions .cancel-btn {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.checkout-actions .confirm-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.checkout-actions button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Мобильная адаптивность для модальных окон */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-end;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: modalSlideUp 0.3s ease;
    }
    
    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .modal-header {
        padding: 20px 20px 0;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .product-modal-image {
        height: 200px;
    }
    
    .product-modal-name {
        font-size: 18px;
    }
    
    .product-modal-price {
        font-size: 20px;
    }
    
    .product-modal-meta {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .delivery-methods {
        flex-direction: column;
    }
    
    .checkout-actions {
        flex-direction: column;
    }
}

/* Toast уведомления */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success-color);
    z-index: 1001;
    transform: translateX(400px);
    transition: var(--transition);
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    font-size: 20px;
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-content {
    flex: 1;
}

/*
==========================================================================
Новый дизайн админ‑панели и панели продавца
Эти классы добавлены для улучшенного внешнего вида разделов администратора
и продавца. Они основаны на переменных темы, чтобы дизайн оставался
однородным с остальным приложением.
*/

/* =================== Админ‑панель =================== */

/* Контейнер статистики админ‑панели */
.admin-dashboard {
    margin-bottom: 24px;
}

/* Адаптивная сетка карточек статистики */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Карточка статистики */
.admin-stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

/* Заголовок карточки (для иконки) */
.admin-stat-header {
    margin-bottom: 12px;
}

/* Иконка статистики */
.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* Цвета иконок для разных показателей */
.admin-stat-icon.users { background: var(--primary-color); }
.admin-stat-icon.sellers { background: var(--accent-color); }
.admin-stat-icon.products { background: var(--secondary-color); }
.admin-stat-icon.pending { background: var(--warning-color); }

/* Значение статистики */
.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Подпись статистики */
.admin-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Изменение статистики (не используется динамически) */
.admin-stat-change {
    font-size: 12px;
    margin-top: 6px;
}
.admin-stat-change.positive { color: var(--success-color); }
.admin-stat-change.negative { color: var(--error-color); }

/* Общий блок раздела администратора */
.admin-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* Шапка раздела */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Заголовок раздела */
.admin-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Контейнер действий раздела (например, счётчик) */
.admin-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Сетка карточек товаров на модерации */
.admin-pending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

/* Элемент товара на модерации */
.admin-pending-item {
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

/* Внутреннее содержимое товара: картинка и информация */
.admin-pending-content {
    display: flex;
    gap: 16px;
}

/* Миниатюра товара на модерации */
.admin-pending-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

/* Информационный блок о товаре */
.admin-pending-info {
    flex: 1;
}

/* Метаданные (ID, категория, дата) */
.admin-pending-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* Цена товара в модерации */
.admin-pending-price {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 4px;
}

/* Действия (кнопки) для товара */
.admin-pending-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Кнопки одобрения/отклонения */
.admin-approve-btn,
.admin-reject-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.admin-approve-btn { background: var(--success-color); }
.admin-reject-btn { background: var(--error-color); }

.admin-approve-btn:hover,
.admin-reject-btn:hover {
    filter: brightness(0.95);
}

/* Форма назначения продавца */
.admin-assign-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-assign-form input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    flex: 1;
    background: var(--surface-hover);
    color: var(--text-primary);
}

.admin-assign-form button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.admin-assign-form button:hover {
    background: var(--primary-dark);
}

/* =================== Панель продавца =================== */

/* Контейнер статистики продавца */
.seller-dashboard {
    margin-bottom: 24px;
}

/* Сетка статистики продавца */
.seller-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

/* Карточка статистики продавца */
.seller-stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
}

.seller-stat-header {
    margin-bottom: 12px;
}

.seller-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.seller-stat-icon.products { background: var(--secondary-color); }
.seller-stat-icon.pending { background: var(--warning-color); }
.seller-stat-icon.approved { background: var(--success-color); }
.seller-stat-icon.rejected { background: var(--error-color); }

.seller-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.seller-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Общий блок панели продавца */
.seller-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

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

.seller-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Сетка товаров продавца */
.seller-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Карточка товара продавца */
.seller-product-item {
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.seller-product-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

.seller-product-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

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

.seller-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Статус товара */
.seller-product-status {
    font-weight: 600;
    font-size: 14px;
}

.seller-product-status.approved { color: var(--success-color); }
.seller-product-status.pending { color: var(--warning-color); }
.seller-product-status.rejected { color: var(--error-color); }

/* Блок с инструкциями по созданию товара */
.seller-instructions {
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.seller-instructions h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.seller-instructions ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Форма создания товара */
.seller-create-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.seller-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.seller-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.seller-form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.seller-form-label.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 2px;
}

.seller-form-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface-hover);
    color: var(--text-primary);
    resize: none;
}

.seller-form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg width="14" height="8" viewBox="0 0 14 8" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M7 8L0.0717979 0.5H13.9282L7 8Z" fill="%2394a3b8"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 6px;
    padding-right: 32px;
}

.seller-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.seller-form-help {
    font-size: 12px;
    color: var(--text-muted);
}

.seller-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.seller-form-button {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    transition: var(--transition);
}

.seller-form-button.secondary {
    background: var(--surface-hover);
    color: var(--primary-color);
    border: 1px solid var(--border);
}

.seller-form-button.secondary:hover {
    background: var(--surface);
}

.seller-form-button.primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.seller-form-button.primary:hover {
    background: var(--primary-dark);
}

/* =================== Панель курьера =================== */

/* Контейнер статистики курьера */
.courier-dashboard {
    margin-bottom: 24px;
}

/* Сетка карточек статистики курьера */
.courier-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

/* Карточка статистики курьера */
.courier-stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
}

.courier-stat-header {
    margin-bottom: 12px;
}

.courier-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.courier-stat-icon.accepted { background: var(--accent-color); }
.courier-stat-icon.inprogress { background: var(--primary-color); }
.courier-stat-icon.delivered { background: var(--success-color); }
.courier-stat-icon.canceled { background: var(--error-color); }

.courier-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.courier-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Общий блок раздела курьера */
.courier-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

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

.courier-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.courier-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.courier-order-item {
    background: var(--surface-hover);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.courier-order-content {
    display: flex;
    gap: 16px;
    align-items: center;
}

.courier-order-info {
    flex: 1;
}

.courier-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.courier-order-status {
    font-weight: 600;
    font-size: 14px;
}

.courier-order-status.accepted { color: var(--accent-color); }
.courier-order-status.inprogress { color: var(--warning-color); }
.courier-order-status.delivered { color: var(--success-color); }
.courier-order-status.canceled { color: var(--error-color); }

.courier-order-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.courier-status-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface-hover);
    color: var(--text-primary);
}

.courier-update-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Форма выбора региона в панели курьера */
.courier-region-form {
    display: flex;
    gap: 12px; /* небольшое расстояние между селектом и кнопкой */
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* Дополнительные поля для назначения заказа курьеру */
.admin-assign-order-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface-hover);
    color: var(--text-primary);
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Мобильная адаптивность для toast */
@media (max-width: 768px) {
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Общая мобильная адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header-content {
        padding: 10px 0;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    .catalog-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .catalog-title {
        font-size: 20px;
    }
    
    .catalog-controls {
        justify-content: space-between;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .product-card {
        border-radius: var(--radius);
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .current-price {
        font-size: 18px;
    }
}

/* Дополнительные утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.hidden { display: none !important; }
.visible { display: block !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }



/* Orders styles */
.order-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.order-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
}

.order-info p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-info i {
    color: #9ca3af;
    width: 16px;
}

/* Profile styles */
.profile-form {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.profile-form h3 {
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-form h3 i {
    color: #2563eb;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
    box-sizing: border-box;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.save-profile-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.save-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.save-profile-btn:active {
    transform: translateY(0);
}

/* Order details modal */
.order-details {
    margin-bottom: 20px;
}

.order-details p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-details strong {
    color: #1f2937;
}

.order-items {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item span:first-child {
    font-weight: 500;
    color: #1f2937;
}

.order-item span:last-child {
    color: #2563eb;
    font-weight: 600;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #374151;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ============== Аутентификация (логин/регистрация) ============== */
/* Карточка для форм авторизации */
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    width: 100%;
}

/* Контейнер вкладок (Вход/Регистрация) */
.auth-tabs {
    display: flex;
    margin-bottom: 16px;
}

/* Кнопка вкладки */
.auth-tab {
    flex: 1;
    padding: 12px 0;
    background: var(--surface-hover);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

/* Активная вкладка */
.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Поле ввода в форме */
.auth-form .form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.auth-form label {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.auth-form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Кнопка отправки формы */
.auth-submit-btn {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

