* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #000000;
    color: #e8e8e8;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Анимированные боковые полосы */
.ambient-bars {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.bar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent 0%, #c9a03d 10%, #e8b84a 50%, #c9a03d 90%, transparent 100%);
    opacity: 0.4;
    animation: barPulse 3s ease-in-out infinite;
}

.left-bar { left: 10px; }
.right-bar { right: 10px; animation-delay: 1.5s; }

@keyframes barPulse {
    0%, 100% { opacity: 0.2; transform: scaleY(0.85); }
    50% { opacity: 0.6; transform: scaleY(1.15); }
}

.floating-accent {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(201,160,61,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(-15px, -20px) scale(1.1); opacity: 0.5; }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 24px;
    padding: 12px;
}

.header-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.header-dots span {
    width: 6px;
    height: 6px;
    background: #c9a03d;
    border-radius: 50%;
    animation: dotFade 2s ease-in-out infinite;
}

.header-dots span:nth-child(1) { animation-delay: 0s; }
.header-dots span:nth-child(2) { animation-delay: 0.3s; }
.header-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotFade {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

header h1 {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #e8e8e8 0%, #c9a03d 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #4a4a4a;
    font-size: 0.65rem;
    margin-top: 6px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Адрес-бар */
.address-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.current-address {
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-label {
    font-size: 0.75rem;
    color: #6a6a6a;
    letter-spacing: 1px;
}

.address-value {
    font-size: 1rem;
    font-weight: 600;
    color: #c9a03d;
}

.change-address-btn {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 16px;
    color: #888;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.change-address-btn:active {
    background: #1a1a1a;
    transform: scale(0.98);
}

/* Переключатель режимов */
.mode-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: #0a0a0a;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid #1a1a1a;
}

.mode-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #5a5a5a;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: 48px;
}

.mode-btn:active {
    transform: scale(0.98);
}

.mode-btn.active {
    background: #141414;
    color: #c9a03d;
}

/* Контент */
.address-content {
    transition: opacity 0.2s ease;
}

.address-content.fade-out {
    opacity: 0;
}

/* ========== Магазин ========== */
.shop-section {
    background: #050505;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #121212;
}

.shop-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #c9a03d;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1a1a1a;
}

.products-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: #0a0a0a;
    border-radius: 12px;
    border: 1px solid #151515;
    transition: all 0.15s ease;
    cursor: pointer;
    min-height: 56px;
}

.checklist-item:active {
    background: #151515;
    transform: scale(0.99);
}

.checklist-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #1a1a1a;
    border-radius: 50%;
    border: 1px solid #3a3a3a;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

.checklist-item input[type="checkbox"]:checked {
    background: #c9a03d;
    border-color: #c9a03d;
}

.checklist-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-size: 14px;
    font-weight: bold;
}

.checklist-item label {
    flex: 1;
    font-size: 1rem;
    color: #c0c0c0;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.4;
}

.checklist-item input[type="checkbox"]:checked + label {
    color: #c9a03d;
}

.custom-item-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #151515;
}

.custom-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.custom-input {
    flex: 1;
    padding: 14px;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 12px;
    color: #e8e8e8;
    font-size: 1rem;
    outline: none;
    min-height: 48px;
}

.custom-input:focus {
    border-color: #c9a03d;
}

.custom-add-btn {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid #222;
    border-radius: 12px;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 48px;
}

.custom-add-btn:active {
    background: #1a1a1a;
    transform: scale(0.98);
}

.custom-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.custom-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #b0b0b0;
    transition: all 0.15s ease;
    cursor: pointer;
}

.custom-tag:active {
    background: #151515;
}

.custom-tag button {
    background: none;
    border: none;
    color: #5a5a5a;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 6px;
}

.custom-tag button:active {
    color: #e06565;
}

.shop-order-preview {
    background: #0a0a0a;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid #1a1a1a;
}

.preview-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #c9a03d;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.preview-content {
    font-size: 0.85rem;
    line-height: 1.8;
    color: #a0a0a0;
    max-height: 200px;
    overflow-y: auto;
}

.preview-empty {
    color: #3a3a3a;
    text-align: center;
    padding: 16px;
}

.preview-item {
    padding: 4px 0 4px 10px;
    border-left: 2px solid #2a2a2a;
    margin-bottom: 4px;
}

/* Кнопки с градиентом */
.gradient-btn {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #c9a03d;
    color: #c9a03d;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 1px;
    text-align: center;
    min-height: 48px;
}

