/* Milligram overrides */
:root {
    /* The following are official CakePHP colors */
    --color-cakephp-red: #3ca35c;
    --color-cakephp-gray: #404041;
    --color-cakephp-blue: #2f85ae;
    --color-cakephp-lightblue: #34bdd7;

    /* These are additional colors */
    --color-lightgray: #606c76;
    --color-white: #fff;

    --color-main-bg: #f5f7fa;
    --color-links: var(--color-cakephp-blue);
    --color-links-active: #2a6496;
    --color-headings: #363637;

    --color-message-success-bg: #e3fcec;
    --color-message-success-text: #1f9d55;
    --color-message-success-border: #51d88a;

    --color-message-warning-bg: #fffabc;
    --color-message-warning-text: #8d7b00;
    --color-message-warning-border: #d3b800;

    --color-message-paused-bg: #ffe8d6;
    --color-message-paused-text: #9a3412;
    --color-message-paused-border: #ea580c;

    --color-message-error-bg: #fcebea;
    --color-message-error-text: #cc1f1a;
    --color-message-error-border: #ef5753;

    --color-message-info-bg: #eff8ff;
    --color-message-info-text: #2779bd;
    --color-message-info-border: #6cb2eb;
}

.button, button, input[type='button'], input[type='reset'], input[type='submit'] {
    background-color: var(--color-cakephp-red);
    border-color: var(--color-cakephp-red);
}

.main {
    flex: 1;
    /* Cap content width and centre on wide viewports so pages don't span
       edge-to-edge at desktop sizes — they sit in a readable column with
       consistent side padding. Top padding gives the page breathing room
       below the green nav so content doesn't butt up against it. */
    width: 100%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    background: var(--color-main-bg);
    /* Safety net: if any child overflows horizontally (pre-existing
       fixed-width utilities, runaway tables, etc.), keep the page from
       side-scrolling. Intentional overflow uses .table-responsive. */
    overflow-x: hidden;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navi{
    display: flex;
    flex-wrap: wrap;
    background-color: #3ca35c;
    padding: 1rem 1.5rem;
}

.top-nav-links{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* Wider column gap so multi-word items like "Browse Products" read as
       a single link rather than two. Row-gap stays tight so the bar
       doesn't grow when links wrap on narrower viewports. */
    gap: 0.8rem 2.25rem;
    margin-left: auto;
    margin-right: 1.5rem;
}

.burger{
    display: none;
    background: transparent;
    border: 0;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    line-height: 1;
}
.burger:focus-visible {
    outline: 0.2rem solid #FFFFFF;
    outline-offset: 0.2rem;
}

@media (max-width: 800px) {
    /* Slide the whole link list below the nav bar as a drop-down panel.
       The burger is the only control visible on the bar; toggling
       .is-open reveals the panel with all role-appropriate links from
       the UserRoleNav cell. */
    .top-nav-links{
        display: none;
        width: 100vw;
        flex-basis: 100vw;
        flex-direction: column;
        align-items: stretch;
        /* Inherit the top-bar colour so admin/manufacturer/farmer/seller
           themes don't get a clashing green dropdown. The translucent
           overlay darkens it slightly so the panel still reads as a
           "drawer" beneath the bar. */
        background-color: #3ca35c;
        margin: 0;
        padding: 0.5rem 1.5rem 1rem;
        row-gap: 0;
    }
    .top-nav-links.is-open {
        display: flex;
    }
    .top-nav-links a,
    .top-nav-links form {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
        padding: 0.9rem 0.4rem;
        border-top: 0.1rem solid rgba(255, 255, 255, 0.2);
        min-height: 4.4rem;
        color: #FFFFFF;
    }
    .top-nav-links form {
        padding: 0;
    }
    .top-nav-links form button {
        width: 100%;
        text-align: left;
        padding: 0.9rem 0.4rem;
        background: transparent;
        color: #FFFFFF;
        border: 0;
        font: inherit;
        cursor: pointer;
        min-height: 4.4rem;
    }
    .top-nav-links a.nav-cta {
        margin-top: 0.6rem;
        justify-content: center;
        border-top: 0;
    }

    /* Hide About / Contact and other secondary links — they live in
       the footer; the burger drawer doesn't have the real-estate. */
    .top-nav-links .mobile-hidden {
        display: none !important;
    }

    /* "My Account" dropdown inside the burger drawer: the summary row
       looks like the other drawer links, and when opened the menu
       items render as an indented inline sub-list (no floating
       popover — there's no room for one). */
    .top-nav-links .nav-dropdown {
        width: 100%;
    }
    .top-nav-links .nav-dropdown > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.9rem 0.4rem;
        border-top: 0.1rem solid rgba(255, 255, 255, 0.2);
        min-height: 4.4rem;
        color: #FFFFFF;
    }
    .top-nav-links .nav-dropdown__menu {
        padding-left: 1.6rem;
        background: rgba(0, 0, 0, 0.12);
    }
    .top-nav-links .nav-dropdown__menu a {
        padding: 0.7rem 0.4rem;
        border-top: 0.1rem solid rgba(255, 255, 255, 0.12);
        min-height: 3.8rem;
        color: #FFFFFF;
        white-space: normal;
    }

    /* Icons (cart / home / logout) live in a .nav-icon-row inside the
       drawer. Lay them out as a horizontal strip at the bottom rather
       than each on its own full-width row. */
    .top-nav-links .nav-icon-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1.6rem;
        width: 100%;
        padding: 1rem 0.4rem;
        border-top: 0.1rem solid rgba(255, 255, 255, 0.2);
    }
    /* Reset the row-link defaults for icon links inside the strip so
       they don't expand to full-width or add their own dividers. */
    .top-nav-links .nav-icon-row a,
    .top-nav-links .nav-icon-row form,
    .top-nav-links .nav-icon-row form button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        padding: 0;
        margin: 0;
        border-top: 0;
        min-height: 0;
    }
    /* Each icon img is small + uniform. */
    .top-nav-links .nav-icon-row img {
        height: 2.8rem;
        width: 2.8rem;
        object-fit: contain;
    }

    /* Cart badge floats over the top-right corner of the cart icon —
       same desktop behaviour, just sized for the smaller icon. */
    .top-nav-links .cart-icon {
        position: relative;
        display: inline-flex;
    }
    .top-nav-links .cart-icon a {
        position: relative;
    }
    .top-nav-links .cart-badge {
        position: absolute;
        top: -0.6rem;
        right: -0.6rem;
        background: #dc2626;
        color: #fff;
        border-radius: 999px;
        height: 1.8rem;
        min-width: 1.8rem;
        padding: 0 0.4rem;
        font-size: 1.1rem;
        line-height: 1.8rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
    }

    .burger{
        display: flex;
        margin-left: auto;
        align-items: center;
        margin-right: 1rem;
        font-size: 2.4rem;
        min-height: 4.4rem;
        min-width: 4.4rem;
        justify-content: center;
    }

    /* Shrink the brand logo on small screens so it doesn't dominate
       the header. 130px on a 360px phone eats over a third of the bar. */
    .top-nav-logo {
        height: 6rem;
        width: 6rem;
    }
}

.top-nav-logo{
    display: block;
    height: 130px;
    width: 130px;
    line-height: 0;
}
.top-nav-logo img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.top-nav-icons{
    display: inline-block;
    height: 70px;
    width: 70px;
    line-height: 0;
    vertical-align: middle;
}

.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-icon a {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: red;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 20px;
    padding: 0;
}

.top-nav-links,
.side-nav,
h1, h2, h3, h4, h5, h6 {
    font-family: "Raleway", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    color: var(--color-headings);
}

h2 {
    font-family: "Raleway", sans-serif;
    font-weight: 400;
    color: var(--color-headings);
}

