/* CSS переменные для адаптивного масштабирования */
:root {
    /* Базовые размеры для мобильных устройств */
    --base-font-size: 16px;
    --base-spacing: 1rem;
    --base-border-radius: 12px;
    --base-shadow: 0 2px 10px rgba(255, 107, 53, 0.1);
    
    /* Аппетитные оранжевые цвета */
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #ff8c42;
    --warm-orange: #ffa726;
    --light-orange: #fff3e0;
    --dark-orange: #e65100;
    
    /* Аппетитные оранжевые градиенты */
    --primary-gradient: linear-gradient(135deg, #ff6b35, #f7931e);
    --secondary-gradient: linear-gradient(135deg, #f7931e, #ff8c42);
    --warm-gradient: linear-gradient(135deg, #ffa726, #ff9800);
    --sunset-gradient: linear-gradient(135deg, #ff6b35, #ff8c42, #ffa726);
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(255, 107, 53, 0.1);
    --shadow-md: 0 4px 12px rgba(255, 107, 53, 0.15);
    --shadow-lg: 0 8px 24px rgba(255, 107, 53, 0.2);
    
    /* Размеры для разных экранов */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --content-padding: 1rem;
    
    /* Адаптивные размеры */
    --container-max-width: 100%;
    --grid-columns: 2;
    --item-min-width: 150px;
}

/* Медиа-запросы для разных размеров экранов */
@media (min-width: 768px) {
    :root {
        --base-font-size: 18px;
        --base-spacing: 1.5rem;
        --container-max-width: 768px;
        --grid-columns: 3;
        --item-min-width: 200px;
    }
}

@media (min-width: 1024px) {
    :root {
        --base-font-size: 20px;
        --base-spacing: 2rem;
        --container-max-width: 1024px;
        --grid-columns: 4;
        --item-min-width: 250px;
    }
}

@media (min-width: 1440px) {
    :root {
        --base-font-size: 22px;
        --base-spacing: 2.5rem;
        --container-max-width: 1440px;
        --item-min-width: 300px;
    }
}

/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    font-size: var(--base-font-size);
}

/* Загрузочный экран */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sunset-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.logo {
    margin-bottom: 2rem;
}

.logo i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

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

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

/* Главное приложение */
.app {
    max-width: var(--container-max-width);
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: var(--base-shadow);
}

/* Адаптивные стили для разных экранов */
@media (min-width: 768px) {
    .app {
        border-radius: var(--base-border-radius);
        margin: 1rem auto;
        min-height: calc(100vh - 2rem);
    }
}

@media (min-width: 1024px) {
    .app {
        margin: 2rem auto;
        min-height: calc(100vh - 4rem);
    }
}

/* Верхняя панель */
.header {
    background: var(--sunset-gradient);
    color: white;
    padding: var(--content-padding);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .header {
        padding: var(--base-spacing);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-small {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.logo-small i {
    margin-right: 0.5rem;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.delivery-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    max-width: 150px;
    overflow: hidden;
}

.delivery-address:hover {
    background: rgba(255, 255, 255, 0.3);
}

.delivery-address i {
    color: #fff;
    font-size: 0.9rem;
}

.delivery-address span {
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding-bottom: 80px;
}

/* Экраны */
.screen {
    display: none;
    min-height: calc(100vh - 140px);
}

.screen.active {
    display: block;
}

.screen-content {
    padding: 1rem;
}

.screen-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #667eea;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.screen-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Экран регистрации */
.welcome-section {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.welcome-section h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.welcome-section p {
    color: #666;
    font-size: 1rem;
}

/* Формы */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--base-spacing);
    padding: var(--content-padding);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: calc(var(--base-font-size) * 0.9);
}

.form-group input {
    padding: var(--base-spacing);
    border: 2px solid #e9ecef;
    border-radius: var(--base-border-radius);
    font-size: var(--base-font-size);
    transition: border-color 0.3s;
}

@media (min-width: 768px) {
    .form {
        padding: var(--base-spacing);
    }
    
    .form-group input {
        padding: 1.25rem;
    }
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Кнопки */
.btn {
    padding: var(--base-spacing) calc(var(--base-spacing) * 2);
    border: none;
    border-radius: var(--base-border-radius);
    font-size: var(--base-font-size);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    text-decoration: none;
    min-height: 44px; /* Минимальная высота для touch-устройств */
}

@media (min-width: 768px) {
    .btn {
        padding: 1.25rem 2.5rem;
        min-height: 48px;
    }
}

@media (min-width: 1024px) {
    .btn {
        padding: 1.5rem 3rem;
        min-height: 52px;
    }
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--base-shadow);
}

.btn-primary:hover {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 2px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
}

.btn-warning {
    background: #ffc107;
    color: #000;
    border: 2px solid #ffc107;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
    transform: translateY(-1px);
}

.btn-gradient {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffd23f 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #ff5722 0%, #ff9800 50%, #ffc107 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Стили для банковских карт */
.bank-cards-list {
    margin-bottom: 2rem;
}

.bank-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.bank-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.bank-card-info {
    position: relative;
    z-index: 1;
}

.bank-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bank-card-number {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.bank-card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.9;
}

.bank-card-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.bank-card-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 0.5rem;
}

.bank-card-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bank-cards-actions {
    text-align: center;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}



/* Категории */
.categories-section {
    margin-bottom: 2rem;
}

.categories-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: var(--base-spacing);
    min-width: var(--item-min-width);
}

@media (min-width: 768px) {
    .categories-grid {
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        gap: 2rem;
    }
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--base-shadow);
    cursor: pointer;
    transition: transform 0.3s;
    border: 2px solid transparent;
}

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

.category-unavailable {
    opacity: 0.6;
    cursor: not-allowed;
}

.category-unavailable:hover {
    transform: none;
}

.unavailable-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.category-card i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.category-card h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.9rem;
    color: #666;
}

/* Сообщения об отсутствии данных */
.no-categories,
.no-items {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* Товары */
.popular-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: var(--base-spacing);
    min-width: var(--item-min-width);
}

@media (min-width: 768px) {
    .items-grid {
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .items-grid {
        gap: 2rem;
    }
}

.item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
}

.item-image {
    width: 100%;
    height: 120px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 2rem;
    position: relative;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.spicy-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.item-info {
    padding: 1rem;
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-price {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1rem;
}

/* Корзина */
.cart-items {
    margin-bottom: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cart-item-info {
    flex: 1;
    margin-right: 1rem;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: #28a745;
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-footer {
    position: sticky;
    bottom: 80px;
    background: white;
    padding: 1rem;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

#cart-total-price {
    color: #28a745;
    font-weight: 700;
}

/* Профиль */
.profile-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-label {
    font-weight: 600;
    color: #333;
}

.profile-value {
    color: #666;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Заказы */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.order-number {
    font-weight: 600;
    color: #333;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.confirmed {
    background: #d1ecf1;
    color: #0c5460;
}

.order-status.delivering {
    background: #d4edda;
    color: #155724;
}

.order-status.completed {
    background: #d1e7dd;
    color: #0f5132;
}

.order-items {
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

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

.order-total {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Полосочка корзины */
.cart-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #667eea;
    color: white;
    padding: 0.75rem 1rem;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    margin: 0 1rem;
}

.cart-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-bar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-bar-count {
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-bar-text {
    font-size: 0.9rem;
}

.cart-bar-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
}

.cart-bar-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.cart-bar-hide {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 0.5rem;
}

.cart-bar-hide:hover {
    background: #5a6268;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    padding: 0.5rem;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn i {
    font-size: 1.2rem;
}

.nav-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-large {
    max-width: 800px;
}

.map-modal-content {
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.modal-content {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Детали товара */
.item-details {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.item-details-image {
    width: 100%;
    height: 200px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 3rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.item-details-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 12px;
}

.item-details-info {
    padding: 1.5rem;
}

.item-details-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-details-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.item-details-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.item-details-actions {
    display: flex;
    gap: 1rem;
}

/* Адаптивность */
@media (max-width: 480px) {
    .app {
        max-width: 100%;
        box-shadow: none;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    animation: fadeIn 0.3s ease-out;
}

/* Стили для карты */
.map-address-info {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    max-width: 100%;
    overflow: hidden;
}

.map-modal-content {
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.map-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.map-address-info p {
    margin: 0.5rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.form-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

/* Админ-панель */
.admin-panel {
    padding: 1rem;
}

.admin-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.admin-section h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.2rem;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-number:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Админ-управление */
.admin-management {
    max-height: 60vh;
    overflow-y: auto;
}

.category-list, .items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-item, .item-management, .order-item, .user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-management span {
    flex: 1;
    min-width: 200px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-management img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.item-icon {
    font-size: 1.2rem;
    min-width: 1.5rem;
}

.popular-badge {
    color: #ffc107;
    font-size: 1.2rem;
}

.order-item, .user-item {
    flex-direction: column;
    align-items: stretch;
}

.order-header, .user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-info, .user-info {
    flex: 1;
}

.order-info p, .user-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.order-info ul {
    margin: 0.25rem 0;
    padding-left: 1rem;
}

.order-info li {
    font-size: 0.85rem;
    margin: 0.1rem 0;
}

.item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.item-details strong {
    font-size: 1rem;
    color: #333;
}

.item-price-popular {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.item-price {
    font-weight: 600;
    color: #28a745;
    font-size: 0.9rem;
}

.popular-badge {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Стили для выбора валюты */
.currency-select {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.currency-prices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.currency-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.currency-price-row label {
    min-width: 80px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.currency-price-row input {
    flex: 1;
}

.currency-select:hover {
    border-color: var(--primary-color);
}

.currency-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

/* Восстанавливаем стили для кнопок */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Стили для карточек товаров с картинками */
.item-card .item-image img {
    transition: all 0.3s ease;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    background-color: #ffffff;
    padding: 8px;
}

.item-card .item-image img:hover {
    transform: scale(1.02);
}

/* Ограничиваем размер карточек товаров */
.item-card {
    max-width: 300px;
    min-height: 200px;
}

.item-card .item-image {
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

/* Стили для улучшения отображения картинок */
.image-upload-container {
    position: relative;
}

.image-preview-container {
    position: relative;
    margin-top: 0.5rem;
}

.image-preview-container img {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview-container img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#item-image-placeholder,
#edit-item-image-placeholder {
    transition: all 0.3s ease;
    cursor: pointer;
}

#item-image-placeholder:hover,
#edit-item-image-placeholder:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

/* Утилиты */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Специальные стили для Telegram WebApp */
.telegram-webapp {
    /* Убираем отступы для Telegram WebApp */
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.telegram-webapp .header {
    /* Адаптируем header для Telegram */
    position: relative;
    top: 0;
}

/* Стили для авторизации */
.auth-steps {
    text-align: left;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.auth-steps li {
    margin-bottom: 0.5rem;
    color: #666;
}

.bot-link {
    color: #0088cc;
    text-decoration: none;
    font-weight: bold;
}

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

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.auth-tab {
    display: none;
}

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

.auth-actions-bottom {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-outline {
    background: none;
    border: 1px solid #007bff;
    color: #007bff;
    text-decoration: none;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}