.gradient-btn:active {
    background: linear-gradient(135deg, #c9a03d 0%, #b89030 100%);
    color: #000000;
    transform: scale(0.98);
}

.shop-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #151515;
    margin-bottom: 16px;
    flex-direction: column;
}

.preview-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-direction: column;
}

/* ========== Заявки ========== */
.orders-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.input-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0a0a0a;
    padding: 8px 12px;
    border-radius: 30px;
    border: 1px solid #2a2a2a;
}

.input-mode-toggle span {
    font-size: 0.7rem;
    color: #888;
}

.mode-switch-input {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2a2a;
    transition: 0.2s;
    border-radius: 26px;
}

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

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

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

.category-card {
    margin-bottom: 12px;
    background: #050505;
    border-radius: 12px;
    transition: all 0.15s ease;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    user-select: none;
    border-radius: 12px;
    min-height: 52px;
}

.category-header:active {
    background: #0f0f0f;
}

.category-header h2 {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #888;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    color: #4a4a4a;
}

.category-card.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category-card.collapsed .category-content {
    display: none;
}

.category-content {
    padding: 8px 12px 16px 12px;
    border-top: 1px solid #111;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: #080808;
    border-radius: 12px;
    border: 1px solid #111;
}

.product-item:active {
    background: #0d0d0d;
}

.product-name {
    font-size: 1rem;
    font-weight: 400;
    color: #c0c0c0;
    flex: 1;
    min-width: 100px;
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Режим поля ввода */
.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 4px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #c9a03d;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.1s ease;
}

.qty-btn:active {
    background: #1a1a1a;
    transform: scale(0.95);
}

.quantity-input-simple {
    width: 70px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: #e8e8e8;
    font-size: 18px;
    text-align: center;
    outline: none;
}

.clear-qty-btn {
    width: 40px;
    height: 44px;
    background: transparent;
    border: none;
    color: #5a5a5a;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 8px;
}

.clear-qty-btn:active {
    color: #e06565;
}

/* Режим выпадающего списка */
.quantity-select {
    padding: 10px 12px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #e8e8e8;
    font-size: 1rem;
    cursor: pointer;
    min-height: 48px;
}

.add-btn-simple {
    background: transparent;
    border: 1px solid #333;
    padding: 10px 18px;
    border-radius: 10px;
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 48px;
}

.add-btn-simple:active {
    border-color: #c9a03d;
    color: #c9a03d;
    background: rgba(201,160,61,0.1);
    transform: scale(0.98);
}

.order-section {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #141414;
}

.order-section h2 {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: #5a5a5a;
    margin-bottom: 16px;
}

.order-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-direction: column;
}

.order-list {
    background: #050505;
    padding: 16px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    border: 1px solid #111;
}

.empty-message {
    color: #2a2a2a;
    text-align: center;
    padding: 16px;
}

.category-group {
    margin-bottom: 16px;
}

.category-title {
    color: #c9a03d;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.order-item-line {
    padding: 4px 0 4px 14px;
    color: #b0b0b0;
    border-left: 1px solid #1a1a1a;
    margin-left: 6px;
}

.total-sum {
    margin-top: 16px;
    text-align: right;
    font-size: 0.75rem;
    color: #5a5a5a;
    padding-top: 12px;
    border-top: 1px solid #111;
}

/* Модальное окно */
.address-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.address-modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    background: #0a0a0a;
    border: 1px solid #c9a03d;
    border-radius: 24px;
    padding: 32px 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    z-index: 1001;
}

.modal-header h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #e8e8e8, #c9a03d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-header p {
    color: #6a6a6a;
    font-size: 0.8rem;
    margin-bottom: 24px;
}

.modal-addresses {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-address-btn {
    padding: 16px;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 56px;
}

.modal-address-btn:active {
    background: #c9a03d;
    color: #000;
    border-color: #c9a03d;
    transform: scale(0.98);
}

/* Адаптив для планшетов и выше */
@media (min-width: 600px) {
    .container {
        padding: 24px;
    }
    
    .shop-actions, .preview-actions, .order-actions {
        flex-direction: row;
    }
    
    .bar {
        width: 4px;
    }
    
    .left-bar { left: 20px; }
    .right-bar { right: 20px; }
    
    .floating-accent {
        width: 150px;
        height: 150px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 900px;
    }
}