a {
    color: var(--color-links);
    transition: color 0.2s linear;
}

a:hover,
a:focus,
a:active {
    color: var(--color-links-active);
    transition: color 0.2s ease-out;
}

/* Nav links sitting on the green top bar stay white. */
.top-nav-links a {
    color: #FFFFFF;
}

/* Nav-level call-to-action (Login for guests, Logout buttons). Pill shape
   with a white fill so it reads as the primary action against the green
   header — inverse of the regular white-on-green nav link. */
.top-nav-links a.nav-cta {
    background-color: #FFFFFF;
    color: #1f6f3a;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    line-height: 1;
}
.top-nav-links a.nav-cta:hover,
.top-nav-links a.nav-cta:focus {
    background-color: #f0f8f5;
    color: #154d28;
}

/* Action and side-nav links live on white content backgrounds, so use the
   primary link colour for readable contrast (WCAG AA). */
.side-nav a,
.actions a,
th a {
    color: var(--color-links);
}

.side-nav a:hover,
.side-nav a:focus,
.actions a:hover,
.actions a:focus {
    color: var(--color-links-active);
}

/* Utility */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Milligram forces display:block on tables below 40rem viewport for mobile
   scroll. We wrap tables in .table-responsive instead (see above) which
   handles overflow, so keep tables rendered as proper tables at all widths. */
table {
    display: table;
}

.text-field {
    width: 1000px;
    display: flex;
}

.margin {
    margin-left: 25px;
}

/* Main */
.content {
    padding: 2rem;
    background: var(--color-white);
    border-radius: 0.4rem;
    /* Thanks Stripe */
    box-shadow: 0 7px 14px 0 rgba(60, 66, 87, 0.1),
        0 3px 6px 0 rgba(0, 0, 0, 0.07);
}
.content form {
    margin: 0;
}
.actions a {
    font-weight: bold;
    padding: 0 0.4rem;
}
.actions a:first-child {
    padding-left: 0;
}
th {
    white-space: nowrap;
}

/* Nav bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 112rem;
    padding: 2rem;
    margin: 0 auto;
}
.top-nav-title a {
    font-size: 2.4rem;
    color: var(--color-cakephp-red);
}
.top-nav-title span {
    color: var(--color-cakephp-gray);
}
.top-nav-links a {
    /* Spacing lives on the flex gap now, not on each link. */
    margin: 0;
}
.top-nav-title a,
.top-nav-links a {
    font-weight: bold;
}

/* Disabled nav entries for routes that don't exist yet. Styled so they're
   visibly non-interactive (dimmed colour, not-allowed cursor) without
   disappearing from the layout. aria-disabled on the element tells AT
   users they're not clickable. */
.top-nav-links .nav-placeholder {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.55);
    cursor: not-allowed;
    font-weight: bold;
    font-style: italic;
}
/* Actions panel / side navigation — styled as a card so it doesn't
   blend into the page background. */
.side-nav {
    padding: 1.5rem;
    background: var(--color-white);
    border-radius: 0.4rem;
    box-shadow: 0 7px 14px 0 rgba(60, 66, 87, 0.1),
                0 3px 6px 0 rgba(0, 0, 0, 0.07);
    margin-bottom: 2rem;
}
.side-nav .heading {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 0.1rem solid #e5e7eb;
}
.side-nav-item {
    display: block;
    padding: 0.8rem 0;
    border-bottom: 0.1rem solid #f1f3f5;
}
.side-nav-item:last-child {
    border-bottom: 0;
}

/* View action */
.view.content .text {
    margin-top: 1.2rem;
}
.related {
    margin-top: 2rem;
}

/* Flash messages */
.message {
    padding: .5rem 1rem;
    background: var(--color-message-info-bg);
    color: var(--color-message-info-text);
    border-color: var(--color-message-info-border);
    border-width: 1px;
    border-style: solid;
    border-radius: 4px;
    margin-bottom: 1rem;
    cursor: pointer;
}
.message.hidden {
    display: none;
}
.message.success {
    background: var(--color-message-success-bg);
    color: var(--color-message-success-text);
    border-color: var(--color-message-success-border);
}
.message.warning {
    background: var(--color-message-warning-bg);
    color: var(--color-message-warning-text);
    border-color: var(--color-message-warning-border);
}
.message.paused {
    background: var(--color-message-paused-bg);
    color: var(--color-message-paused-text);
    border-color: var(--color-message-paused-border);
}
.message.error {
    background: var(--color-message-error-bg);
    color: var(--color-message-error-text);
    border-color: var(--color-message-error-border);
}

/* Forms */
.input {
    margin-bottom: 1.5rem;
}
.input input,
.input select,
.input textarea {
    margin-bottom: 0;
}

/* Native select popup font-size — Milligram + normalize never set
   one, so the dropdown overlay (desktop Chrome AND mobile) falls back
   to a microscopic system default. Pin both <select> and <option> at
   16px in absolute pixel units so no inherited rem trick can shrink
   them. font-size 16px on the input itself also stops iOS Safari from
   auto-zooming on focus. */
select,
select option,
.input select,
.input select option {
    font-size: 16px !important;
    line-height: 1.5 !important;
}
input, textarea {
    font-size: 1.6rem;
}
.input label:has(input[type='checkbox']),
.input label:has(input[type='radio']) {
    display: flex;
    align-items: center;
}
.input label:has(~ label),
.input label:has(input[type='radio']) {
    margin-bottom: 0;
}
.input label > input[type='checkbox'],
.input label > input[type='radio'] {
    margin-right: 1.0rem;
}
input[type='color'] {
    max-width: 4rem;
    padding: 0.3rem .5rem 0.3rem;
}
.error-message {
    color: var(--color-message-error-text);
}

/* Paginator */
.paginator {
    text-align: right;
}
.paginator p {
    margin-bottom: 0;
}
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}
.pagination li {
    display: inline-block;
    margin: 0.25em;
    text-align: center;
}
.pagination a {
    color: var(--color-cakephp-blue);
    display: inline-block;
    font-size: 1.25rem;
    line-height: 3rem;
    min-width: 3rem;
    padding: 0;
    position: relative;
    text-decoration: none;
    transition: background .3s,color .3s;
}
.pagination li.active a,
.pagination a:hover {
    text-decoration: underline;
}
.pagination .disabled a {
    cursor: not-allowed;
    color: var(--color-lightgray);
    text-decoration: none;
}
.first a,
.prev a,
.next a,
.last a {
    padding: 0 .75rem;
}
.disabled a:hover {
    background: initial;
    color: initial;
}
.asc:after {
    content: " \2193";
}
.desc:after {
    content: " \2191";
}

/* Error in non debug mode */
.error-container {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
}

/* Call to action button for the landing page*/
.shop-now-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.9rem 1.8rem;
    background-color: #2e7d32;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;

    opacity: 1 !important;
    filter: none !important;

    position: relative;
    z-index: 10;
}

/* Makes the cards look unclickable */
.cards-container .card,
.cards-container .card:hover {
    cursor: default;
    transform: none;
    transition: none;
    box-shadow: none;
    background: inherit;
    filter: none;
}

/* Make datetime more readable in the tables */
.datetime {
    white-space: nowrap;
}

/* Small-screen adjustments (phones + narrow tablets up to ~640px).
   A51/A71-class devices are ~412px wide, so 40rem is too tight a
   breakpoint; 64rem covers all modern phone portrait widths. */
