* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: #1a1a1a;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e9ecef;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a1a1a;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav a {
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav a:hover {
    background-color: rgba(0,0,0,0.05);
}

.user-info {
    color: #1a1a1a;
    font-weight: 500;
}

.btn-logout {
    background-color: #e74c3c;
}

.btn-logout:hover {
    background-color: #c0392b;
}

.cart-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 0;
    background: #f8f9fa;
}

/* Footer */
.footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Modern Form Styles */
.form-container-modern {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.form-header-modern {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-title-modern {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.02em;
}

.form-modern {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-label-modern {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.form-label-modern .required {
    color: #e74c3c;
}

.form-input-modern,
.form-textarea-modern {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    color: #1a1a1a;
}

select.form-input-modern {
    appearance: none;
    background-color: #fafafa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.75rem;
    cursor: pointer;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    background: #fafafa;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.custom-select-trigger svg {
    color: #6c757d;
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    display: none;
    z-index: 20;
    max-height: 240px;
    overflow-y: auto;
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.custom-select-option {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.9rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.custom-select-option:hover {
    background: #f3f4f8;
}

.custom-select-option.selected {
    background: rgba(102, 126, 234, 0.12);
    color: #4a5bdc;
    font-weight: 600;
}

.form-input-modern:focus,
.form-textarea-modern:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-textarea-modern {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.file-upload-modern {
    position: relative;
}

.file-input-modern {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.file-label-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.current-image-modern {
    margin-bottom: 1.5rem;
    text-align: center;
}

.preview-image-modern {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.preview-label-modern {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.75rem;
    font-weight: 500;
}

.form-hint-modern {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

.checkbox-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-input-modern {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label-modern {
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
}

.form-actions-modern {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.btn-modern-submit {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-modern-cancel {
    background: #f0f0f0;
    color: #1a1a1a;
}

.btn-modern-cancel:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-message {
    color: #e74c3c;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.success-message {
    color: #27ae60;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Catalog Page */
.catalog-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.catalog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.catalog-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.catalog-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.catalog-filter-form {
    margin-top: 1.5rem;
    max-width: 360px;
}

.catalog-filter-label {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.alert-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-toast span {
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Products Grid - Modern Design */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card-modern {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    position: relative;
}

.product-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

.product-image-container {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image-container.no-image {
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

.product-image-modern {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.product-card-modern:hover .product-image-modern {
    transform: scale(1.05);
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #9e9e9e;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.product-badge.out-of-stock {
    background: rgba(231, 76, 60, 0.95);
    color: white;
    backdrop-filter: blur(10px);
}

.product-badge.low-stock {
    background: rgba(241, 196, 15, 0.95);
    color: #1a1a1a;
    backdrop-filter: blur(10px);
}

.product-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name-modern {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #4a5bdc;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-description-modern {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-info {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.product-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.product-price-modern {
    font-size: 1.75rem;
    font-weight: 700;
    color: #27ae60;
    line-height: 1;
}

.product-unit-modern {
    font-size: 0.85rem;
    color: #95a5a6;
    font-weight: 500;
}

.product-stock-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.product-stock-modern svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.product-stock-modern.low {
    color: #e67e22;
}

.product-stock-modern.out {
    color: #e74c3c;
    font-weight: 600;
}

.btn-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 0.5rem;
}

.btn-add-to-cart.btn-inline {
    width: auto;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
    margin-top: 0;
}

.btn-add-to-cart.btn-inline:hover:not(.disabled) {
    transform: translateY(-1px);
}

.btn-add-to-cart:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-add-to-cart:active:not(.disabled) {
    transform: translateY(0);
}

.btn-add-to-cart.disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-add-to-cart svg {
    flex-shrink: 0;
}

/* Legacy styles for compatibility */
.product-card {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-image-wrapper {
    width: 100%;
    height: 250px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 1rem;
}

.product-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.product-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 0.5rem;
}

.product-stock {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.product-stock.low {
    color: #e74c3c;
}

.product-stock.out {
    color: #e74c3c;
    font-weight: bold;
}

.product-unit {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* Cart */
.cart-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 1rem;
}

.cart-item-quantity input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-item-total {
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 120px;
    text-align: right;
}

.cart-summary {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #2c3e50;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Orders */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-number {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}


.order-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

.order-status.new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.order-status.confirmed {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.order-status.delivered {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.order-status.cancelled {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: #7f8c8d;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Admin catalog cards on desktop */
.table-container.card-grid table {
    display: block;
}

.table-container.card-grid thead {
    display: none;
}

.table-container.card-grid tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.table-container.card-grid tr {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: 100%;
}

.table-container.card-grid td {
    display: block;
    border: none;
    padding: 0.35rem 0;
}

.table-container.card-grid td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    color: #8a8f98;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.table-container.card-grid td[data-label="Изображение"]::before {
    display: none;
}

.table-container.card-grid td[data-label="Изображение"] {
    text-align: center;
    padding-top: 0;
}

.table-container.card-grid td[data-label="Действия"] {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #eef0f2;
}

.table-container.card-grid td[data-label="Действия"] .btn,
.table-container.card-grid td[data-label="Действия"] .btn-add-to-cart {
    width: 100%;
    justify-content: center;
}

.table-container.card-grid.product-catalog tbody {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.table-container.card-grid.user-catalog tbody {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr:last-child {
    border-bottom: none;
}

/* Admin Styles */
.admin-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    color: #1a1a1a;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e9ecef;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-nav a:not(.nav-link-modern) {
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.admin-nav a:not(.nav-link-modern):hover {
    background-color: rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.admin-nav a:not(.nav-link-modern).active {
    background-color: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.admin-nav .user-info {
    color: #6c757d;
    font-weight: 500;
    padding: 0.6rem 1rem;
    margin-left: auto;
    margin-right: 0.5rem;
}

.admin-nav .btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.admin-nav .btn-logout:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Admin Order View */
.admin-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

/* Admin Settings Layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.settings-card {
    height: 100%;
}

.settings-divider {
    height: 1px;
    background: #eef0f2;
    margin: 1.5rem 0;
}

.settings-accordion {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e6e9ee;
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.settings-accordion-trigger:hover {
    border-color: #d7dbe0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.settings-accordion-trigger svg {
    color: #6c757d;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.settings-accordion-item.open .settings-accordion-trigger svg {
    transform: rotate(180deg);
}

.settings-accordion-panel {
    display: none;
}

.settings-accordion-item.open .settings-accordion-panel {
    display: block;
}

.admin-order-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.admin-order-card {
    border: 1px solid #eef0f2;
}

.admin-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.admin-section-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
}

.admin-info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-info-item span {
    display: block;
    font-size: 0.85rem;
    color: #8a8f98;
    margin-bottom: 0.3rem;
}

.admin-info-item strong {
    color: #1a1a1a;
    font-weight: 600;
}

.admin-info-wide {
    grid-column: 1 / -1;
}

.admin-order-actions {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}

.admin-action-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.admin-action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-action-buttons .btn-modern-primary,
.admin-action-buttons .btn-danger {
    min-width: 160px;
    justify-content: center;
}

.admin-total-badge {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #4a5bdc;
    font-weight: 700;
    font-size: 0.95rem;
}

.admin-order-items {
    margin-top: 2rem;
}

.admin-total-row-modern {
    font-weight: 700;
    background: #f8f9fb;
}

.admin-total-row-modern .item-name-modern {
    color: #1a1a1a;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modern Mobile Navigation */
.nav-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #6c757d;
}

.nav-close-btn:hover {
    background: #e0e0e0;
    color: #1a1a1a;
    transform: rotate(90deg);
}

.nav-close-btn svg {
    width: 20px;
    height: 20px;
}

.nav-user-section {
    display: none;
    padding: 1.5rem;
    background: #f0f0f0;
    border-radius: 12px;
    margin: 0 1.5rem 1rem;
}

.nav-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.nav-user-info {
    color: #1a1a1a;
}

.nav-user-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.nav-user-email {
    font-size: 0.85rem;
    color: #6c757d;
}

.nav-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.75rem 1.5rem;
    display: none;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    min-height: 56px;
    color: #1a1a1a !important;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    font-size: 1rem;
    border-left: 3px solid transparent;
}

.nav-link-modern span {
    color: #1a1a1a !important;
    flex: 1;
}

.nav-link-modern svg {
    flex-shrink: 0;
    opacity: 0.7;
    color: #6c757d;
    transition: all 0.3s ease;
}

.nav-link-modern:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
    transform: translateX(4px);
}

.nav-link-modern:hover span {
    color: #1a1a1a !important;
}

.nav-link-modern:hover svg {
    opacity: 1;
    color: #667eea;
}

.nav-link-modern.active {
    background: rgba(102, 126, 234, 0.12);
    border-left-color: #667eea;
}

.nav-link-modern.active svg {
    opacity: 1;
    color: #667eea;
}

.nav-link-logout {
    color: #e74c3c !important;
    margin-top: 0.5rem;
}

.nav-link-logout span {
    color: #e74c3c !important;
}

.nav-link-logout svg {
    color: #e74c3c;
}

.nav-link-logout:hover {
    background: #fee;
    border-left-color: #e74c3c;
}

.nav-link-logout:hover span {
    color: #e74c3c !important;
}

.nav-link-logout:hover svg {
    color: #e74c3c;
}

.nav-badge-modern {
    margin-left: auto;
    background: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 14px;
    min-width: 28px;
    text-align: center;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        position: relative;
        z-index: 1000;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }
    
    .mobile-menu-overlay {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 0;
        gap: 0;
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        border-left: 1px solid #e0e0e0;
        pointer-events: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-close-btn {
        display: flex;
    }
    
    .nav-user-section {
        display: block;
        margin: 0 1.5rem 1rem;
        margin-top: 3rem;
    }
    
    .nav-divider {
        display: block;
        margin: 0.5rem 1.5rem;
    }
    
    .nav-link-modern {
        margin: 0;
        border-radius: 0;
        padding: 1.25rem 1.5rem;
        min-height: 56px;
    }
    
    .nav-link-modern:first-of-type {
        margin-top: 0;
    }
    
    .user-info {
        display: none;
    }
    
    .cart-badge {
        display: none;
    }
}
    
    .catalog-page {
        padding: 1rem 0.5rem;
    }
    
    .catalog-title {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-image-container {
        height: 240px;
    }
    
    .product-card-modern {
        border-radius: 12px;
    }
    
    /* Admin mobile styles */
    .admin-menu-toggle {
        display: flex !important;
    }
    
    .admin-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 0;
        gap: 0;
        overflow-y: auto;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        border-left: 1px solid #e0e0e0;
        pointer-events: auto;
    }
    
    .admin-nav.active {
        right: 0;
    }
    
    .admin-nav a:not(.nav-link-modern) {
        padding: 1.25rem 1.5rem;
        border-radius: 0;
        margin: 0;
        border-left: 3px solid transparent;
        width: 100%;
        justify-content: flex-start;
    }
    
    .admin-nav a:not(.nav-link-modern).active {
        border-left-color: #667eea;
        background-color: rgba(102, 126, 234, 0.1);
    }
    
    .admin-nav .user-info {
        padding: 1.25rem 1.5rem;
        margin: 0;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 0.5rem;
    }
    
    .admin-nav .btn-logout {
        margin: 0.5rem 1.5rem 0;
        width: auto;
    }
    
    .admin-overlay {
        z-index: 998;
    }
    
    .admin-overlay.active {
        pointer-events: auto;
    }
    
    .admin-menu-toggle.active {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }
    
    /* Admin Products Mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-container,
    .form-container-modern {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .form-container > div[style*="grid"],
    .form-grid-modern {
        grid-template-columns: 1fr !important;
    }
    
    .form-title-modern {
        font-size: 1.5rem;
    }
    
    .form-actions-modern {
        flex-direction: column;
    }
    
    .form-actions-modern .btn {
        width: 100%;
    }

    .admin-order-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-order-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .admin-action-buttons .btn-modern-primary,
    .admin-action-buttons .btn-danger {
        width: 100%;
    }
    
    /* Mobile table to cards */
    .table-container {
        overflow: visible;
    }

    .table-container.card-grid tbody {
        grid-template-columns: 1fr;
        padding: 0;
    }

    /* Prevent label/content overlap for card grids on mobile */
    .table-container.card-grid td {
        position: static;
        padding: 0.35rem 0;
        padding-left: 0;
        text-align: left;
    }

    .table-container.card-grid td::before {
        position: static;
        width: auto;
        padding-right: 0;
        white-space: normal;
        margin-bottom: 0.2rem;
    }
    
    .table-container table,
    .table-container thead,
    .table-container tbody,
    .table-container th,
    .table-container td,
    .table-container tr {
        display: block;
    }
    
    .table-container thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-container tr {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .table-container td {
        border: none;
        position: relative;
        padding: 0.75rem 0;
        padding-left: 40%;
        text-align: left;
    }
    
    .table-container td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #667eea;
        font-size: 0.9rem;
    }
    
    .table-container td[data-label="Изображение"] {
        padding-left: 0;
    }
    
    .table-container td[data-label="Изображение"]:before {
        display: none;
    }
    
    .table-container td[data-label="Изображение"] img {
        display: block;
        margin: 0 auto;
    }
    
    .table-container td:last-child {
        padding-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
    }
    
    .table-container td:last-child:before {
        display: none;
    }
    
    .table-container td .btn {
        width: 100%;
        margin: 0.25rem 0;
        justify-content: center;
    }
    
    .table-container td img {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .table-container td[data-label="Действия"] .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    
    /* Admin Users Mobile */
    .user-orders-modal {
        max-width: 100%;
        margin: 1rem 0;
        padding: 1.5rem;
    }
    
    .user-orders-modal {
        padding: 1rem !important;
    }
    
    .user-orders-modal > div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-orders-modal h2 {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .user-orders-modal .btn {
        width: 100%;
        justify-content: center;
    }
    
    .user-orders-modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Admin table mobile improvements */
    .table-container table {
        font-size: 0.85rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-item-quantity {
        width: 100%;
        margin: 0;
    }
    
    .checkout-grid {
        grid-template-columns: 1fr !important;
    }
    
    .alert-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .catalog-title {
        font-size: 1.75rem;
    }
    
    .catalog-subtitle {
        font-size: 1rem;
    }
    
    .product-content {
        padding: 1.25rem;
    }
    
    .product-price-modern {
        font-size: 1.5rem;
    }
    
    .btn-add-to-cart {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}
