:root {
    --green: #2e7d32;
    --green-light: #e8f5e9;
    --orange: #ef6c00;
    --text: #212121;
    --muted: #757575;
    --border: #e0e0e0;
    --radius: 10px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: #fafafa;
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Шапка */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    text-decoration: none;
}
.logo-leaf { font-size: 1.25rem; line-height: 1; }
.logo-word {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--green);
}
.logo-tld {
    font-weight: 600;
    color: var(--muted);
}
.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: #fff;
    padding: 8px 16px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
}
.cart-badge {
    background: #fff;
    color: var(--green);
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

h1 { margin: 24px 0 8px; }
.delivery-note { color: var(--muted); margin-bottom: 16px; }

/* Категории */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.category-nav a {
    background: var(--green-light);
    color: var(--green);
    padding: 6px 14px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.category-section h2 { margin: 28px 0 12px; }

/* Каталог */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
}
.product-card.out-of-stock { opacity: 0.55; }
.product-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
}
.product-photo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--green-light);
}
.product-card h3 { margin: 10px 0 4px; font-size: 1.05rem; }
.product-desc { color: var(--muted); font-size: 0.85rem; margin: 0 0 6px; }
.product-price { font-weight: 700; font-size: 1.1rem; margin: 4px 0 10px; }
.stock-label { color: var(--muted); font-style: italic; }

/* Кнопки */
.btn {
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}
.btn-add {
    background: var(--green);
    color: #fff;
    padding: 10px;
    width: 100%;
    margin-top: auto;
}
.btn-add:hover { background: #1b5e20; }
.btn-qty {
    background: var(--green-light);
    color: var(--green);
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
}
.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    font-weight: 600;
}
.btn-primary {
    background: var(--orange);
    color: #fff;
    padding: 12px 28px;
    display: inline-block;
    text-decoration: none;
    margin-top: 12px;
}
.btn-primary:hover { background: #e65100; }
.btn-primary:disabled { background: #bdbdbd; cursor: not-allowed; }
.btn-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}

/* Оформление */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 760px) {
    .checkout-grid { grid-template-columns: 1fr; }
}
.cart-section, .form-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--border);
}
.qty-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.totals { margin-top: 14px; }
.totals p { margin: 4px 0; }
.grand-total { font-size: 1.2rem; font-weight: 700; }
.warn { color: var(--orange); font-weight: 600; }

/* Форма */
.form-section label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}
.form-section input, .form-section textarea {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
.payment-choice {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.payment-choice legend { font-weight: 700; padding: 0 6px; }
.radio { font-weight: 400 !important; }
.radio input { width: auto; margin-right: 6px; }
.error { color: #c62828; font-weight: 600; }

/* Страница успеха */
.success-page { max-width: 560px; margin: 0 auto; }

/* Подвал */
.footer {
    margin-top: 48px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}
.footer p { margin: 4px 0; }
.footer-brand { font-weight: 700; color: var(--green); }
.footer-copy { color: var(--muted); }
