:root {
    --primary: #3CB371;
    --primary-dark: #228B22;
    --bg: #E8EDF2;
    --card: #ffffff;
    --text: #2c3e50;
    --muted: #7f8c8d;
    --accent: #ecf0f1;
    --ring: #bdc3c7;
    --shadow: 0 3px 12px rgba(0,0,0,.08);
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1e23;
        --card: #2A303C;
        --text: #ecf0f1;
        --muted: #a0aec0;
        --accent: #3d4451;
        --ring: #4a5568;
        --shadow: 0 4px 16px rgba(0,0,0,.4);
    }

    #client-name {
        background: var(--card);
        border-color: var(--accent);
        color: var(--text);
    }

    #order-comment {
        background: var(--card);
        border-color: var(--accent);
        color: var(--text);
    }

    #delivery-date {
        background: var(--card);
        border-color: var(--accent);
        color: var(--text);
    }

    .hcard {
        border-color: rgba(255,255,255,0.05);
    }
}

body {
    margin: 0;
    background: var(--bg);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    color: var(--text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* Убираем подсветку при нажатии на всех интерактивных элементах */
button, a, input, textarea, select {
    -webkit-tap-highlight-color: transparent;
}

/* Восстанавливаем нормальное поведение на десктопе */
@media (min-width: 769px) {
    body {
        position: static;
        height: auto;
        overflow-y: visible;
    }
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: white;
    font-weight: 600;
    letter-spacing: -0.5px;
}


.list {
    max-width: 820px;
    margin: 24px auto;
    padding: 0 16px;
    display: grid;
    gap: 16px;
    padding-bottom: 80px;
}

.hcard {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.hcard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-color: var(--primary);
}

.hcard__img {
    width: 120px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    background: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.hcard__body {
    flex: 1;
    min-width: 0;
}

.hcard__title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--text);
}

.hcard__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.hcard__price {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

.qty {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--accent);
    border-radius: 50px;
    padding: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.qty__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qty__btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.qty__btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.qty__value {
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    padding: 0 4px;
}

#submit-order {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--muted);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 200px;
    /* Обеспечиваем правильное позиционирование в fixed body */
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

#submit-order.has-items {
    background: var(--primary);
}

#submit-order.loading {
    background: var(--muted);
    cursor: wait;
    opacity: 0.8;
}

#submit-order:not(:disabled):not(.loading):hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

#submit-order:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.toast {
    position: fixed;
    background: var(--card);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 10000;
    transition: all 0.3s ease;
    border: 1px solid var(--accent);
    /* По умолчанию скрыт */
    opacity: 0;
    transform: translateY(-100px);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* Десктоп позиционирование */
.toast.desktop {
    top: 80px;
    left: 50%;
    max-width: 90vw;
    width: auto;
    min-width: 300px;
    transform: translateX(-50%) translateY(-100px);
}

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

.toast.desktop.modal-open {
    top: 20px;
    z-index: 10001;
}

.toast.desktop.modal-open.show {
    transform: translateX(-50%) translateY(0);
}

/* Мобильное позиционирование */
.toast.mobile {
    top: 20px;
    left: 15px;
    right: 15px;
    transform: translateY(-100px);
    max-width: calc(100vw - 30px);
    width: auto;
}

.toast.mobile.show {
    transform: translateY(0);
}

.toast.mobile.modal-open {
    top: 20px;
    z-index: 10001;
}

.toast.success {
    border-left: 4px solid var(--primary);
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}


.empty-catalog {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-catalog h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-catalog p {
    color: var(--muted);
}

/* Шапка сайта */
.header-content {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.header-contacts {
    display: flex;
    gap: 12px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.header-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.gallery-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-tap-highlight-color: transparent;
}

.gallery-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
}

.btn-text {
    display: none;
}

.btn-text-full {
    display: inline;
}

.whatsapp-btn {
    background: #25D366;
    -webkit-tap-highlight-color: transparent;
}

.whatsapp-btn:hover {
    background: #22c35e;
}

@keyframes loading {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

#submit-order.loading {
    animation: loading 1s infinite;
}

@media (max-width: 480px) {
    #submit-order {
        width: calc(100% - 32px);
        bottom: 16px;
        font-size: 0.95rem;
        padding: 0.875rem;
    }
}

@media (max-width: 600px) {
    .header-contacts {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .header-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 520px) {
    .btn-text {
        display: inline;
    }
    
    .btn-text-full {
        display: none;
    }
}

@media (max-width: 420px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .header-contacts {
        gap: 8px;
    }
    
    .header-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
        gap: 4px;
    }
    
    .header-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .hcard {
        padding: 12px;
        gap: 14px;
    }
    
    .hcard__img {
        width: 90px;
    }
    
    .hcard__title {
        font-size: 1.1rem;
    }
    
    .qty__btn {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 768px) {
    .qty {
        padding: 6px;
        gap: 8px;
    }

    .qty__btn {
        width: 40px;
        height: 40px;
    }
}

/* Модальное окно оформления заказа */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    width: 95%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--accent);
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 1;
}

.modal-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 1.8rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    transform: scale(1.1);
}

.order-summary {
    padding: 1.5rem;
    border-bottom: 1px solid var(--accent);
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.03), rgba(60, 179, 113, 0.01));
    position: relative;
}

.order-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius) var(--radius) 0 0;
}

.order-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-summary h3::before {
    content: '🛒';
    font-size: 1.2rem;
}

.order-items-list {
    margin-bottom: 1.25rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    gap: 1rem;
    transition: background-color 0.2s ease;
}