@media screen and (max-width: 63.99rem) {
    /* Force stacked layout for explicitly-sized columns (main+aside etc). */
    .row {
        flex-direction: column;
    }
    .row .column[class*='column-'],
    .row > aside.column {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .top-nav {
        margin: 0 auto;
    }
    .side-nav {
        margin-bottom: 1rem;
        padding: 1rem;
        text-align: center;
    }
    .side-nav .heading {
        text-align: left;
    }
    .side-nav-item {
        display: inline-block;
        padding: 0.4rem 0.8rem;
        margin: 0.25rem;
        border-bottom: 0;
        border: 0.1rem solid #e5e7eb;
        border-radius: 0.4rem;
    }
    /* In a cramped viewport, hide the actions column — rows are clickable
       via the username link + JS row handler, which keeps keyboard users
       accessible and removes the need for horizontal scroll. */
    table .actions,
    table th.actions {
        display: none;
    }

    /* Convert the users index table into stacked cards on mobile so content
       reads top-to-bottom and there's no horizontal scroll. Each row becomes
       a self-contained tile with the username centred across the top, left
       column carrying role + email, right column carrying joined date +
       status. Scoped to .users.index so per-record detail tables elsewhere
       aren't affected. */
    .users.index .table-responsive {
        overflow-x: visible;
    }
    .users.index .table-responsive table,
    .users.index .table-responsive tbody {
        display: block;
        border: 0;
    }
    .users.index .table-responsive thead {
        display: none;
    }
    .users.index .table-responsive tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "name  name"
            "role  joined"
            "email status";
        gap: 0.4rem 1rem;
        margin-bottom: 1rem;
        padding: 1.2rem;
        background: var(--color-white);
        border: 0.1rem solid #e5e7eb;
        border-radius: 0.4rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    }
    .users.index .table-responsive td {
        border: 0;
        padding: 0;
        font-size: 1.4rem;
    }
    /* Label prefix becomes a small uppercase key above the value so the
       two-column tile stays tidy at narrow widths. */
    .users.index .table-responsive td[data-label]:before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 1rem;
        font-weight: 700;
        color: var(--color-lightgray);
        text-transform: uppercase;
        letter-spacing: 0.05rem;
    }

    /* Place each cell into the grid. Match by column index so this keeps
       working if the team reorders cells in the HTML later. */
    .users.index .table-responsive tr > td:nth-child(1) { grid-area: name; }
    .users.index .table-responsive tr > td:nth-child(2) { grid-area: email; }
    .users.index .table-responsive tr > td:nth-child(3) { grid-area: role; }
    .users.index .table-responsive tr > td:nth-child(4) { grid-area: status; text-align: right; }
    .users.index .table-responsive tr > td:nth-child(5) { grid-area: joined; text-align: right; }

    /* Username card header: centred, bigger, divider below. */
    .users.index .table-responsive tr > td:first-child {
        text-align: center;
        padding-bottom: 0.8rem;
        margin-bottom: 0.4rem;
        border-bottom: 0.1rem solid #f1f3f5;
    }
    .users.index .table-responsive tr > td:first-child:before {
        display: none;
    }
    .users.index .table-responsive tr > td:first-child .user-name-link {
        font-size: 1.8rem;
        font-weight: 700;
    }
    /* Right-column cells: their label sits on the right too so it aligns
       with the value. */
    .users.index .table-responsive tr > td:nth-child(4):before,
    .users.index .table-responsive tr > td:nth-child(5):before {
        text-align: right;
    }

    /* Convert the enquiries index table into stacked cards on mobile so content
       reads top-to-bottom and there's no horizontal scroll. Each row becomes
       a self-contained tile with the username centred across the top, left
       column carrying role + email, right column carrying joined date +
       status. Scoped to .enquiries.index so per-record detail tables elsewhere
       aren't affected. */
    .enquiries.index .table-responsive {
        overflow-x: visible;
    }
    .enquiries.index .table-responsive table,
    .enquiries.index .table-responsive tbody {
        display: block;
        border: 0;
    }
    .enquiries.index .table-responsive thead {
        display: none;
    }
    .enquiries.index .table-responsive tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "name name"
            "email status"
            "subject created"
            "modified modified";
        gap: 0.4rem 1rem;
        margin-bottom: 1rem;
        padding: 1.2rem;
        background: var(--color-white);
        border: 0.1rem solid #e5e7eb;
        border-radius: 0.4rem;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    }
    .enquiries.index .table-responsive td {
        border: 0;
        padding: 0;
        font-size: 1.4rem;
    }
    /* Label prefix becomes a small uppercase key above the value so the
       two-column tile stays tidy at narrow widths. */
    .enquiries.index .table-responsive td[data-label]:before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 1rem;
        font-weight: 700;
        color: var(--color-lightgray);
        text-transform: uppercase;
        letter-spacing: 0.05rem;
    }

    .enquiries.index .table-responsive tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .enquiries.index .table-responsive td {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Place each cell into the grid. Match by column index so this keeps
       working if the team reorders cells in the HTML later. */
    .enquiries.index .table-responsive tr > td:nth-child(1) { grid-area: name; }
    .enquiries.index .table-responsive tr > td:nth-child(2) { grid-area: email; }
    .enquiries.index .table-responsive tr > td:nth-child(3) { grid-area: subject; }
    .enquiries.index .table-responsive tr > td:nth-child(4) { grid-area: status; text-align: right;}
    .enquiries.index .table-responsive tr > td:nth-child(5) { grid-area: created; text-align: right;}
    .enquiries.index .table-responsive tr > td:nth-child(6) { grid-area: modified; text-align: right; }

    /* Username card header: centred, bigger, divider below. */
    .enquiries.index .table-responsive tr > td:first-child {
        text-align: center;
        padding-bottom: 0.8rem;
        margin-bottom: 0.4rem;
        border-bottom: 0.1rem solid #f1f3f5;
    }
    .enquiries.index .table-responsive tr > td:first-child:before {
        display: none;
    }
    .enquiries.index .table-responsive tr > td:first-child .sender-name-link {
        font-size: 1.8rem;
        font-weight: 700;
    }
    /* Right-column cells: their label sits on the right too so it aligns
       with the value. */
    .enquiries.index .table-responsive tr > td:nth-child(4):before,
    .enquiries.index .table-responsive tr > td:nth-child(5):before {
        text-align: right;
    }
    /* Boundaries added so text does not overflow */
    .users.view table {
        table-layout: fixed;
        width: 100%;
    }
    .users.view td {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .enquiries.view table {
        table-layout: fixed;
        width: 100%;
    }
    .enquiries.view td {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .asc:after {
        content: " \2192";
    }
    .desc:after {
        content: " \2190";
    }
}

/* Clickable row — styled so the affordance is obvious on both mouse and
   touch. The username cell still holds a real <a> for accessibility. */
.row-link {
    cursor: pointer;
}
.row-link:hover,
.row-link:focus-within {
    background-color: #f7fafc;
}
.user-name-link {
    font-weight: 600;
}

/* Back-button — shows up on list/detail pages for easy navigation,
   especially important on mobile where we hide the action column. */
.back-button-wrap {
    /* Match top + bottom breathing room so the button doesn't sit glued
       to the navbar above it. */
    margin: 1rem 0;
}
.back-button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
    font-weight: 600;
    line-height: 1.4;
    background: var(--color-white);
}
.back-button:hover,
.back-button:focus {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* Screen-reader-only content utility. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* User status badges — paired with text label so colour is never the
   only signal (WCAG 1.4.1). Readable contrast at AA on both BG + text. */
.user-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999rem;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.8rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    border: 0.1rem solid transparent;
    color: #1a202c;
    background: #edf2f7;
}
.user-status--active      { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.user-status--pending,
.user-status--pending-verification,
.user-status--unlisted    { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.user-status--for-sale    { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.user-status--coming-soon { background: #e2e8f0; color: #2d3748; border-color: #cbd5e0; }
.user-status--sold-out    { background: #f1f5f9; color: #4a5568; border-color: #e2e8f0; }
.user-status--suspended   { background: #ffe0b2; color: #7a3e00; border-color: #ffcc80; }
.user-status--banned,
.user-status--deactivated { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* enquiry status badges — paired with text label so colour is never the
   only signal (WCAG 1.4.1). Readable contrast at AA on both BG + text. */
.enquiry-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999rem;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.8rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    border: 0.1rem solid transparent;
    color: #1a202c;
    background: #edf2f7;
}
.enquiry-status--resolved    { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.enquiry-status--pending     { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.enquiry-status--in-progress { background: #e2e8f0; color: #2d3748; border-color: #cbd5e0; }

/* Destructive link — uses colour AND weight so contrast isn't colour-only
   (WCAG 1.4.1). Confirmation dialog in the click handler is the real safety. */
.button-destructive {
    color: #c53030;
    font-weight: 700;
}
.button-destructive:hover,
.button-destructive:focus {
    color: #9b2c2c;
    text-decoration: underline;
}

/* <button> triggers styled to match the link conventions elsewhere. */
button.trigger-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--color-links);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    line-height: inherit;
    height: auto;
    text-align: inherit;
}
button.trigger-link:hover,
button.trigger-link:focus {
    background: none;
    color: var(--color-links-active);
    text-decoration: underline;
    outline: 0.2rem solid #bee3f8;
    outline-offset: 0.1rem;
}
button.trigger-link.button-destructive {
    color: #c53030;
}
button.trigger-link.button-destructive:hover,
button.trigger-link.button-destructive:focus {
    color: #9b2c2c;
}

/* Confirmation dialog — native <dialog>, styled to feel like our cards.
   Sizing uses max-width + width so it shrinks to the viewport on mobile
   (the native dialog has UA default `margin: auto` which centres it).
   max-height + overflow keeps long content scrollable without the whole
   page scrolling under it. */
.confirm-modal {
    max-width: 36rem;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 4rem);
    padding: 0;
    border: none;
    border-radius: 0.6rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    overflow: auto;
}
.confirm-modal::backdrop {
    background: rgba(16, 24, 40, 0.55);
}
.confirm-modal__body {
    padding: 2rem;
}
.confirm-modal__body form {
    margin: 0;
}
.confirm-modal__title {
    margin: 0 0 0.8rem;
    font-size: 2rem;
    color: var(--color-headings);
    line-height: 1.3;
}
.confirm-modal__description {
    color: var(--color-lightgray);
    margin-bottom: 1.5rem;
}
.confirm-modal textarea {
    min-height: 6rem;
    margin-bottom: 0;
}
.confirm-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}
.confirm-modal__actions .button {
    margin-bottom: 0;
}
.confirm-modal__submit.button-destructive {
    background-color: #c53030;
    border-color: #c53030;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.confirm-modal__submit.button-destructive:hover,
.confirm-modal__submit.button-destructive:focus {
    background-color: #9b2c2c;
    border-color: #9b2c2c;
    color: #fff;
    text-decoration: none;
}

/* Mobile: tighten paddings, stretch buttons to full width so they're a
   proper tap target, and stack them vertically to avoid cramped side-
   by-side layout. */
@media screen and (max-width: 47.99rem) {
    .confirm-modal__body {
        padding: 1.5rem;
    }
    .confirm-modal__title {
        font-size: 1.8rem;
    }
    .confirm-modal__actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.6rem;
    }
    .confirm-modal__actions .button {
        width: 100%;
        text-align: center;
    }
}

/* Page header pattern — title on the left, primary action on the right.
   Stacks on mobile. */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.page-header h1,
.page-header h2,
.page-header h3 {
    margin: 0;
}

/* Form niceties used by the listing form. */
.form-intro {
    color: var(--color-lightgray);
    margin-bottom: 2rem;
}
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Empty state box for "no listings yet" and similar zero-state screens. */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    border: 0.2rem dashed #e5e7eb;
    border-radius: 0.6rem;
    color: var(--color-lightgray);
}
.empty-state p {
    margin-bottom: 1.5rem;
}

/* Listing grid — responsive card grid for inventory. */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
    gap: 1.5rem;
}
.listing-card {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}
.listing-card:hover {
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-0.2rem);
}
.listing-card__image {
    aspect-ratio: 16 / 9;
    background: #f7fafc;
    overflow: hidden;
}
.listing-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.listing-card__image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-lightgray);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}
.listing-card__body {
    /* Two-section layout so the top (title + tags) stays glued to the
       image and the bottom (price through to quick-add) is bottom-aligned,
       giving every tile a consistent baseline regardless of how long the
       title or category list runs. */
    padding: 1.6rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.2rem;
    flex: 1 1 auto;
}
.listing-card__top,
.listing-card__bottom {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.listing-card__title {
    margin: 0;
    font-size: 1.8rem;
    color: var(--color-headings);
}
.listing-card__categories {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.category-pill {
    display: inline-block;
    padding: 0.1rem 0.8rem;
    border-radius: 999rem;
    font-size: 1.1rem;
    background: #e2e8f0;
    color: #2d3748;
}
.listing-card__price {
    margin: 0;
    font-size: 1.6rem;
}
.listing-card__qty,
.listing-card__date,
.listing-card__status {
    margin: 0;
    font-size: 1.3rem;
    color: var(--color-lightgray);
}

/* Category chip picker — typeahead + chips. Each chip is a removable
   pill backed by a hidden input[name="category_names[]"]. */
.category-picker {
    margin-bottom: 1.5rem;
}
.category-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 3.6rem;
    padding: 0.8rem;
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
    background: var(--color-white);
    margin-bottom: 0.6rem;
}
.category-picker__chips:empty::before {
    content: attr(data-empty-label, '');
    color: var(--color-lightgray);
    font-style: italic;
}
.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.2rem 0.2rem 0.8rem;
    background: #e2e8f0;
    color: #2d3748;
    border-radius: 999rem;
    font-size: 1.3rem;
    line-height: 1;
}
.category-chip__label {
    padding-right: 0.2rem;
}
.category-chip__remove {
    background: rgba(0, 0, 0, 0.08);
    color: #2d3748;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
    flex: 0 0 auto;
}
.category-chip__remove:hover,
.category-chip__remove:focus {
    background: #cbd5e0;
    color: #1a202c;
}
.category-picker__input-row {
    display: flex;
    gap: 0.6rem;
}
.category-picker__input-row input[type="text"] {
    flex: 1 1 auto;
    margin-bottom: 0;
}
.category-picker__input-row .button {
    flex: 0 0 auto;
    margin-bottom: 0;
}
.category-picker .help-block {
    display: block;
    margin-top: 0.4rem;
    color: var(--color-lightgray);
    font-size: 1.2rem;
}
.category-picker.error .category-picker__chips {
    border-color: var(--color-message-error-border);
}

/* Whole-card clickable listings. An absolute link stretches over the
   card; child <a>, <button>, <form> controls still receive clicks
   because they sit above the overlay (higher stacking). */
.listing-card {
    position: relative;
}
.listing-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
}
.listing-card__link:focus {
    outline: 0.2rem solid #bee3f8;
    outline-offset: -0.3rem;
    border-radius: inherit;
}
/* position:relative only — no z-index. A z-index would create a new
   stacking context and trap the quick-add form's z-index inside body,
   leaving it beneath the .listing-card__link overlay (z-index 1). */
