: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;
}

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;
}

#client-name-container {
    background: var(--card);
    padding: 1.5rem 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#client-name {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
    transition: all 0.2s ease;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

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

#order-comment-container {
    background: var(--card);
    padding: 1.5rem 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#order-comment {
    width: 100%;
    max-width: 400px;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
    transition: all 0.2s ease;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    resize: vertical;
    min-height: 60px;
}

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

.comment-hint {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#delivery-date-container {
    background: var(--card);
    padding: 1.5rem 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

#delivery-date-container label {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

#delivery-date {
    width: 100%;
    max-width: 200px;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

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

.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;
}

.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;
}

#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;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    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: 1000;
    transition: transform 0.3s ease;
    border: 1px solid var(--accent);
}

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

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

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

.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;
}

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

.whatsapp-btn {
    background: #25D366;
}

.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: 420px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .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;
    }
}