.order-item:hover {
    background: rgba(60, 179, 113, 0.02);
}

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

.order-item-name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
    flex: 1;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.order-item-name::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.order-item-details {
    text-align: right;
    color: var(--muted);
    font-size: 0.85rem;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-item-quantity {
    font-size: 0.8rem;
    opacity: 0.8;
}

.order-item-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    margin-top: 0.125rem;
}

.order-total {
    background: var(--card);
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(60, 179, 113, 0.15);
    margin-top: 1rem;
    position: relative;
}

.order-total::before {
    content: '💰';
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.order-total-price {
    color: var(--primary);
    font-size: 1.2rem;
}

.order-cost-breakdown {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem;
    margin-top: 1rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.cost-label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.cost-value {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.order-form {
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-section h3 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--accent);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--card);
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(60, 179, 113, 0.15);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* Стили для чекбокса */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 2px solid var(--ring);
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.checkbox-label:hover {
    border-color: var(--primary);
    background: rgba(60, 179, 113, 0.02);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-text {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    user-select: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    color: var(--text);
}

.form-group-modern .checkbox-label {
    margin-bottom: 0;
}

/* Стили для поля customer-name с индикацией привязки устройства */
#customer-name {
    position: relative;
}

#customer-name.device-linked {
    background: rgba(60, 179, 113, 0.03);
    border-color: rgba(60, 179, 113, 0.2);
    box-shadow: 0 0 0 1px rgba(60, 179, 113, 0.08);
    transition: all 0.3s ease;
}

#customer-name.device-linked:focus {
    background: rgba(60, 179, 113, 0.05);
    border-color: rgba(60, 179, 113, 0.3);
    box-shadow: 0 0 0 2px rgba(60, 179, 113, 0.15);
}

/* Статус подтверждения клиента */
.client-verification-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    padding: 0.375rem 0.5rem;
    background: rgba(60, 179, 113, 0.08);
    border: 1px solid rgba(60, 179, 113, 0.2);
    border-radius: calc(var(--radius) * 0.75);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.verification-icon {
    font-size: 0.9rem;
    color: var(--primary);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.verification-text {
    font-weight: 500;
}

@keyframes verificationFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.9;
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--accent);
    background: rgba(0, 0, 0, 0.01);
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 120px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(60, 179, 113, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(60, 179, 113, 0.3);
}

.btn-secondary {
    background: var(--accent);
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Анимация загрузки для кнопки подтверждения заказа */
.btn-loading {
    animation: loading 1s infinite;
    cursor: wait;
    opacity: 0.8;
}

/* Анимация нажатия кнопки */
.btn-confirm-click {
    animation: button-confirm-click 0.3s ease-out;
}

@keyframes button-confirm-click {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}


/* Анимация успешной отправки */
.btn-success {
    background: #16a34a !important;
    animation: success-pulse 1.5s ease-in-out;
}

@keyframes success-pulse {
    0% {
        background: #16a34a;
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    }
    50% {
        background: #15803d;
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    }
    100% {
        background: #16a34a;
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    }
}

/* Секции в ряд на больших экранах */
@media (min-width: 768px) {
    .order-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .order-form > .form-section:nth-child(1) {
        grid-column: 1;
    }

    .order-form > .form-section:nth-child(2) {
        grid-column: 2;
    }

    .order-form > .form-section:nth-child(3) {
        grid-column: 1 / -1;
        margin-top: 0.5rem;
    }
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
    /* Увеличиваем размер поля имени на мобильных для лучшего взаимодействия */
    #customer-name {
        font-size: 1rem;
        padding: 0.75rem;
        min-height: 48px;
        border-width: 2px;
    }

    /* Улучшаем фокус на мобильных устройствах */
    #customer-name:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.2);
        outline: none;
    }

    /* Предотвращаем зум при фокусе на iOS */
    #customer-name,
    #customer-phone,
    #delivery-address {
        font-size: 16px !important;
    }

    /* Темная тема для статусов заказов */
    .status-badge.status-pending {
        background: var(--accent);
        color: #60a5fa;
        border-color: #3b82f6;
    }

    .status-badge.status-ready {
        background: var(--accent);
        color: #60a5fa;
        border-color: #3b82f6;
    }

    .status-badge.status-delivered {
        background: var(--accent);
        color: #34d399;
        border-color: #10b981;
    }

    .status-badge.status-cancelled {
        background: var(--accent);
        color: #f87171;
        border-color: #dc2626;
    }

    /* Темная тема для статусов оплаты */
    .payment-badge.paid {
        background: var(--accent);
        color: #4ade80;
        border-color: #22c55e;
    }

    .payment-badge.unpaid {
        background: var(--accent);
        color: #fb923c;
        border-color: #ea580c;
    }

    /* Общие стили для статусов в темной теме */
    .status-badge, .payment-badge {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .status-badge:hover, .payment-badge:hover {
        background: var(--card);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }

    /* Темная тема для фильтров */
    .filter-input, .filter-select {
        background: var(--card);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

    .filter-input:focus, .filter-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.2);
    }

    .filter-select option {
        background: var(--card);
        color: var(--text);
    }

    /* Кастомная стрелка для селекта в темной теме */
    .filter-select {
        position: relative;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

    .filter-select::after {
        content: '▼';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: var(--muted);
        font-size: 12px;
        z-index: 1;
    }

    /* Темная тема для информации о клиенте */
    .client-info-display {
        background: var(--accent);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--muted);
    }

    .client-name {
        color: var(--text);
    }
}

