:root {
    --primary-color: #2c6bbf;
    --secondary-color: #3a9d4e;
    --accent-color: #ff9800;
    --light-bg: #f5f7fa;
    --dark-bg: #1a1a2e;
    --light-text: #333;
    --dark-text: #f1f1f1;
    --light-card: #fff;
    --dark-card: #16213e;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-small: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, transform 0.2s, box-shadow 0.2s;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 0 0 80px 0;
    background-color: var(--light-bg);
    color: var(--light-text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

body.dark-theme {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.container {
    max-width: 100%;
    padding: 0 16px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    padding: 18px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.logo-text h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-text p {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 400;
}

.theme-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.theme-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Страницы */
.page {
    display: none;
    padding: 20px 0;
    min-height: calc(100vh - 140px);
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.page-title {
    margin-bottom: 24px;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.page-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

body.dark-theme .page-title {
    color: #6ab0ff;
}

/* Навигация */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0 18px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

body.dark-theme nav {
    background-color: var(--dark-card);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 16px;
    transition: all 0.3s;
    position: relative;
    min-width: 64px;
}

body.dark-theme .nav-item {
    color: #aaa;
}

.nav-item i {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    transform: translateY(-8px);
    box-shadow: 0 6px 15px rgba(44, 107, 191, 0.3);
}

body.dark-theme .nav-item.active {
    background: linear-gradient(135deg, #3a8fff, #1e4a8e);
    box-shadow: 0 6px 15px rgba(58, 143, 255, 0.3);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Фильтры категорий */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.toggle-filters-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-filters-btn i {
    transition: transform 0.3s;
}

.toggle-filters-btn.collapsed i {
    transform: rotate(180deg);
}

.filters-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-bottom: 24px;
}

.filters-container.expanded {
    max-height: 500px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
}

.filter-btn {
    padding: 12px 20px;
    background-color: var(--light-card);
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    color: #555;
}

body.dark-theme .filter-btn {
    background-color: var(--dark-card);
    border-color: #444;
    color: #ccc;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(44, 107, 191, 0.2);
}

.filter-btn:active {
    transform: scale(0.95);
}

/* Сортировка и фильтры */
.sort-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.sort-filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.sort-filter-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

body.dark-theme .sort-filter-label {
    color: #ccc;
}

.sort-filter-select {
    padding: 12px 16px;
    background-color: var(--light-card);
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: #555;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

body.dark-theme .sort-filter-select {
    background-color: var(--dark-card);
    border-color: #444;
    color: #ccc;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.sort-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.price-filter {
    margin-top: 16px;
    background-color: var(--light-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

body.dark-theme .price-filter {
    background-color: var(--dark-card);
}

.price-inputs {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.price-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f9f9f9;
}

body.dark-theme .price-input {
    background-color: #2a2a3e;
    border-color: #444;
    color: var(--dark-text);
}

/* Поисковая строка */
.search-box {
    margin-bottom: 24px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 2;
}

body.dark-theme .search-box i {
    color: #aaa;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    background-color: var(--light-card);
    color: var(--light-text);
    transition: border-color 0.3s;
}

body.dark-theme .search-input {
    background-color: var(--dark-card);
    border-color: #444;
    color: var(--dark-text);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Карточки товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: var(--light-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

body.dark-theme .product-card {
    background-color: var(--dark-card);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

body.dark-theme .product-description {
    color: #aaa;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-weight: 800;
    color: var(--secondary-color);
    font-size: 1.3rem;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, var(--secondary-color), #2e7d32);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(58, 157, 78, 0.3);
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: 8px;
}

.add-to-cart-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(58, 157, 78, 0.3);
}

/* Детальная страница товара */
.product-detail {
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

body.dark-theme .product-detail {
    background-color: var(--dark-card);
}

.product-detail-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.3s;
}

.product-detail-image:hover {
    opacity: 0.9;
}

.product-detail-info {
    padding: 24px;
}

.product-detail-name {
    font-weight: 800;
    margin-bottom: 12px;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.product-detail-price {
    font-weight: 800;
    color: var(--secondary-color);
    font-size: 2rem;
    margin-bottom: 20px;
}

.product-detail-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    color: var(--light-text);
}

body.dark-theme .product-detail-description {
    color: var(--dark-text);
}

.product-detail-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.image-gallery {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.gallery-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.gallery-image.active {
    border-color: var(--primary-color);
}

/* Кнопки */
.btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 6px 15px rgba(44, 107, 191, 0.2);
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(44, 107, 191, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #2e7d32);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

body.dark-theme .btn-outline {
    color: #6ab0ff;
    border-color: #6ab0ff;
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Формы */
.auth-form, .profile-form {
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--light-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

body.dark-theme .auth-form, body.dark-theme .profile-form {
    background-color: var(--dark-card);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f9f9f9;
    transition: border-color 0.3s;
}

body.dark-theme .form-control {
    background-color: #2a2a3e;
    border-color: #444;
    color: var(--dark-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

body.dark-theme .form-footer a {
    color: #6ab0ff;
}

/* Профиль */
.profile-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 15px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    display: block;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.2s;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.dark-theme .avatar-upload-btn {
    border-color: var(--dark-card);
}

.avatar-upload-btn:hover {
    background-color: #1a5cb0;
    transform: scale(1.1);
}

.avatar-upload-btn i {
    font-size: 0.9rem;
}

.user-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-email {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

body.dark-theme .user-email {
    color: #aaa;
}

.balance-card {
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.balance-title {
    font-size: 1rem;
    margin-bottom: 10px;
    opacity: 0.95;
    font-weight: 500;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
}

/* История заказов в профиле */
.orders-history {
    margin-top: 30px;
}

.orders-history h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.order-card {
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

body.dark-theme .order-card {
    background-color: var(--dark-card);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

body.dark-theme .order-header {
    border-bottom: 1px solid #444;
}

.order-id {
    font-weight: 700;
    font-size: 1.1rem;
}

.order-date {
    font-size: 0.9rem;
    color: #666;
}

body.dark-theme .order-date {
    color: #aaa;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-new {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-processing {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-delivered {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-cancelled {
    background-color: #ffebee;
    color: #d32f2f;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.1rem;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

body.dark-theme .order-total {
    border-top-color: #444;
}

/* Админ-панель */
.admin-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav-btn {
    padding: 12px 20px;
    background-color: var(--light-card);
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    color: #555;
}

body.dark-theme .admin-nav-btn {
    background-color: var(--dark-card);
    border-color: #444;
    color: #ccc;
}

.admin-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 6px 15px rgba(44, 107, 191, 0.2);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--light-card);
    min-width: 600px;
}

body.dark-theme .admin-table {
    background-color: var(--dark-card);
}

.admin-table th, .admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

body.dark-theme .admin-table th, body.dark-theme .admin-table td {
    border-bottom: 1px solid #444;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    user-select: none;
    position: relative;
}

body.dark-theme .admin-table th {
    background-color: #2a2a3e;
    color: #ccc;
}

.admin-table th.sortable:hover {
    background-color: #e9ecef;
}

body.dark-theme .admin-table th.sortable:hover {
    background-color: #343a46;
}

.admin-table th.sort-asc::after {
    content: ' ↑';
    color: var(--primary-color);
}

.admin-table th.sort-desc::after {
    content: ' ↓';
    color: var(--primary-color);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.action-btn {
    padding: 8px 16px;
    margin-right: 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.edit {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
}

.action-btn.delete {
    background: linear-gradient(135deg, #dc3545, #b02a37);
    color: white;
}

/* Корзина */
.cart-items {
    margin-bottom: 24px;
}

.cart-item {
    display: flex;
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    align-items: center;
    cursor: pointer;
}

body.dark-theme .cart-item {
    background-color: var(--dark-card);
}

.cart-item:active {
    transform: scale(0.99);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    margin-right: 16px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
}

.cart-item-price {
    color: var(--secondary-color);
    font-weight: 800;
    font-size: 1.2rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.cart-item-quantity {
    margin: 0 12px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.quantity-btn:active {
    transform: scale(0.9);
}

.remove-item {
    margin-left: auto;
    color: #ff6b6b;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:active {
    background-color: rgba(255, 107, 107, 0.1);
}

.cart-summary {
    background-color: var(--light-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

body.dark-theme .cart-summary {
    background-color: var(--dark-card);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #ddd;
}

body.dark-theme .cart-total {
    border-bottom-color: #444;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(150%);
    transition: transform 0.4s;
    max-width: 300px;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--light-card);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

body.dark-theme .modal-content {
    background-color: var(--dark-card);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #eee;
}

body.dark-theme .modal-header {
    border-bottom: 2px solid #444;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .close-modal {
    color: #aaa;
}

.close-modal:active {
    background-color: rgba(0,0,0,0.05);
}

body.dark-theme .close-modal:active {
    background-color: rgba(255,255,255,0.05);
}

/* Модальное окно подтверждения */
.confirm-modal .modal-content {
    max-width: 400px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.confirm-buttons button {
    flex: 1;
}

/* Модальное окно полноэкранного изображения */
.image-fullscreen-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.fullscreen-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Загрузка изображений */
.image-upload {
    border: 3px dashed #ddd;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.3s;
}

body.dark-theme .image-upload {
    border-color: #444;
}

.image-upload:hover {
    border-color: var(--primary-color);
}

.image-upload i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #666;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 16px;
    display: none;
    border-radius: 12px;
    object-fit: contain;
}

.image-preview.show {
    display: block;
    margin: 16px auto;
}

/* Кастомная кнопка выбора файлов */
.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input-button {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), #1e4a8e);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 6px 15px rgba(44, 107, 191, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-input-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(44, 107, 191, 0.2);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.file-preview-item {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Индикатор надежности пароля */
.password-strength {
    margin-top: 10px;
}

.password-strength-bar {
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background-color 0.3s;
}

.password-strength-text {
    font-size: 0.85rem;
    text-align: right;
}

.strength-weak {
    background-color: #ff4757;
}

.strength-medium {
    background-color: #ffa502;
}

.strength-strong {
    background-color: #2ed573;
}

/* Стили для модального окна оплаты */
.payment-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

body.dark-theme .payment-tabs {
    border-bottom: 2px solid #444;
}

.payment-tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    transition: all 0.3s;
}

body.dark-theme .payment-tab {
    color: #aaa;
}

.payment-tab.active {
    color: var(--primary-color);
    background-color: rgba(44, 107, 191, 0.1);
    position: relative;
}

body.dark-theme .payment-tab.active {
    background-color: rgba(106, 176, 255, 0.1);
}

.payment-tab-content {
    display: none;
}

.payment-tab-content.active {
    display: block;
}

/* Стили для формы карты */
.card-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-input-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #555;
}

body.dark-theme .card-input-group label {
    color: #ccc;
}

.card-input {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f9f9f9;
    transition: border-color 0.3s;
}

body.dark-theme .card-input {
    background-color: #2a2a3e;
    border-color: #444;
    color: var(--dark-text);
}

.card-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.card-row {
    display: flex;
    gap: 15px;
}

.card-row .card-input-group {
    flex: 1;
}

.card-visual {
    background: linear-gradient(135deg, #4a6fa5, #2c6bbf);
    border-radius: 12px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(44, 107, 191, 0.2);
    position: relative;
    overflow: hidden;
}

.card-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.card-visual::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.card-chip {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.card-number {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.card-holder {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-expiry {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Стили для QR-кода */
.qr-container {
    text-align: center;
    padding: 20px 0;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background-color: white;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.dark-theme .qr-code {
    background-color: white;
}

.qr-instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(44, 107, 191, 0.05);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #555;
}

body.dark-theme .qr-instructions {
    background-color: rgba(106, 176, 255, 0.05);
    color: #aaa;
}

.qr-instructions ol {
    padding-left: 20px;
    margin-top: 10px;
    text-align: left;
}

.qr-instructions li {
    margin-bottom: 8px;
}

/* Вспомогательные классы */
.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.help-text {
    color: #666;
    font-size: 0.85rem;
}

.hidden {
    display: none !important;
}

.payment-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

body.dark-theme .empty-state {
    color: #aaa;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ccc;
}

body.dark-theme .empty-state i {
    color: #555;
}

.back-button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.back-button:active {
    transform: translateY(-50%) scale(0.95);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность */
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 0.95rem;
    }
    
    .product-detail-image {
        height: 240px;
    }
    
    .product-detail-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .nav-item {
        min-width: 60px;
        padding: 6px 10px;
    }
    
    .nav-item i {
        font-size: 1.3rem;
    }
    
    .page-title {
        font-size: 1.6rem;
    }
    
    .balance-amount {
        font-size: 1.8rem;
    }
    
    .order-card {
        padding: 16px;
    }
    
    .price-inputs {
        flex-direction: column;
    }
    
    .sort-filter-container {
        flex-direction: column;
    }
    
    .card-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .qr-code {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .logo-text h1 {
        font-size: 1.4rem;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
}