.listing-card__body,
.listing-card__image {
    position: relative;
}

/* Quick add-to-cart lives inside the card body. It sits above the
   absolute link overlay (z-index 1) so the qty input + button are
   actually clickable, and uses flexbox to stack qty / Add button neatly.
   margin-top:auto pins it to the bottom of the card so the row lines
   up across tiles regardless of description length. */
.listing-card__quick-add {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin: 0.4rem 0 0;
    position: relative;
    z-index: 2;
}

/* "Update cart" variant — shared by the browse tile quick-add and the
   inventory detail page. Blue instead of primary green to signal the
   item is already in the cart and this button will modify, not add. */
.cart-update-button {
    background-color: var(--color-cakephp-blue);
    border-color: var(--color-cakephp-blue);
    color: #FFFFFF;
}
.cart-update-button:hover,
.cart-update-button:focus {
    background-color: var(--color-links-active);
    border-color: var(--color-links-active);
    color: #FFFFFF;
}
.listing-card__quick-add input[type="number"] {
    width: 5.5rem;
    height: 3.6rem;
    margin: 0;
    padding: 0 0.5rem;
    text-align: center;
    font-size: 1.4rem;
}
.listing-card__quick-add .button {
    flex: 1 1 auto;
    height: 3.6rem;
    line-height: 3.6rem;
    margin: 0;
    padding: 0 1rem;
    font-size: 1.3rem;
}
.listing-card--hidden {
    opacity: 0.65;
    filter: grayscale(0.2);
}