/* Адаптивность модального окна */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .order-summary,
    .order-form {
        padding: 1rem;
        box-sizing: border-box;
    }

    .form-group {
        box-sizing: border-box;
    }

    .form-actions {
        flex-direction: column;
        box-sizing: border-box;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 1rem 1.75rem;
        font-size: 1rem;
        min-height: 48px;
        box-sizing: border-box;
    }
}

/* Стили для модального окна товара */
.product-modal-content {
    max-width: 900px;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-main {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-main:hover img {
    transform: scale(1.05);
}

/* Стили для зума изображений на мобильных устройствах */
.zoom-reset-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
}

.zoom-reset-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.zoom-reset-btn:active {
    transform: scale(0.95);
}

/* Стили для увеличенного изображения */
.gallery-main img {
    transition: transform 0.3s ease;
    touch-action: none; /* Отключаем стандартные жесты браузера */
    /* Оптимизация производительности для плавного зума */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.gallery-main img.zoomed {
    cursor: grab;
    /* Добавляем небольшую плавность при панорамировании */
    transition: transform 0.1s ease-out;
}

.gallery-main img.zoomed.panning {
    /* Убираем transition при активном перетаскивании для мгновенной реакции */
    transition: none;
}

.gallery-main img.zoomed:active {
    cursor: grabbing;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    background: var(--accent);
    -webkit-tap-highlight-color: transparent;
}

.gallery-thumbnail:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(60, 179, 113, 0.2);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-info h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.product-description {
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0.5rem 0;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-description:empty::before {
    content: "Описание товара отсутствует";
    color: var(--muted);
    font-style: italic;
}

/* Стили для полосы прокрутки */
.product-description::-webkit-scrollbar {
    width: 6px;
}

.product-description::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.product-description::-webkit-scrollbar-thumb {
    background: rgba(60, 179, 113, 0.3);
    border-radius: 3px;
}

.product-description::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 179, 113, 0.5);
}

.product-quantity {
    margin-top: auto;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--accent);
    background: rgba(0, 0, 0, 0.01);
}

/* Стили для кнопок количества в модальном окне */
.product-quantity .qty__btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
}

.product-quantity .qty__btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.product-quantity .qty__btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.product-quantity .qty__btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.product-quantity .qty__value {
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    padding: 0 4px;
}

/* Адаптивность для модального окна товара */
@media (max-width: 768px) {
    .product-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .product-gallery {
        order: 1;
    }

    .product-info {
        order: 2;
    }

    .product-info h3 {
        font-size: 1.3rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .gallery-thumbnails {
        gap: 0.375rem;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }

    .product-actions {
        padding: 1rem;
        flex-direction: column;
    }

    .product-actions .btn-primary,
    .product-actions .btn-secondary,
    .product-actions a.btn-primary {
        width: 100%;
        padding: 1rem 1.75rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .product-actions a.btn-primary {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .product-details {
        padding: 0.75rem;
    }

    .gallery-main {
        aspect-ratio: 1;
    }

    .product-info {
        gap: 0.75rem;
    }

    .product-info h3 {
        font-size: 1.2rem;
    }

    .product-description {
        font-size: 0.9rem;
        min-height: 40px;
        max-height: 150px;
        padding: 0.375rem;
    }
}

/* Темная тема для модального окна товара */
@media (prefers-color-scheme: dark) {
    .gallery-main {
        background: var(--accent);
    }

    .gallery-thumbnail {
        background: var(--accent);
    }

    .product-description:empty::before {
        color: var(--muted);
    }

    .product-description {
        background: rgba(255, 255, 255, 0.02);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .product-description::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .product-description::-webkit-scrollbar-thumb {
        background: rgba(60, 179, 113, 0.4);
    }

    .product-description::-webkit-scrollbar-thumb:hover {
        background: rgba(60, 179, 113, 0.6);
    }

    /* Стили скроллбара для истории заказов в темной теме */
    .orders-history-content::-webkit-scrollbar {
        width: 6px;
    }

    .orders-history-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
    }

    .orders-history-content::-webkit-scrollbar-thumb {
        background: rgba(60, 179, 113, 0.4);
        border-radius: 3px;
    }

    .orders-history-content::-webkit-scrollbar-thumb:hover {
        background: rgba(60, 179, 113, 0.6);
    }
}

/* Предотвращение автоматического фокуса на мобильных устройствах */
.prevent-autofocus {
    pointer-events: none;
    user-select: none;
}

.prevent-autofocus:focus {
    outline: none;
}

/* Специальные правила для мобильных устройств */
@media (max-width: 768px) {
    #customer-name {
        /* Предотвращаем автоматический фокус на мобильных */
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Предотвращаем автоматическое поднятие клавиатуры */
    #customer-name:focus {
        /* Убираем outline на мобильных для лучшего UX */
        outline: none;
    }
}

/* Стили для кнопок действий */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
    flex-wrap: wrap;
}

.action-buttons button {
    -webkit-tap-highlight-color: transparent;
}

/* Модальное окно истории заказов */
.orders-history-modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
    display: flex;
    flex-direction: column;
}

.modal-header-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.modal-header-content h2 {
    flex: 1;
    margin: 0;
}

.client-info-display {
    flex-shrink: 0;
}

.client-info-display {
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--accent);
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: none; /* По умолчанию скрываем */
    align-items: center;
    gap: 0.5rem;
}

.client-info-display.show {
    display: flex !important; /* Принудительно показываем */
}

.client-name {
    font-weight: 500;
    color: var(--text);
}

