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

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #4a4a4a;
    --accent-color: #2ca02c;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --success-color: #2ca02c;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --nav-height: 80px;
}

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

#app {
    position: relative;
}

/* Экраны */
.screen {
    display: none;
    padding: 20px;
    
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.screen.active.no-animation {
    animation: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-family: inherit;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

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

.nav-item:active {
    transform: scale(0.95);
}

/* Заголовки */
.header {
    margin-bottom: 24px;
}

.header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* Онбординг */
.onboarding-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    text-align: center;
    padding: 20px 0;
}

.logo {
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.onboarding-steps {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 320px;
}

.step {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.step-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.step h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* Главный экран */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.subscription-banner {
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    color: white;
}

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

.banner-icon {
    font-size: 32px;
}

.quick-actions h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.quick-order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.quick-order-btn {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.quick-order-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.drink-icon {
    font-size: 32px;
}

.quick-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
}

.promo-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.promo-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.promo-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Меню */
.menu-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: 12px;
    padding: 4px;
}

.category-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
}

.drinks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drink-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.drink-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.drink-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.drink-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* История заказов */
.orders-filter {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

.orders-list {
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Профиль */
.profile-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #C67C4E 0%, #8B4513 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 56px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(198, 124, 78, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C67C4E, #8B4513, #D4A574);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(198, 124, 78, 0.6);
}

.profile-avatar:hover::before {
    opacity: 1;
}

.profile-avatar:active {
    transform: scale(0.98);
}

#profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

#profile-phone {
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.profile-stat {
    text-align: center;
}

.profile-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.referral-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.referral-stat-card {
    flex: 1;
    background: var(--surface);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.referral-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

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

.referral-info p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.profile-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.subscription-info {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-indicator.active {
    background: var(--success-color);
}

.settings-list {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.setting-item {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    text-align: left;
}

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

.setting-item:hover {
    background: var(--background);
}

.chevron {
    color: var(--text-secondary);
}

/* Настройка напитка */
.customize-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.customize-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.customize-header h2 {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 0;
    line-height: 1;
    text-align: center;
    transform: translateX(-2px, -4px);
}

.back-btn:hover {
    background: var(--background);
}

.customize-form {
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.size-option {
    position: relative;
}

.size-option input {
    position: absolute;
    opacity: 0;
}

.size-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-option input:checked + .size-card {
    border-color: var(--primary-color);
    background: rgba(26, 26, 26, 0.05);
}

.size-icon {
    font-size: 24px;
}

.size-name {
    font-weight: 600;
}

.size-ml {
    font-size: 12px;
    color: var(--text-secondary);
}

.size-price {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
}

.milk-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.milk-option {
    position: relative;
}

.milk-option input {
    position: absolute;
    opacity: 0;
}

.option-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.milk-option input:checked + .option-card {
    border-color: var(--primary-color);
    background: rgba(26, 26, 26, 0.05);
}

.option-price {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
}

.extras-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.extra-item {
    position: relative;
}

.extra-item input {
    position: absolute;
    opacity: 0;
}

.extra-content {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.extra-item input:checked + .extra-content {
    border-color: var(--primary-color);
    background: rgba(26, 26, 26, 0.05);
}

.extra-price {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 600;
}

.text-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.order-summary {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.summary-row.total {
    font-size: 18px;
    margin-bottom: 0;
}

/* Подтверждение заказа */
.confirmation-container {
    text-align: center;
    padding: 40px 20px;
}

.success-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.checkmark {
    width: 80px;
    height: 80px;
    stroke-width: 2;
    stroke: var(--success-color);
    stroke-miterlimit: 10;
    animation: scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

.order-number {
    margin: 16px 0;
}

.order-number span {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.order-number strong {
    font-size: 28px;
    color: var(--primary-color);
}

.order-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    padding: 0 20px;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s ease;
}

.status-step.active .status-dot {
    background: var(--success-color);
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.status-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 8px;
}

.order-message {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-time {
    font-size: 14px;
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 32px;
}

/* Подписка */
.subscription-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}

.subscription-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.plan-card {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

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

.plan-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.plan-price {
    text-align: right;
}

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

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

.plan-features {
    list-style: none;
}

.plan-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Кнопки */
.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
    margin-top: 12px;
}

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

.btn-lg {
    padding: 16px 24px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

/* Загрузка */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 1000;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Тост */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 360px) {
    .header h2 {
        font-size: 24px;
    }
    
    .size-options {
        grid-template-columns: 1fr;
    }
    
    .milk-options {
        grid-template-columns: 1fr;
    }
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a1a;
        --surface: #2a2a2a;
        --text-primary: #f5f5f5;
        --text-secondary: #999999;
        --border-color: #3a3a3a;
    }
    
    .subscription-banner {
        background: linear-gradient(135deg, #2ca02c 0%, #45a545 100%);
    }
    
    .drink-item {
        border: 1px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}


/* Стили для истории заказов */
.order-history-item {
    background: var(--surface);  /* было: white */
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);  /* было: #e0e0e0 */
}

.order-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-history-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-history-id {
    font-weight: 600;
    color: var(--text-primary);
}

.order-history-status {
    font-size: 20px;
}

.order-history-content {
    flex: 1;
    margin: 0 16px;
}

.order-history-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.order-history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-history-price {
    font-weight: 600;
    color: var(--success-color);
    font-size: 18px;
}

/* Модальное окно деталей заказа */
.order-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-header button:hover {
    background: var(--background);
}

.modal-body {
    padding: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    color: #666;
    font-size: 14px;
}

.detail-row span:last-child {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Индикатор WebSocket соединения */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.connection-status.connected {
    background: #E8F5E9;
    color: #2E7D32;
}

.connection-status.disconnected {
    background: #FFEBEE;
    color: #C62828;
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

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

/* Улучшенная анимация загрузки */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Стили для аналитики */
.analytics-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.analytics-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.analytics-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.analytics-subtitle {
    font-size: 12px;
    color: #999;
}

.analytics-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 8px;
    padding: 20px 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #4CAF50, #81C784);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 10px;
    transition: all 0.3s;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

.chart-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Pull-to-refresh индикатор */
.pull-to-refresh {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: top 0.3s;
    z-index: 999;
}

.pull-to-refresh.visible {
    top: 20px;
}

.pull-to-refresh.refreshing {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

/* Улучшенные уведомления */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--surface);
    color: #333;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90%;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    background: #4CAF50;
    color: white;
}

.notification.error {
    background: #F44336;
    color: white;
}

.notification.warning {
    background: #FF9800;
    color: white;
}

.notification-icon {
    font-size: 20px;
}

/* Кнопка повтора заказа */
.repeat-order-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.repeat-order-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Улучшенные badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    background: #FF5722;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    animation: badgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Оптимизация для мобильных устройств */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .analytics-chart {
        height: 150px;
    }
    
    .connection-status {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Фильтры истории заказов */
.orders-filters {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    background: var(--surface);
    border-radius: 12px;
    padding: 4px;
}

.orders-filter-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.orders-filter-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Выбор времени получения */
.pickup-time-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.time-option {
    position: relative;
}

.time-option input {
    position: absolute;
    opacity: 0;
}

.time-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.time-option input:checked + .time-card {
    border-color: var(--primary-color);
    background: rgba(26, 26, 26, 0.05);
}

#custom-time-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
}

#custom-time-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* История заказов */
.order-history-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.order-history-header {
    display: flex;
    flex-direction: column;
    margin-right: 16px;
    align-items: center;
}

.order-history-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
}

.order-history-status {
    font-size: 24px;
    margin-top: 4px;
}

.order-history-content {
    flex: 1;
}

.order-history-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.order-history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.order-history-price {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 18px;
}

/* Мобильная адаптация */
@media (max-width: 360px) {
    .pickup-time-options {
        grid-template-columns: 1fr;
    }
}

/* Оптимизированный онбординг */
.onboarding-container {
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.onboarding-header {
    text-align: center;
    padding: 20px 0;
}

.logo-compact {
    font-size: 48px;
    margin-bottom: 10px;
}

.onboarding-header h1 {
    font-size: 28px;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.tagline {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Основные кнопки действий */
.action-buttons-primary {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-large {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8f8f8;
    border-color: #667eea;
}

.btn-icon {
    font-size: 24px;
    margin-right: 12px;
}

.btn-text {
    flex: 1;
}

.btn-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-subtitle {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

.btn-secondary .btn-subtitle {
    color: #666;
}

/* Компактные преимущества */
.benefits-compact {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid var(--border-color);
}

.benefit-item {
    font-size: 13px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.benefit-item span {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Ссылка на подробности */
.link-button {
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    margin: 20px auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

/* Детали - скрыты по умолчанию */
.details-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Мобильная оптимизация */
@media (max-height: 700px) {
    .onboarding-header {
        padding: 15px 0;
    }
    
    .logo-compact {
        font-size: 40px;
    }
    
    .action-buttons-primary {
        margin: 20px 0;
    }
}

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

.action-buttons-primary {
    animation: slideUp 0.5s ease;
}
/* Модалки подписок */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.subscription-plans-modal,
.subscription-manage-modal {
    background: var(--surface);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
}

.plans-list {
    padding: 20px;
}

.plan-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.plan-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color, #8B4513);
}

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

.plan-header h3 {
    margin: 0;
    font-size: 20px;
}

.plan-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
}

.plan-price span {
    font-size: 14px;
    color: var(--text-secondary);
}

.plan-description {
    color: #666;
    margin: 8px 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.plan-features li {
    padding: 6px 0;
    color: var(--text-primary);
}

.subscription-details {
    padding: 20px;
}

.subscription-details h3 {
    margin-top: 0;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color, #8B4513);
    transition: width 0.3s;
}

.subscription-status-text {
    margin: 12px 0;
    color: #666;
}

.subscription-actions {
    margin-top: 20px;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background: #4caf50;
}

.status-indicator.inactive {
    background: #999;
}

/* Кнопки выбора аватара */
.avatar-option {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    aspect-ratio: 1;
}

.avatar-option:hover {
    transform: scale(1.05);
    border-color: #C67C4E;
}

.avatar-option.selected {
    border-color: #8B4513;
    background: #fff8f0;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.avatar-option svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Переключатели (Toggle Switch) */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #8B4513;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Новые стили онбординга */
.stats-badge {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
    font-weight: 600;
    color: #e65100;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.benefit-card {
    background: #f9f9f9;
    padding: 16px 12px;
    border-radius: 12px;
    text-align: center;
}

.benefit-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.benefit-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.highlight-box {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff8f0 100%);
    border: 2px solid #e8e8ff;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

.highlight-box h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #333;
}

.highlight-box ul {
    padding-left: 20px;
    margin: 0;
}

.highlight-box li {
    margin: 8px 0;
    color: #666;
    font-size: 15px;
}

.btn-text-only {
    background: none;
    border: none;
    color: #8B4513;
    font-size: 15px;
    padding: 16px;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.btn-text-only:hover {
    color: #6d3710;
}

.terms-footer {
    margin-top: auto;
    padding: 20px 0;
}

.terms-footer a {
    text-decoration: none;
}

.terms-footer a:hover {
    text-decoration: underline;
}

/* Спешл-оффер */
#special-offer-container {
    margin: 20px 0;
}

.special-offer-card {
    background: linear-gradient(135deg, var(--accent-color) 0%, #45a545 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(44, 160, 44, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.special-offer-card:hover {
    transform: translateY(-2px);
}

.offer-emoji {
    font-size: 48px;
    flex-shrink: 0;
}

.offer-content h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.offer-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}