:root {
    --text: #1f2a1f;
    --muted: #5b665b;
    --accent: #2f6b3a;
    --accent-dark: #24532d;
    --border: #d5dcd3;
    --surface: #ffffff;
    --background: #f6f7f2;
    --error: #a12a1f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    max-height: 48px;
    max-width: 120px;
    object-fit: contain;
}

.brand-name {
    font-weight: 700;
    font-size: 1.15rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav a,
.link-button {
    color: var(--accent);
    text-decoration: none;
    font: inherit;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.inline-form {
    display: inline;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.form {
    max-width: 560px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.field-checkbox {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.field input:not([type="checkbox"]):not([type="file"]),
.field textarea {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
}

.field-error,
.validation-summary {
    color: var(--error);
}

.field-checkbox .field-error {
    flex-basis: 100%;
}

.button {
    font: inherit;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 18px;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-dark);
}

.notice {
    background: #e7f1e5;
    border: 1px solid #b9d3b4;
    border-radius: 6px;
    padding: 8px 12px;
}

.logo-preview {
    max-width: 240px;
    max-height: 160px;
    object-fit: contain;
    display: block;
    margin-bottom: 12px;
}

/* M1 Catalog */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-heading form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.muted {
    color: var(--muted);
}

.form-wide {
    max-width: 760px;
}

.field-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.field-row .field {
    flex: 1 1 180px;
}

.field-narrow {
    max-width: 220px;
}

fieldset.field {
    border: 0;
    padding: 0;
    margin: 0 0 14px;
}

fieldset.field legend {
    padding: 0;
    margin-bottom: 4px;
}

.checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-fields input[type="text"] {
    font: inherit;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 220px;
}

.button-secondary {
    font: inherit;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.table th,
.table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table th {
    font-weight: 600;
    color: var(--muted);
}

.table .actions {
    white-space: nowrap;
    display: flex;
    gap: 14px;
    align-items: center;
}

.table a,
.actions a {
    color: var(--accent);
}

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-ok {
    background: #e7f1e5;
    color: var(--accent-dark);
}

.badge-low {
    background: #fbf0d0;
    color: #7a5600;
}

.badge-out {
    background: #f8dedb;
    color: var(--error);
}

.add-variant {
    margin-top: 16px;
}

.add-variant summary {
    cursor: pointer;
    color: var(--accent);
    margin-bottom: 12px;
}

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.photo {
    margin: 0;
    width: 160px;
}

.photo img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 4px;
}

.stock-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stock-quantity {
    font-size: 2rem;
    font-weight: 700;
}

/* M2 Storefront */
.heading-actions {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.heading-actions form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-button:disabled {
    color: var(--border);
    cursor: default;
}

.code-box {
    width: 100%;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
}

.preview-banner {
    background: #fbf0d0;
    color: #7a5600;
    text-align: center;
    padding: 8px 16px;
}

.preview-banner a {
    color: #7a5600;
    font-weight: 600;
    margin-left: 8px;
}

.store-intro p {
    font-size: 1.1rem;
    max-width: 720px;
}

.store-search {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    max-width: 560px;
}

.store-search input[type="search"] {
    flex: 1;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.category-link {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
}

.category-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    text-decoration: none;
}

.product-card:hover {
    border-color: var(--accent);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
}

.product-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e7f1e5;
    color: var(--accent);
    font-size: 2.5rem;
    font-weight: 700;
}

.product-card-name {
    font-weight: 600;
}

.product-card .badge {
    align-self: flex-start;
}

.store-product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
}

@media (max-width: 760px) {
    .store-product {
        grid-template-columns: 1fr;
    }
}

.store-product-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.store-product-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.store-product-thumb {
    width: 88px;
    height: 66px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.store-product-details h1 {
    margin-top: 0;
}

.store-product-description {
    white-space: pre-line;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 0.85rem;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
}

.share {
    margin-top: 24px;
}

.share-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

.share-link input {
    font: inherit;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.store-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: 32px;
}

.store-footer .page {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.store-footer a {
    color: var(--accent);
}

/* M3a Pickup and buyers */
.store-pickups {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
}

.store-pickups h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.store-pickups ul {
    margin: 0;
    padding-left: 18px;
}

.next-pickup {
    background: #e7f1e5;
    border-radius: 6px;
    padding: 8px 12px;
}

.form select {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.field input[type="time"] {
    font: inherit;
}

/* M3b Orders and payments */
.quantity-input {
    width: 72px;
    font: inherit;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.notice-warning {
    background: #fbf0d0;
    border-color: #e6cf8a;
}

.notice-warning p {
    margin: 4px 0;
}

.pickup-choice {
    align-items: flex-start;
    margin-bottom: 8px;
}

.pickup-choice input {
    margin-top: 5px;
}

/* M5 pickup day (F2C-UC-28): pick list and packing slips print one order per page. */
.packing-slip {
    break-inside: avoid;
}

.day-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.day-picker a.current {
    font-weight: 700;
    text-decoration: none;
}

@media print {
    header, nav, footer, .no-print, .notice {
        display: none !important;
    }

    .packing-slip {
        break-before: page;
    }

    .panel {
        border: none;
        box-shadow: none;
    }
}

/* M6 launch checklist (F2C-UC-02) and import column matching (F2C-UC-06). */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.field-row-wrap {
    flex-wrap: wrap;
}

/* M7 delivery route (F2C-UC-27). */
.route-stops {
    padding-left: 24px;
}

.route-stop {
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.route-stop-done {
    opacity: 0.6;
}

/* A field people do not see (a honeypot that only bots fill in). */
.visually-hidden {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* DEF-01: the logo box takes a dropped or pasted image. */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
}

.drop-zone-active {
    border-color: currentColor;
    background: rgba(0, 0, 0, 0.04);
}