/* Inventory detail page */
.inventory-view__grid {
    align-items: start;
    gap: 2rem;
    margin-bottom: 2rem;
}
.inventory-view__image {
    aspect-ratio: 4 / 3;
    background: #f7fafc;
    border-radius: 0.6rem;
    overflow: hidden;
    border: 0.1rem solid #e5e7eb;
}
.inventory-view__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.inventory-view__icon-only {
    padding: 2rem;
    object-fit: contain !important;
    background: #f7fafc;
}
.inventory-view__image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-lightgray);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-size: 1.2rem;
}
.inventory-view__title {
    margin: 0 0 0.6rem;
    font-size: 2.6rem;
}
.inventory-view__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}
.inventory-view__price {
    font-size: 2.4rem;
    margin: 1.2rem 0 0.6rem;
}
.inventory-view__price strong {
    color: var(--color-cakephp-red);
    font-size: 3rem;
}
.inventory-view__unit {
    color: var(--color-lightgray);
    font-size: 1.6rem;
}
.inventory-view__facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1.2rem;
    margin: 1.2rem 0;
}
.inventory-view__facts dt {
    color: var(--color-lightgray);
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}
.inventory-view__facts dd {
    margin: 0;
}
.inventory-view__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}
.inventory-view__product {
    border-top: 0.1rem solid #e5e7eb;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}
.inventory-view__product h2 {
    margin-top: 0;
}
.muted {
    color: var(--color-lightgray);
    font-style: italic;
}

/* Edit form niceties */
.selected-product {
    margin: 0.5rem 0 1.5rem;
}
.selected-product__preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: #f7fafc;
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
}
.current-image {
    margin-bottom: 1rem;
}
.current-image__preview {
    display: block;
    max-width: 200px;
    height: auto;
    border-radius: 0.4rem;
    border: 0.1rem solid #e5e7eb;
}

/* Browse filter row — stacks on mobile, lays out side-by-side on desktop.
   Using padding-bottom (not margin-bottom) to guarantee the gap between
   the Search field and the browse grid / category sidebar beneath it. */
.browse-filter {
    padding-bottom: 1.5rem;
}
.browse-filter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.browse-filter__input {
    flex: 1 1 20rem;
}
.browse-filter__input label {
    /* Explicit line-height + a little bottom padding — Raleway renders
       with low-hanging descenders and the default tight line box was
       clipping the bottom of "Search". */
    line-height: 1.4;
    margin-bottom: 0.3rem;
    padding-bottom: 0.1rem;
}
.browse-filter__input .input {
    /* CakePHP's Form->control wraps the label+input in <div class="input">
       which carries a trailing margin. Strip it so the flex container can
       align the input bottom with the Search button without a 15px gap. */
    margin-bottom: 0;
}
.browse-filter__input input,
.browse-filter__input select {
    margin-bottom: 0;
    height: 3.8rem;
}
.browse-filter__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.browse-filter__actions .button {
    margin-bottom: 0;
    height: 3.8rem;
    line-height: 3.8rem;
    padding-top: 0;
    padding-bottom: 0;
}

/* Cart list */
.cart-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cart-item {
    display: grid;
    grid-template-columns: 8rem 1fr auto auto auto;
    /* Wider column gap so the Remove action doesn't crowd the price. */
    column-gap: 2.4rem;
    row-gap: 1.2rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-white);
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
}
.cart-item__actions {
    /* Extra left margin pulls Remove further away from the line total. */
    padding-left: 1rem;
}
.cart-item--unavailable {
    opacity: 0.7;
}
.cart-item__image {
    width: 8rem;
    height: 8rem;
    background: #f7fafc;
    border-radius: 0.4rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cart-item__image-placeholder {
    font-size: 1rem;
    color: var(--color-lightgray);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}
.cart-item__title {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
}
.cart-item__seller,
.cart-item__origin {
    margin: 0;
    color: var(--color-lightgray);
    font-size: 1.3rem;
}
.cart-item__warning {
    margin: 0;
    color: var(--color-message-warning-text);
    font-size: 1.3rem;
    font-weight: 600;
}
.cart-item__label {
    display: block;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--color-lightgray);
    letter-spacing: 0.05rem;
    margin-bottom: 0.2rem;
}
.cart-item__price {
    text-align: right;
}
.cart-item__qty {
    /* Left-aligned so the "Quantity" label lands above the input, not
       drifting over to sit above the Update button. */
    text-align: left;
}
.cart-item__unit-price {
    display: block;
    font-size: 1.2rem;
    color: var(--color-lightgray);
}

/* Cart collapses to two columns on narrow screens: image + body stacked
   over quantity / price / remove. */
@media screen and (max-width: 47.99rem) {
    .cart-item {
        grid-template-columns: 6rem 1fr;
        grid-template-areas:
            "img body"
            "img qty"
            "img price"
            "actions actions";
    }
    .cart-item__image { grid-area: img; width: 6rem; height: 6rem; }
    .cart-item__body { grid-area: body; }
    .cart-item__qty { grid-area: qty; text-align: left; }
    .cart-item__price { grid-area: price; text-align: left; }
    .cart-item__actions { grid-area: actions; }
}

.cart-summary {
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 0.4rem;
    border: 0.1rem solid #e5e7eb;
}
.cart-summary__line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.8rem;
    margin: 0 0 0.4rem;
}
.cart-summary__line strong {
    font-size: 2.4rem;
    color: var(--color-cakephp-red);
}
.cart-summary__muted {
    margin: 0;
    color: var(--color-lightgray);
    font-size: 1.3rem;
}

.cart__back-link {
    font-weight: 600;
}

/* Small notice above the quantity form when the listing is already in
   the viewer's cart — signals the button will update, not add. */
.inventory-view__in-cart {
    margin: 0 0 0.6rem;
    padding: 0.5rem 0.8rem;
    background: var(--color-message-info-bg);
    border: 0.1rem solid var(--color-message-info-border);
    color: var(--color-message-info-text);
    border-radius: 0.4rem;
    font-size: 1.3rem;
}

/* Add-to-cart form on the inventory view page — small inline form. */
.add-to-cart-form {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 0;
}
.add-to-cart-form .input {
    margin-bottom: 0;
    max-width: 10rem;
}
.add-to-cart-form .input input {
    margin-bottom: 0;
}
.add-to-cart-form .button {
    margin-bottom: 0;
}

/* Cart row qty: read-only display + an "Update" button that opens the
   modal. The inline form was retired so accidental edits aren't possible. */