.orders-history-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.orders-history-loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.loading-spinner {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.orders-history-empty {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.orders-history-empty h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.25rem;
}

.orders-history-error {
    text-align: center;
    padding: 3rem;
    color: #e74c3c;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Стили для состояния "устройство не привязано к клиенту" */
.orders-history-device-not-linked {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text);
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--accent);
}

.device-not-linked-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0.7;
}

.orders-history-device-not-linked h3 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.orders-history-device-not-linked p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.device-not-linked-info {
    background: var(--accent);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1.5rem 0 !important;
    border-left: 4px solid #f39c12;
    text-align: left;
}

.device-not-linked-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.device-whatsapp-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 280px;
    margin: 0 auto;
    background: #25d366;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.device-whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.device-whatsapp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.device-whatsapp-icon {
    font-size: 1.2rem;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .orders-history-device-not-linked {
        padding: 2rem 1.5rem;
    }

    .device-not-linked-actions {
        gap: 0.5rem;
    }

    .device-whatsapp-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-width: 250px;
        gap: 0.5rem;
    }

    .device-not-linked-info {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    .device-whatsapp-icon {
        font-size: 1.1rem;
    }
}

.orders-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.orders-history-list .order-summary {
    padding: 0;
    background: none;
    border-bottom: none;
}

.orders-history-list .order-summary::before {
    content: "";
    height: 0;
}

.orders-history-list .order-items-list {
    border: 1px solid rgb(255 255 255 / 6%);
}

.orders-history-list .order-item {
    border-bottom: 1px solid rgb(255 255 255 / 6%);
}

.orders-history-list .order-item:last-child {
    border-bottom: none;
}
/* Элемент заказа в истории */
.order-history-item {
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.order-history-item.collapsed .order-details {
    display: none;
}

.order-history-item .order-header {
    position: relative;
    cursor: pointer;
}

.order-history-item .order-header::after {
    content: '▶';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.8rem;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.order-history-item .order-header:hover::after {
    opacity: 1;
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.order-history-item:hover .order-header {
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.15), rgba(60, 179, 113, 0.08));
    border-bottom-color: rgba(60, 179, 113, 0.2);
}

.order-history-item.expanded .order-header::after {
    transform: translateY(-50%) rotate(90deg) scale(1.1);
    color: var(--primary);
}

.order-history-item.collapsed .order-header::after {
    transform: translateY(-50%);
}

.order-history-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: var(--primary);
}



.order-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.06), rgba(60, 179, 113, 0.02));
    border: 1px solid rgba(60, 179, 113, 0.08);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.order-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.order-history-item:hover .order-header::before {
    opacity: 1;
}

.order-main-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.order-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-title-section .order-id {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0;
}

.order-status-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}

.order-status-section .status-badge,
.order-status-section .payment-badge {
    cursor: default;
    pointer-events: none;
}

.order-summary-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1.5em;
}

.total-amount {
    text-align: right;
    min-width: 120px;
}

.total-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    line-height: 1.2;
}

.order-summary-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 120px;
}

.delivery-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.delivery-label {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 500;
}

.delivery-date {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
}

.delivery-fee {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.delivery-date-mobile {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
    display: none;
}

/* Мобильная версия delivery-date-mobile */
@media (max-width: 768px) {
    .delivery-date-mobile {
        display: block;
    }
}

@media (min-width: 769px) {
    .delivery-date-mobile {
        display: none;
    }
}

.total-amount {
    margin-top: 0.125rem;
}

.total-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.total-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    margin-right: 0.25rem;
}

.order-history-item:hover .order-header {
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.12), rgba(60, 179, 113, 0.06));
}