.cart-item__qty-value {
    display: inline-block;
    margin-right: 0.6rem;
    font-weight: 600;
}
.cart-item__qty-unit {
    color: var(--color-lightgray);
    font-size: 1.3rem;
}
.cart-item__qty-submit.button {
    margin-bottom: 0;
    height: auto;
    line-height: normal;
    padding: 0.4rem 0.8rem;
    font-size: 1.1rem;
}

/* Cart "Update quantity" modal — native <dialog>. Clicking outside or
   pressing Esc shake the modal and surface a warning, per client
   request that the user must explicitly Confirm or Cancel. */
/* Shared confirm-dialog shell. Used by both .cart-update-modal and
   .order-cancel-modal so they look identical. Per-feature extras
   (the cart quantity input + shake-on-misclick stripe) live on
   .cart-update-modal additively. */
.confirm-modal,
.cart-update-modal,
.order-cancel-modal {
    border: 0;
    border-radius: 0.6rem;
    padding: 0;
    max-width: 32rem;
    width: 90vw;
    box-shadow: 0 1.6rem 4rem rgba(0, 0, 0, 0.25);
}
.confirm-modal::backdrop,
.cart-update-modal::backdrop,
.order-cancel-modal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
.confirm-modal__form,
.cart-update-modal__form,
.order-cancel-modal__form {
    padding: 1.6rem 1.8rem;
    margin: 0;
}
.confirm-modal__title,
.cart-update-modal__title,
.order-cancel-modal__title {
    margin: 0 0 1rem;
    font-size: 1.7rem;
}
.confirm-modal__body,
.order-cancel-modal__body {
    margin: 0 0 1.4rem;
    line-height: 1.5;
}
.confirm-modal__actions,
.cart-update-modal__actions,
.order-cancel-modal__actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}
.confirm-modal__actions .button,
.cart-update-modal__actions .button,
.order-cancel-modal__actions .button {
    margin: 0;
}

/* Cart-update extras (number input + shake-on-misclick) — additive
   on top of the shared shell. */
.cart-update-modal__field {
    display: block;
    margin-bottom: 0.6rem;
}
.cart-update-modal__field input {
    margin: 0.4rem 0 0;
    width: 100%;
}
.cart-update-modal__hint {
    color: var(--color-lightgray);
    font-size: 1.2rem;
    margin: 0 0 1.2rem;
}
/* Always rendered so toggling visibility doesn't bump the modal's
   height. opacity+visibility keep it out of view (and inert for screen
   readers) until the user tries to dismiss without picking an action. */
.cart-update-modal__warn {
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    border-radius: 0.3rem;
    font-size: 1.3rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-out;
}
.cart-update-modal__warn.is-visible {
    opacity: 1;
    visibility: visible;
}
@keyframes cart-update-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-1.2rem); }
    40%      { transform: translateX(1.2rem); }
    60%      { transform: translateX(-0.8rem); }
    80%      { transform: translateX(0.8rem); }
}
.cart-update-modal.is-shake {
    animation: cart-update-shake 0.4s ease-in-out;
    /* outline (not border) so the red ring doesn't bump the modal's
       layout size on each shake. */
    outline: 0.2rem solid var(--color-message-error-border);
    outline-offset: -0.2rem;
}

/* .order-cancel-modal styling lives in the shared shell block above. */

/* Revenue summary — preset chip row, custom date form, big total. */
.revenue-range {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    align-items: end;
    margin-bottom: 1.6rem;
}
.revenue-presets {
    display: flex;
    gap: 0.4rem;
}
.revenue-preset {
    text-decoration: none;
}
.revenue-preset.is-active {
    background: var(--color-primary, #4caf94);
    color: #fff;
    border-color: var(--color-primary, #4caf94);
}
.revenue-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: end;
}
.revenue-custom label {
    display: flex;
    flex-direction: column;
    font-size: 1.2rem;
    margin: 0;
}
.revenue-custom input[type="date"] {
    margin: 0;
}
.revenue-range__caption {
    flex-basis: 100%;
    margin: 0;
}
.revenue-total {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.revenue-total__label {
    font-size: 1.4rem;
    color: var(--color-lightgray, #888);
}
.revenue-total__value {
    font-size: 3.2rem;
    font-weight: 700;
}

/* T5.1.3 stock editor + Out-of-Stock label. */
.stock-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin: 0.6rem 0;
}
.stock-editor__input {
    width: 7rem;
    margin: 0;
}
.stock-editor__save {
    margin: 0;
}
.stock-editor__status {
    font-size: 1.2rem;
    color: var(--color-lightgray, #888);
    min-width: 6rem;
}
.stock-editor__oos,
.inventory-stock__oos {
    display: inline-block;
    background: #c53030;
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 0.3rem;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Category navigation — collapsible tree sidebar (T1.1.1 rev).
   Desktop (>=48rem): two-column layout — tree sidebar on the left,
                      listings grid on the right. FAB + mobile drawer
                      chrome hidden.
   Mobile (<48rem):   same tree rendered inside an off-canvas drawer
                      triggered by a FAB in the bottom-right corner. */

.browse-layout {
    display: grid;
    grid-template-columns: 24rem 1fr;
    gap: 2rem;
    align-items: start;
}

.category-nav-toggle,
.category-nav-backdrop,
.category-nav__header {
    display: none;
}
.category-nav-toggle__icon {
    font-size: 1.6rem;
    line-height: 1;
}
.category-nav__close {
    background: none;
    border: none;
    font-size: 2.4rem;
    line-height: 1;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--color-cakephp-gray);
    letter-spacing: 0;
    text-transform: none;
    height: auto;
}

/* Tree sidebar container */
.category-nav {
    padding: 1.2rem 1rem;
    background: var(--color-white);
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}
.category-nav__heading {
    margin: 0 0 0.6rem;
    font-size: 1.3rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--color-lightgray);
    padding: 0 0.6rem 0.15rem;
}

/* The tree itself */
.category-tree__root,
.category-tree__children {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-tree__children {
    margin-left: 2rem;
    padding: 0.2rem 0 0.4rem;
    border-left: 0.1rem solid #e5e7eb;
}
.category-tree__item {
    margin: 0;
}
.category-tree__row {
    display: flex;
    align-items: stretch;
    gap: 0.1rem;
    border-radius: 0.4rem;
}
.category-tree__row:hover {
    background: #f7fafc;
}
.category-tree__toggle {
    background: none;
    border: none;
    padding: 0.2rem 0.5rem;
    margin: 0;
    color: var(--color-lightgray);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
}
.category-tree__toggle--stub {
    cursor: default;
    pointer-events: none;
}
.category-tree__toggle:hover,
.category-tree__toggle:focus {
    background: none;
    color: var(--color-cakephp-gray);
}
.category-tree__caret {
    display: inline-block;
    transition: transform 0.15s ease;
}
.category-tree__label,
.category-tree__product-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex: 1 1 auto;
    padding: 0.5rem 0.8rem;
    color: var(--color-cakephp-gray);
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.4rem;
}
.category-tree__product-link {
    font-weight: 400;
    font-size: 1.3rem;
    padding: 0.4rem 0.8rem;
}
.category-tree__label:hover,
.category-tree__label:focus,
.category-tree__product-link:hover,
.category-tree__product-link:focus {
    color: var(--color-cakephp-red);
    text-decoration: none;
}
.category-tree__item.is-active > .category-tree__row > .category-tree__label,
.category-tree__product.is-active > .category-tree__product-link {
    background: var(--color-cakephp-red);
    color: var(--color-white);
}
.category-tree__item.is-active > .category-tree__row > .category-tree__label .category-tree__count,
.category-tree__product.is-active > .category-tree__product-link .category-tree__count {
    background: rgba(255, 255, 255, 0.25);
}
.category-tree__label--disabled,
.category-tree__product-link--disabled {
    color: var(--color-lightgray);
    opacity: 0.55;
    cursor: not-allowed;
}
.category-tree__count {
    display: inline-block;
    min-width: 1.8rem;
    padding: 0 0.4rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    border-radius: 999rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.8rem;
}
.category-tree__item--all .category-tree__label {
    padding-left: 0.8rem;
}

/* Mobile: tree collapses into an off-canvas drawer triggered by a FAB. */
@media screen and (max-width: 47.99rem) {
    .browse-layout {
        display: block;
    }
    .category-nav-toggle {
        display: inline-flex;
        position: fixed;
        right: max(1.5rem, env(safe-area-inset-right, 1.5rem));
        bottom: max(2rem, calc(env(safe-area-inset-bottom, 1rem) + 1.5rem));
        z-index: 95;
        width: 5.6rem;
        height: 5.6rem;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: var(--color-cakephp-red);
        color: var(--color-white);
        box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.25);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .category-nav-toggle:hover,
    .category-nav-toggle:focus {
        background: var(--color-cakephp-red);
        color: var(--color-white);
        transform: translateY(-0.2rem);
        box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.3);
    }
    .category-nav-toggle__icon {
        font-size: 2.2rem;
    }
    .inventories.index .content,
    body > .container {
        padding-bottom: 9rem;
    }
    .category-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 24, 40, 0);
        z-index: 90;
        transition: background 0.2s ease;
        pointer-events: none;
    }
    .category-nav-backdrop.is-visible {
        background: rgba(16, 24, 40, 0.45);
        pointer-events: auto;
    }
    .category-nav {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        width: min(32rem, 86vw);
        margin: 0;
        padding: 1.5rem;
        background: var(--color-white);
        box-shadow: 0.2rem 0 1.2rem rgba(0, 0, 0, 0.15);
        z-index: 100;
        overflow-y: auto;
        transition: left 0.25s ease;
        max-height: none;
    }
    .category-nav.is-open {
        left: 0;
    }
    .category-nav__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
        border-bottom: 0.1rem solid #e5e7eb;
    }
    .category-nav__header .category-nav__heading {
        margin: 0;
    }
    body.drawer-open {
        overflow: hidden;
    }
}

/* Mobile navbar — tighter spacing, smaller text so all the links fit
   without dominating the viewport. */
@media screen and (max-width: 47.99rem) {
    .top-navi {
        padding: 0.6rem 1rem;
    }
    .top-nav-links {
        gap: 0.4rem 0.8rem;
        margin-right: 0;
        font-size: 1.3rem;
    }
    .top-nav-links a {
        white-space: nowrap;
    }
}



.login-center-form, .forgot-password{
    margin-left: 60px;
    margin-right: 60px;
}
footer{
    background-color: #dddddd;
}
.foot{
    width: 100%;
    height: 200px;
    padding: 30px 5%;
    display: flex;
}
.footer-block{
    display: flex;
    flex-direction: column;
}
.footer-title{
    color: #2c3033;
    font-weight: 600;
    font-size: 1.6rem;
    margin: 0 0 0.75rem;
}
.footer-links-1{
    /* Dark slate: ~6.7:1 on #dddddd, comfortably AA. */
    color: #2e4057;
}
.footer-links-1:hover,
.footer-links-1:focus {
    color: #13213a;
    text-decoration: underline;
}
.social-media {
    display: flex;
    margin-left: auto;
    flex-direction: column;
}
.follow-us-on {
    height: 100px;
    max-width: 50%;
}

.follow-us-on-facebook {
    height: 110px;
    max-width: 50%;
}
.footer-instagram {
    height: 70px;
    max-width: 50%;
}
.footer-facebook {
    height: 77px;
    max-width: 50%;
}

/* Admin review lists (pending products / pending categories). */
.review-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.review-item {
    padding: 1.5rem;
    background: var(--color-white);
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.4rem;
}
.review-item__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.review-item__title {
    margin: 0;
    font-size: 1.8rem;
}
.review-item__meta {
    font-size: 1.3rem;
    color: var(--color-lightgray);
}
.review-item__description {
    color: var(--color-cakephp-gray);
    margin: 0.4rem 0 1rem;
}
.review-item__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.1rem solid #f1f3f5;
}
.review-item__merge-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}
.review-item__merge-form label {
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
    color: var(--color-lightgray);
}
.review-item__merge-form .input {
    margin: 0;
}
.review-item__merge-form select {
    margin-bottom: 0;
    min-width: 18rem;
}
.review-item__merge-form .button {
    margin-bottom: 0;
}

/* Branded 4xx / 5xx page. Wraps .page-header + .empty-state to show a
   human-readable message + two recovery actions; the HTTP status code
   lives in .error-page__code as subtle meta. */
.error-page {
    max-width: 60rem;
    margin: 2rem auto;
}
.error-page__code {
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.2rem;
}
.error-page__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.error-page__actions .button {
    margin-bottom: 0;
}

/* Shown in place of the Add to cart form on an inventory detail page
   when the viewer is unauthenticated. Reuses button styles. */
.sign-in-prompt {
    border: 0.1rem solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 1.25rem 1.5rem;
    background: #fafafa;
}
.sign-in-prompt p {
    margin: 0 0 1rem;
    font-weight: 600;
}
.sign-in-prompt__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.sign-in-prompt__actions .button {
    margin-bottom: 0;
}

/* Contact / enquiry form. */
.enquiry-row {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}
.enquiry-intro {
    font-size: 1.5rem;
    line-height: 1.5;
    color: var(--color-headings);
    max-width: 54rem;
    margin: 0 0 1rem;
}
.enquiry-required-note {
    font-size: 1.3rem;
    color: var(--color-lightgray);
    margin: 0 0 1.5rem;
}
.enquiry-form label .required-mark,
.required-mark {
    color: #cc1f1a;
    font-weight: 700;
    margin-left: 0.15rem;
}
.enquiry-counter {
    font-size: 1.2rem;
    color: var(--color-lightgray);
    text-align: right;
    margin: -0.5rem 0 1.5rem;
}
.enquiry-counter.is-near-limit {
    color: #8d7b00;
}

/* =============================================================
   Admin theme — applied to <body> when the viewer is an admin or
   when ?admin=true is on the URL (login preview). Repaints the
   green brand chrome blue so the staff console is visually
   distinct from the customer marketplace.
   ============================================================= */
.theme--admin {
    /* Overriding the misnamed --color-cakephp-red (which is actually
       our brand green) flips every button + accent at the source. */
    --color-cakephp-red: #2f85ae;
}
.theme--admin .top-navi {
    background-color: #2f85ae;
}
.theme--admin .top-nav-links a.nav-cta {
    color: #1d4f6a;
}
.theme--admin .top-nav-links a.nav-cta:hover,
.theme--admin .top-nav-links a.nav-cta:focus {
    background-color: #e8f1f7;
    color: #14384a;
}
.theme--admin .cart-summary__line strong {
    color: #2f85ae;
}
.theme--admin .button.button-primary {
    background-color: #2f85ae;
    border-color: #2f85ae;
}
.theme--admin .button.button-primary:hover,
.theme--admin .button.button-primary:focus {
    background-color: #246a8e;
    border-color: #246a8e;
}
.theme--admin .card {
    background-color: #eaf2f8;
}

/* Admin-login footer link sits below the regular nav and reads as a
   subdued staff entry-point, not a featured action. */
.footer-links-1--admin {
    margin-top: 0.4rem;
    font-style: italic;
    opacity: 0.85;
}