.order-title-section .order-id {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.order-statuses {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-badge, .payment-badge {
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    min-height: 18px;
    min-width: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: default;
    background: var(--accent);
    color: var(--muted);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.status-badge:hover, .payment-badge:hover {
    transform: scale(1.02);
    background: var(--card);
    border-color: var(--primary);
    color: var(--primary);
}

.delivery-date-mobile {
    color: var(--muted);
    font-size: 0.875rem;
}


/* Статусы заказов */
.status-badge.status-pending {
    background: var(--accent);
    color: #1d4ed8;
    border-color: #3b82f6;
}

.status-badge.status-pending:before {
    content: "⏳";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

.status-badge.status-ready {
    background: var(--accent);
    color: #1d4ed8;
    border-color: #3b82f6;
}

.status-badge.status-ready:before {
    content: "⏳";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

.status-badge.status-delivered {
    background: var(--accent);
    color: #15803d;
    border-color: #16a34a;
}

.status-badge.status-delivered:before {
    content: "🚚";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

.status-badge.status-cancelled {
    background: var(--accent);
    color: #dc2626;
    border-color: #ef4444;
}

.status-badge.status-cancelled:before {
    content: "❌";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

/* Статусы оплаты */
.payment-badge.paid {
    background: var(--accent);
    color: #15803d;
    border-color: #16a34a;
}

.payment-badge.paid:before {
    content: "💰";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

.payment-badge.unpaid {
    background: var(--accent);
    color: #ea580c;
    border-color: #f97316;
}

.payment-badge.unpaid:before {
    content: "⚠️";
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

.order-details {
    padding: 0.75rem;
}

.order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--accent);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.8rem;
}

.meta-value {
    color: var(--muted);
    font-size: 0.8rem;
    word-break: break-word;
}

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

.products-label {
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.products-label::before {
    content: "🛒";
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.products-list {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(71, 85, 105, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Карточка товара */
.product-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(51, 65, 85, 0.8));
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(10px);
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.9));
}

.product-card:last-child {
    margin-bottom: 0;
}

/* Основная строка товара */
.product-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem;
}

.product-info-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.product-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.product-details {
    flex: 1;
    min-width: 0;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.product-quantity {
    margin-top: auto;
}

.product-unit-price {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 500;
}

.product-total-section {
    flex-shrink: 0;
    text-align: right;
}

.product-total-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b82f6;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    white-space: nowrap;
}

/* Сводка товаров */
.products-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    flex: 1;
    padding: 0.375rem;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.summary-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.summary-value.total-amount {
    color: #3b82f6;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.no-products {
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.order-comment {
    background: var(--accent);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.comment-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.125rem;
    font-size: 0.8rem;
}

.comment-text {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

.orders-history-actions {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid var(--accent);
    background: var(--card);
    border-radius: 0 0 16px 16px;
}

.orders-history-actions button {
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    min-height: 44px;
}

.orders-history-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Панель фильтров */
.orders-history-filters {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--accent);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filters-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

    .filters-toggle {
        background: none;
        border: 1px solid var(--accent);
        color: var(--muted);
        padding: 0.5rem 1rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.875rem;
        transition: all 0.2s ease;
    }

    .filters-toggle:hover {
        background: var(--accent);
        color: var(--text);
    }

    /* Темная тема для кнопок фильтров */
    .filters-toggle {
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--muted);
    }

    .filters-toggle:hover {
        background: var(--accent);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }

    /* Темная тема для всех кнопок */
    .btn-primary, .btn-secondary {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

    .btn-secondary {
        background: var(--accent);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }

.filters-content {
    padding: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
}

.filter-input, .filter-select {
    padding: 0.75rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--background);
    color: var(--text);
    transition: all 0.2s ease;
}

/* Кастомная стрелка для селекта */
.filter-select {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem; /* Место для стрелки */
}

.filter-select::after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
    font-size: 12px;
    z-index: 1;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-show-btn {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .filters-show-btn button {
        padding: 0.75rem 1.5rem;
        border: 1px solid var(--accent);
        background: var(--background);
        color: var(--muted);
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.875rem;
        transition: all 0.2s ease;
    }

    .filters-show-btn button:hover {
        background: var(--accent);
        color: var(--text);
    }

    /* Темная тема для кнопки показа фильтров на мобильных */
    .filters-show-btn button {
        background: var(--card);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--muted);
    }

    .filters-show-btn button:hover {
        background: var(--accent);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--text);
    }

.filters-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--accent);
    flex-wrap: wrap;
}

.results-count {
    color: var(--muted);
    font-size: 0.875rem;
}

.results-count strong {
    color: var(--primary);
    font-weight: 600;
}

/* Адаптивность фильтров */
@media (max-width: 768px) {
    .filters-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .filters-actions button {
        width: 100%;
    }

}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .orders-history-modal-content {
        width: 98%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .orders-history-content {
        padding: 1rem;
        /* Убираем max-height для мобильных, используем flex: 1 */
    }

    .order-history-item {
        margin-bottom: 0.75rem;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }

    .order-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1.25rem;
        -webkit-tap-highlight-color: transparent;
        background: linear-gradient(135deg, rgba(60, 179, 113, 0.08), rgba(60, 179, 113, 0.04));
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        position: relative;
        overflow: hidden;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        min-height: 120px;
        touch-action: manipulation;
    }

    .order-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), var(--primary-light));
        opacity: 0.6;
    }

    .order-main-info {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .order-title-section {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .order-title-section .order-id {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 0;
    }

    .delivery-date-mobile {
        display: block;
        font-size: 0.95rem;
        color: var(--primary);
        font-weight: 600;
        background: rgba(60, 179, 113, 0.12);
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        text-align: center;
        white-space: nowrap;
        border: 1px solid rgba(60, 179, 113, 0.2);
        pointer-events: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .order-status-section {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        pointer-events: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .order-status-section .status-badge,
    .order-status-section .payment-badge {
        cursor: default;
        pointer-events: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .order-summary-section {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 1rem;
        background: var(--card);
        border-radius: 12px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .total-amount {
        text-align: center;
        min-width: auto;
    }

    .total-price {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
        display: block;
        line-height: 1.2;
        pointer-events: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .order-history-item .order-header::after {
        right: 0.75rem;
        font-size: 0.8rem;
    }

    .order-info {
        margin-bottom: 0.25rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .order-info .order-id {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .delivery-date-mobile {
        display: block;
        font-size: 0.9rem;
        color: var(--primary);
        font-weight: 600;
        background: rgba(60, 179, 113, 0.1);
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
        text-align: center;
        white-space: nowrap;
    }

    .order-statuses {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .order-summary-compact {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: var(--card);
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .total-amount {
        text-align: right;
    }

    .total-label {
        display: block;
        font-size: 0.8rem;
        color: var(--muted);
        font-weight: 500;
        margin-bottom: 0.125rem;
    }

    .total-price {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary);
        display: block;
    }

    .status-badge, .payment-badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
        min-height: 18px;
        background: var(--accent);
        color: var(--muted);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* Кастомная стрелка для селекта на мобильных */
    .filter-select {
        padding-right: 2rem;
    }

    .filter-select::after {
        right: 8px;
        font-size: 11px;
    }

    .status-badge:hover, .payment-badge:hover {
        background: var(--card);
        border-color: var(--primary);
        color: var(--primary);
        transform: scale(1.02);
    }

    /* Мобильные стили для статусов */
    .status-badge.status-pending {
        color: #1d4ed8;
        border-color: #3b82f6;
    }

    .status-badge.status-ready {
        color: #1d4ed8;
        border-color: #3b82f6;
    }

    .status-badge.status-delivered {
        color: #15803d;
        border-color: #16a34a;
    }

    .status-badge.status-cancelled {
        color: #dc2626;
        border-color: #ef4444;
    }

    .payment-badge.paid {
        color: #15803d;
        border-color: #16a34a;
    }

    .payment-badge.unpaid {
        color: #ea580c;
        border-color: #f97316;
    }

    .status-badge:before, .payment-badge:before {
        font-size: 0.7rem;
        margin-right: 0.2rem;
    }

    /* Темная тема для фильтров на мобильных */
    .filter-input, .filter-select {
        background: var(--card);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--text);
    }

    .filter-select option {
        background: var(--card);
        color: var(--text);
    }

    /* Кастомная стрелка для селекта на мобильных в темной теме */
    .filter-select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

    .filter-select::after {
        content: '▼';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: var(--muted);
        font-size: 11px;
        z-index: 1;
    }

    /* Темная тема для статусов на мобильных */
    .status-badge.status-pending {
        background: var(--accent);
        color: #60a5fa;
    }

    .status-badge.status-ready {
        background: var(--accent);
        color: #60a5fa;
    }

    .status-badge.status-delivered {
        background: var(--accent);
        color: #34d399;
    }

    .status-badge.status-cancelled {
        background: var(--accent);
        color: #f87171;
    }

    .payment-badge.paid {
        background: var(--accent);
        color: #4ade80;
    }

    .payment-badge.unpaid {
        background: var(--accent);
        color: #fb923c;
    }

    .delivery-date-mobile {
        font-size: 1rem;
    }

    .order-status {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .status-badge, .payment-badge {
        padding: 0.375rem 0.875rem;
        font-size: 0.8rem;
        min-height: 32px;
        min-width: 100px;
        display: flex;
        align-items: center;
    }

    .order-details {
        padding: 1rem;
    }

    .order-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .meta-item {
        gap: 0.5rem;
    }

    .meta-label {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .meta-value {
        font-size: 0.85rem;
        line-height: 1.4;
    }

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

    .products-label {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .products-list {
        padding: 0.75rem;
        border-radius: 10px;
    }

    /* Мобильные стили для карточек товаров */
    .product-card {
        margin-bottom: 0.5rem;
    }

    .product-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .product-info-section {
        width: 100%;
        gap: 0.5rem;
    }

    .product-icon {
        font-size: 1.25rem;
    }

    .product-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0.375rem;
    }

    .product-meta {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .product-quantity {
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
    }

    .product-unit-price {
        font-size: 0.75rem;
    }

    .product-total-section {
        width: 100%;
        text-align: left;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(71, 85, 105, 0.3);
    }

    .product-total-price {
        font-size: 1rem;
    }

    .products-summary {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .summary-item {
        text-align: center;
        padding: 0.5rem;
    }

    .summary-label {
        font-size: 0.7rem;
    }

    .summary-value {
        font-size: 0.9rem;
    }

    .summary-value.total-amount {
        font-size: 1rem;
    }

    .order-comment {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .comment-label {
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .comment-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .order-total {
        background: var(--card);
        padding: 1rem;
        border-radius: var(--radius);
        border: 1px solid var(--primary);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(60, 179, 113, 0.15);
        margin-top: 0.75rem;
        position: relative;
    }
    
    .order-total::before {
        content: '💰';
        font-size: 1.2rem;
        margin-right: 0.5rem;
    }
    
    .order-total-price {
        color: var(--primary);
        font-size: 1.2rem;
    }

    .order-cost-breakdown {
        background: var(--card);
        border-radius: var(--radius);
        border: 1px solid rgba(0, 0, 0, 0.06);
        padding: 0.75rem;
        margin-top: 0.75rem;
    }

    .cost-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.375rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        font-size: 0.9rem;
    }

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

    .cost-label {
        color: var(--muted);
        font-weight: 500;
    }

    .cost-value {
        color: var(--text);
        font-weight: 600;
    }

    .orders-history-actions {
        padding: 0.75rem;
        background: var(--card);
        border-top: 1px solid var(--accent);
    }

    .orders-history-actions button {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 44px;
        font-weight: 600;
    }

    /* Мобильные стили для информации о клиенте */
    .modal-header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        position: relative;
    }

    .modal-header-content h2 {
        flex: none;
        margin-bottom: 0.5rem;
    }

    .client-info-display {
        font-size: 0.85rem;
        padding: 0.5rem;
        align-self: stretch;
        justify-content: center;
        flex-shrink: 1;
    }

    .modal-close {
        position: absolute;
        right: 12px;
        margin-left: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        background: rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(8px);
    }

    /* Улучшения для touch устройств */
    .modal-close:hover {
        background: rgba(0, 0, 0, 0.10);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

/* Стили для подсказок клиентов */
.client-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff; /* Явный белый фон по умолчанию */
    background: var(--card); /* CSS переменная для поддержки тем */
    border: 1px solid var(--ring);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.client-suggestions .suggestion-item {
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--accent);
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-height: 40px;
}

.client-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.client-suggestions .suggestion-item:hover,
.client-suggestions .suggestion-item.highlighted {
    background-color: var(--accent);
}

.client-suggestions .suggestion-item div:first-child {
    font-weight: 600;
    color: var(--text);
}

.client-suggestions .suggestion-item div:not(:first-child) {
    font-size: 14px;
    color: var(--muted);
    font-weight: 400;
}

/* Темная тема для подсказок */
@media (prefers-color-scheme: dark) {
    .client-suggestions {
        background: linear-gradient(145deg, #2A303C 0%, #343A46 100%) !important;
        border: none !important;
        border-left: 1px solid rgba(74, 85, 104, 0.3) !important;
        border-right: 1px solid rgba(74, 85, 104, 0.3) !important;
        border-bottom: 1px solid rgba(74, 85, 104, 0.4) !important;
        border-top: none !important;
        border-radius: 0 0 12px 12px !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .client-suggestions .suggestion-item {
        border-bottom-color: rgba(255,255,255,0.06);
        color: #ffffff;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        gap: 1px;
    }

    .client-suggestions .suggestion-item:hover,
    .client-suggestions .suggestion-item.highlighted {
        background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.02) 100%);
        border-bottom-color: rgba(255,255,255,0.12);
        transform: translateX(2px);
        box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
    }

    .client-suggestions .suggestion-item:last-child {
        border-bottom: none;
    }

    .client-suggestions .suggestion-item div:first-child {
        color: #ffffff !important;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }

    .client-suggestions .suggestion-item div:not(:first-child) {
        color: #c7d2e0 !important;
        opacity: 0.95;
        font-weight: 400;
    }

    /* Улучшенная видимость для эмодзи в темной теме */
    .client-suggestions .suggestion-item div:not(:first-child)::before {
        filter: brightness(1.4) contrast(1.2);
        opacity: 0.8;
    }

    /* Добавляем subtle анимацию появления */
    .client-suggestions {
        animation: suggestionsFadeIn 0.2s ease-out;
    }

    @keyframes suggestionsFadeIn {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Мобильные стили для подсказок */
@media (max-width: 768px) {
    .client-suggestions {
        max-height: 150px;
        border-radius: 0 0 12px 12px;
        background: #ffffff; /* Явный белый фон для мобильных */
        background: var(--card);
    }

    .client-suggestions .suggestion-item {
        padding: 10px 16px;
        min-height: 44px;
    }

    /* Улучшенная темная тема для мобильных */
    @media (prefers-color-scheme: dark) {
        .client-suggestions {
            background: linear-gradient(145deg, #2A303C 0%, #343A46 100%) !important;
            border: none !important;
            border-left: 1px solid rgba(74, 85, 104, 0.3) !important;
            border-right: 1px solid rgba(74, 85, 104, 0.3) !important;
            border-bottom: 1px solid rgba(74, 85, 104, 0.4) !important;
            border-top: none !important;
            border-radius: 0 0 16px 16px !important;
            box-shadow: 0 6px 24px rgba(0,0,0,0.7), 0 2px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }

        .client-suggestions .suggestion-item {
            color: #ffffff;
            transition: all 0.15s ease-out;
            border-bottom-color: rgba(255,255,255,0.05);
            gap: 1px;
        }

        .client-suggestions .suggestion-item:hover,
        .client-suggestions .suggestion-item.highlighted {
            background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
            border-bottom-color: rgba(255,255,255,0.1);
            transform: translateX(1px);
        }

        .client-suggestions .suggestion-item div:first-child {
            color: #ffffff !important;
            font-weight: 600;
            text-shadow: 0 1px 2px rgba(0,0,0,0.4);
        }

        .client-suggestions .suggestion-item div:not(:first-child) {
            color: #c7d2e0 !important;
            opacity: 0.95;
        }

        /* Упрощенная анимация для мобильных */
        .client-suggestions {
            animation: suggestionsFadeInMobile 0.15s ease-out;
        }

        @keyframes suggestionsFadeInMobile {
            from {
                opacity: 0;
                transform: translateY(-4px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
    }
}

/* Стили для маскированных полей */
.masked-field {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f8f9fa 75%), linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-color: #ffc107 !important;
    position: relative;
}

.masked-field::before {
    content: '🔒';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #ffc107;
    pointer-events: none;
    opacity: 0.7;
}

/* Темная тема для маскированных полей */
@media (prefers-color-scheme: dark) {
    .masked-field {
        background: linear-gradient(45deg, #3d4451 25%, transparent 25%), linear-gradient(-45deg, #3d4451 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3d4451 75%), linear-gradient(-45deg, transparent 75%, #3d4451 75%);
        background-size: 20px 20px;
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
        border-color: #ffc107 !important;
    }
}

/* Мобильные стили для маскированных полей */
@media (max-width: 768px) {
    .masked-field {
        background-size: 16px 16px;
        background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    }

    .masked-field::before {
        right: 10px;
        font-size: 14px;
    }
}

/* ============================================
   НОВАЯ СИСТЕМА ЗАКАЗОВ - ПОШАГОВАЯ ФОРМА
   ============================================ */

/* Модальное окно заказа - общие стили */
.order-modal-content {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Прогресс-бар */
.order-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--accent);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--ring);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--ring);
    margin: 0 0.5rem;
}

/* Линия после завершенного шага должна быть зеленой */
.progress-step.completed ~ .progress-line {
    background: var(--primary);
}

/* Линия после активного шага остается серой (еще не завершена) */

/* Шаги заказа */
.order-step {
    padding: 1.5rem 2rem 2rem;
    animation: fadeIn 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

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

/* Шаг 1: Корзина */
.order-summary h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--accent);
    border-radius: 8px;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.order-item-quantity {
    font-size: 0.875rem;
    color: var(--muted);
}

.order-item-price {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.order-total-block {
    border-top: 2px solid var(--ring);
    padding-top: 1rem;
    margin-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.order-total-price {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Шаг 2: Телефон */
.phone-step-content {
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.phone-step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.step-description {
    color: var(--muted);
    margin-bottom: 2rem;
}

/* Шаг 3: Адрес */
.address-step-content {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.client-welcome {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    margin-bottom: 2rem;
    color: white;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.client-welcome h3 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: white;
}

.client-welcome p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

#client-name-display {
    font-weight: 700;
}

/* Список адресов */
.addresses-section {
    margin-bottom: 2rem;
}

.addresses-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.addresses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.address-card {
    padding: 1rem;
    background: var(--card);
    border: 2px solid var(--ring);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.address-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.address-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(60, 179, 113, 0.1), rgba(34, 139, 34, 0.05));
}

.address-card.selected::before {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
}

/* Название заведения в карточке адреса */
.establishment-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.address-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.375rem;
    padding-right: 2rem;
    line-height: 1.5;
}

.address-text.address-empty {
    color: var(--muted);
    opacity: 0.7;
    font-style: italic;
    position: relative;
    padding-left: 1.25rem;
}

.address-text.address-empty::before {
    content: '📍';
    position: absolute;
    left: 0;
    opacity: 0.5;
}

.address-meta {
    font-size: 0.8125rem;
    color: var(--muted);
    opacity: 0.8;
}

.btn-add-address {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 1rem;
}

/* Кнопка добавления нового заведения */
.btn-add-establishment {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--card);
    border: 2px dashed var(--ring);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

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

.btn-add-establishment:active {
    transform: translateY(0);
}

.btn-add-establishment svg {
    transition: transform 0.3s ease;
}

.btn-add-establishment:hover svg {
    transform: rotate(90deg);
}

/* Форма нового адреса */
.new-address-form {
    padding: 1.5rem;
    background: var(--accent);
    border: 2px solid var(--ring);
    border-radius: 12px;
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.new-address-form h4 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text);
}

.form-actions-inline {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Дополнительные поля */
.additional-fields {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--ring);
}

/* Шаг 4: Успешное оформление */
.success-content {
    text-align: center;
    padding: 3rem 1rem;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.success-message {
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.order-number {
    padding: 1rem;
    background: var(--accent);
    border-radius: 12px;
    font-size: 1.1rem;
}

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

/* Кнопки действий */
.step-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-top: 1px solid var(--ring);
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.btn-large {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Современные элементы формы */
.form-group-modern {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.form-group-modern label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.input-modern {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    border: 2px solid var(--ring);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: all 0.3s ease;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(60, 179, 113, 0.1);
}

.input-modern::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

/* Textarea с классом input-modern */
textarea.input-modern {
    resize: vertical;
    min-height: 80px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.input-large {
    font-size: 1.25rem;
    padding: 1.25rem;
    text-align: center;
    font-weight: 600;
}

.input-hint {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

/* Предложение использовать номер из буфера обмена */
.clipboard-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    margin-top: 1rem;
    background: var(--accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.clipboard-suggestion-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.clipboard-suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clipboard-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.clipboard-text {
    flex: 1;
}

.clipboard-phone-value {
    display: block;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.25rem;
}

.btn-clipboard-use {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-clipboard-use:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(60, 179, 113, 0.3);
}

.btn-clipboard-use:active {
    transform: translateY(0);
}

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

/* Мобильные устройства */
@media (max-width: 768px) {
    .clipboard-suggestion {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .btn-clipboard-use {
        width: 100%;
    }
}

/* Индикатор загрузки */
.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.loading-indicator .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--ring);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-indicator p {
    color: var(--muted);
    margin: 0;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .order-progress {
        background: #2A303C;
    }
    
    .step-number {
        background: #343A46;
        border-color: #4a5568;
        color: #cbd5e0;
    }
    
    .progress-step.active .step-number,
    .progress-step.completed .step-number {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }
    
    .step-label {
        color: #9ca3af;
    }
    
    .progress-step.active .step-label {
        color: var(--primary);
    }
    
    .progress-line {
        background: #4a5568;
    }
    
    .progress-step.completed ~ .progress-line {
        background: var(--primary);
    }
    
    .order-item-row {
        background: #343A46;
    }
    
    .address-card {
        background: #343A46;
        border-color: #4a5568;
    }
    
    .address-card.selected {
        background: linear-gradient(135deg, rgba(60, 179, 113, 0.2), rgba(34, 139, 34, 0.1));
    }
    
    .new-address-form {
        background: #2A303C;
        border-color: #4a5568;
    }
    
    .client-welcome {
        background: linear-gradient(135deg, #228B22, #1a6b1a);
    }
}

/* Мобильные стили */
@media (max-width: 768px) {
    .order-modal-content {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .order-progress {
        padding: 1rem;
        gap: 0.25rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .progress-line {
        margin: 0 0.25rem;
    }
    
    .order-step {
        padding: 1rem 1rem 3rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .step-icon {
        font-size: 3rem;
    }
    
    .phone-step-content h3 {
        font-size: 1.25rem;
    }
    
    .client-welcome h3 {
        font-size: 1.25rem;
    }
    
    .welcome-icon {
        font-size: 2.5rem;
    }
    
    .btn-large {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .phone-step-content {
        padding: 1.5rem 1rem;
    }
    
    .address-step-content {
        padding: 1rem;
    }
    
    .form-group-modern {
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }
    
    .step-actions {
        gap: 0.75rem;
        padding-bottom: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .success-icon {
        font-size: 4rem;
    }
    
    .success-content h3 {
        font-size: 1.5rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 380px) {
    .step-label {
        display: none;
    }
    
    .order-progress {
        justify-content: space-around;
    }
}