/* Login page banner shown when ?admin=true. */
.login-admin-banner {
    background: #e8f1f7;
    border-left: 0.4rem solid #2f85ae;
    padding: 1rem 1.2rem;
    border-radius: 0.4rem;
    margin-bottom: 1.5rem;
    color: #1d4f6a;
}
.login-admin-banner strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.4rem;
}
.login-admin-banner p {
    margin: 0;
    font-size: 1.3rem;
}

/* =============================================================
   Manufacturer theme — applied to <body> when the viewer is a manufacturer
   Repaints the green brand purple so the manufacturer console
   is visually distinct from the customer marketplace.
   ============================================================= */
.theme--manufacturer {
    --color-cakephp-red: #6d28d9;
}

.theme--manufacturer .top-navi {
    background-color: #6d28d9;
}

.theme--manufacturer .top-nav-links a.nav-cta {
    color: #3b0764;
}

.theme--manufacturer .top-nav-links a.nav-cta:hover,
.theme--manufacturer .top-nav-links a.nav-cta:focus {
    background-color: #f3e8ff;
    color: #2e1065;
}

.theme--manufacturer .cart-summary__line strong {
    color: #6d28d9;
}

.theme--manufacturer .button.button-primary {
    background-color: #6d28d9;
    border-color: #6d28d9;
}

.theme--manufacturer .button.button-primary:hover,
.theme--manufacturer .button.button-primary:focus {
    background-color: #4c1d95;
    border-color: #4c1d95;
}

.theme--manufacturer .card {
    background-color: #ede9fe;
}

/* =============================================================
   Farmer theme — applied to <body> when the viewer is a farmer
   Repaints the green brand brown so the farmer
   console is visually distinct from the customer marketplace.
   ============================================================= */
.theme--farmer {
    --color-cakephp-red: #8d6e63;
}
.theme--farmer .top-navi {
    background-color: #6d4c41;
}
.theme--farmer .top-nav-links a.nav-cta {
    color: #3e2723;
}
.theme--farmer .top-nav-links a.nav-cta:hover,
.theme--farmer .top-nav-links a.nav-cta:focus {
    background-color: #efebe9;
    color: #2d1b16;
}
.theme--farmer .cart-summary__line strong {
    color: #6d4c41;
}
.theme--farmer .button.button-primary {
    background-color: #6d4c41;
    border-color: #6d4c41;
}
.theme--farmer .button.button-primary:hover,
.theme--farmer .button.button-primary:focus {
    background-color: #4e342e;
    border-color: #4e342e;
}
.theme--farmer .card {
    background-color: #f5f5f5;
}

/* =============================================================
   Seller theme — applied to <body> when the viewer is a seller
   Repaints the green brand orange so the seller
   console is visually distinct from the customer marketplace.
   ============================================================= */
.theme--seller {
    --color-cakephp-red: #ef6c00;
}
.theme--seller .top-navi {
    background-color: #ef6c00;
}
.theme--seller .top-nav-links a.nav-cta {
    color: #5a2d00;
}
.theme--seller .top-nav-links a.nav-cta:hover,
.theme--seller .top-nav-links a.nav-cta:focus {
    background-color: #fff3e0;
    color: #3d1f00;
}
.theme--seller .cart-summary__line strong {
    color: #ef6c00;
}
.theme--seller .button.button-primary {
    background-color: #ef6c00;
    border-color: #ef6c00;
}
.theme--seller .button.button-primary:hover,
.theme--seller .button.button-primary:focus {
    background-color: #e65100;
    border-color: #e65100;
}
.theme--seller .card {
    background-color: #ffe0b2;
}

/* Each certificate in 'My Certifications' is a clickable card */
.certificate-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.certificate-card-link:hover .listing-card {
    transform: translateY(-2px);
    transition: 0.2s ease;
    cursor: pointer;
}
.certificate-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999rem;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.8rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    border: 0.1rem solid transparent;
    color: #1a202c;
    background: #edf2f7;
}
.certificate-status--pending     { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.certificate-status--withdrawn   { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.certificate-status--approved    { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.certificate-status--rejected    { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.certificate-status--expired     { background: #b00020; color: white;   border-color: #b00020; opacity: 0.75; }
.listing-card--expired { opacity: 0.8; border: 1px solid #b00020; }

/* Nav "My Account" dropdown — uses native <details>/<summary> so it
   works without JS. Desktop renders the menu as a floating popover
   beneath the summary; mobile (inside the burger drawer) lets it
   expand inline as an indented sub-list. */
.nav-dropdown {
    position: relative;
    color: #FFFFFF;
}
.nav-dropdown > summary {
    list-style: none;          /* hide default disclosure triangle */
    cursor: pointer;
    user-select: none;
    color: inherit;
}
.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}
.nav-dropdown > summary::after {
    content: " ▾";
    font-size: 0.85em;
    opacity: 0.7;
}
.nav-dropdown[open] > summary::after {
    content: " ▴";
}
.nav-dropdown__menu {
    display: flex;
    flex-direction: column;
    min-width: 18rem;
}
.nav-dropdown__menu a {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

/* Desktop: float the menu under the trigger as a popover card. */
@media (min-width: 50.01rem) {
    .nav-dropdown[open] .nav-dropdown__menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        color: #1a202c;
        border: 0.1rem solid #e5e7eb;
        border-radius: 0.4rem;
        box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.12);
        padding: 0.4rem 0;
        margin-top: 0.4rem;
        z-index: 50;
    }
    .nav-dropdown__menu a:hover,
    .nav-dropdown__menu a:focus {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* ============================================================
 * Mobile responsiveness for forms + tables + admin layouts.
 *
 * Milligram stacks .row -> .column at <40em (640px), which leaves
 * tablets and small phones in landscape (640-768px) with squashed
 * multi-column form rows where selects shrink to microscopic widths.
 * Bump the stack breakpoint to 48em so 2-3 column form rows wrap to
 * a single column on those devices.
 * ============================================================ */

@media (max-width: 47.99rem) {
    /* Force every Milligram row to stack — selects + inputs become
       full-width and readable on phones / small tablets. */
    .row {
        flex-direction: column !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
    .row .column {
        margin-bottom: 1.5rem;
        padding: 0 !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    /* Form controls take the full column width and have a touch-friendly
       height. Larger font keeps placeholder + selected text legible. */
    .row .column select,
    .row .column input,
    .row .column textarea,
    fieldset select,
    fieldset input,
    fieldset textarea {
        width: 100%;
        min-height: 4rem;
        font-size: 1.6rem;
    }

    /* Wide admin/order tables fall back to horizontal scroll instead
       of breaking the page layout. Cell padding tightens so a row
       still mostly fits before the scrollbar kicks in. */
    .orders-table,
    .orders-audit-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .orders-table th,
    .orders-table td,
    .orders-audit-table th,
    .orders-audit-table td {
        padding: 0.8rem 0.6rem;
    }

    /* Revenue summary: presets + custom date form stack and use the
       full row width on mobile. */
    .revenue-range {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    .revenue-presets {
        flex-wrap: wrap;
    }
    .revenue-custom {
        flex-direction: column;
        align-items: stretch;
    }
    .revenue-custom label {
        width: 100%;
    }

    /* Cart + checkout modals: full-width with reduced padding. */
    .cart-update-modal,
    .order-cancel-modal {
        width: 95vw;
        max-width: 95vw;
    }
    .cart-update-modal__form,
    .order-cancel-modal__form {
        padding: 1.2rem 1.4rem;
    }

    /* Stock editor sits in one row on desktop; on mobile, wrap so the
       Save button + status text don't overflow. */
    .stock-editor {
        flex-direction: column;
        align-items: stretch;
    }
    .stock-editor__input {
        width: 100%;
    }

    /* Buttons in row groups (e.g. modal actions, order detail header)
       should stack and stretch on narrow screens. */
    .button {
        margin-right: 0;
    }
}
