/* Isithwalambiza — basic site styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2933;
    line-height: 1.6;
    background: #f7f8fa;
}

/* Header + navigation */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #008000;
    color: #fff;
}

.brand a {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: inline-block;
}

.brand-logo {
    height: 44px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.main-nav {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-left {
    margin-left: 1.5rem;
}

.main-nav a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    color: #d1fae5;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.main-nav a.active {
    background: #fff;
    color: #008000;
    font-weight: 600;
}

.search-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.5rem;
    background: #eef1f4;
    border-bottom: 1px solid #e4e7eb;
}

.search-form {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    overflow: hidden;
}

.search-input {
    border: none;
    outline: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 240px;
    max-width: 60vw;
    color: #1f2933;
}

.search-btn {
    margin: 0;
    padding: 0 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #008000;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.search-btn:hover {
    background: #006600;
}

.menu-right a {
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-icon {
    flex-shrink: 0;
    vertical-align: middle;
}

/* Logged-in account dropdown (name shown, menu on hover/focus) */
.nav-dropdown {
    position: relative;
}

.nav-caret {
    font-size: 0.7em;
    line-height: 1;
    transition: transform 0.15s ease;
}

/* Scoped under .main-nav so these beat the `.main-nav ul { display:flex }`
   base rule (which is more specific than a bare .nav-dropdown-menu). */
.main-nav .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 12rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 0.35rem;
    z-index: 50;
    /* .main-nav ul sets these; reset so items stack vertically. */
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
}

/* Reveal on hover or keyboard focus within the item (desktop), or when
   toggled open via JS/tap (mobile). */
.main-nav .nav-dropdown:hover .nav-dropdown-menu,
.main-nav .nav-dropdown:focus-within .nav-dropdown-menu,
.main-nav .nav-dropdown.open .nav-dropdown-menu {
    display: flex;
}

/* Invisible "hover bridge" spanning the gap between the toggle and the menu
   (the menu's margin-top). Without it, moving the mouse down into that gap
   leaves both the toggle and menu un-hovered, so the menu closes before it can
   be reached. It only exists while the dropdown is open, so it never blocks
   interaction with anything below the header at rest. */
.main-nav .nav-dropdown:hover::after,
.main-nav .nav-dropdown:focus-within::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    height: 0.5rem;
    min-width: 12rem; /* match the menu width so diagonal moves stay covered */
}

.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown:focus-within .nav-dropdown-toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Menu items look like a list, not the bordered nav pills. */
.nav-dropdown-menu a {
    display: block;
    border: none;
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    color: #1f2933;
}

.nav-dropdown-menu a:hover {
    background: #eef1f4;
    color: #008000;
}

/* Main content */
.site-main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.site-main h1 {
    margin-top: 0;
    color: #008000;
}

.card {
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Forms */
form label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
}

.form-error {
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #a12622;
}

form input,
form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1rem;
}

button,
.btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.4rem;
    background: #008000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: #006600;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.product-grid .card {
    margin-bottom: 0;
}

/* Product card with image area */
.product-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 200px;
    /* Don't let the flex column squash the image area on tall cards. */
    flex-shrink: 0;
    background: repeating-linear-gradient(
        45deg,
        #e4e7eb,
        #e4e7eb 20px,
        #eef1f4 20px,
        #eef1f4 40px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    /* Fill the fixed box and crop overflow so every card matches, whatever
       the source image's dimensions or aspect ratio. */
    object-fit: cover;
    display: block;
}

.product-image-placeholder {
    color: #52606d;
    font-size: 0.9rem;
    font-weight: 600;
}

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

.product-body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.product-body p {
    margin: 0 0 0.5rem;
}

/* Push the button to the bottom so cards align neatly. */
.product-body .btn {
    margin-top: auto;
    align-self: flex-start;
}

.price {
    font-weight: 700;
    color: #008000;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: 1.5rem 0 0.5rem;
}

.page-link {
    display: inline-block;
    min-width: 2.25rem;
    padding: 0.4rem 0.7rem;
    text-align: center;
    text-decoration: none;
    color: #52606d;
    background: #fff;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
}

.page-link:hover {
    background: #f5f7fa;
}

.page-link.active {
    color: #fff;
    background: #008000;
    border-color: #008000;
    font-weight: 700;
}

.page-link.disabled {
    color: #9aa5b1;
    background: #f5f7fa;
    cursor: default;
}

/* Carousel */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #e4e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(
        45deg,
        #e4e7eb,
        #e4e7eb 20px,
        #eef1f4 20px,
        #eef1f4 40px
    );
    color: #52606d;
    font-size: 1.1rem;
    font-weight: 600;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 128, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.carousel-btn:hover {
    background: rgba(0, 128, 0, 0.9);
}

.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.carousel-dot {
    width: 11px;
    height: 11px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.carousel-dot.active {
    background: #fff;
}

/* Basket count badge */
.basket-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #fff;
    color: #008000;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Basket table */
.basket-table {
    width: 100%;
    border-collapse: collapse;
}

.basket-table th,
.basket-table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e4e7eb;
}

.basket-table th {
    color: #52606d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.basket-total-label {
    text-align: right;
    color: #52606d;
}

.basket-total {
    color: #008000;
}

.link-btn {
    margin: 0;
    padding: 0.3rem 0.6rem;
    background: none;
    color: #b91c1c;
    font-size: 0.9rem;
    border: 1px solid #f0caca;
    border-radius: 6px;
}

.link-btn:hover {
    background: #fdecec;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    margin: 0;
    padding: 0;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 1.1rem;
    color: #52606d;
    background: #f5f7fa;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    cursor: pointer;
}

.qty-btn:hover {
    background: #e4e7eb;
}

.qty-value {
    min-width: 1.5rem;
    text-align: center;
}

.basket-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Normalise the buttons' default top margin so the plain buttons and the
   form-wrapped Checkout button all sit on the same baseline. */
.basket-actions .btn {
    margin-top: 0;
}

/* The Checkout form is a plain wrapper; strip its margins and push it to the
   far right of the action row. */
.basket-actions .checkout-form {
    margin: 0 0 0 auto;
}

.btn-secondary {
    background: #52606d;
}

.btn-secondary:hover {
    background: #3e4c59;
}

/* Toast notifications (top right) */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 240px;
    max-width: 340px;
    padding: 0.8rem 1rem;
    background: #008000;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    font-size: 0.95rem;
    opacity: 0;
    transform: translateX(120%);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: #7b8794;
    border-top: 1px solid #e4e7eb;
    font-size: 0.9rem;
}

/* Responsive header — stack and wrap on small screens.
   Placed at the end so these rules win over the base styles above. */
@media (max-width: 720px) {
    .site-header {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .menu-left {
        margin-left: 0;
    }

    /* No hover on touch: the menu is collapsed and tapping the name toggles
       it open (see js/nav.js). When open it stacks inline below the name. */
    .nav-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
    }

    .main-nav .nav-dropdown-menu {
        position: static;
        margin-top: 0.15rem;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    /* The desktop hover bridge isn't needed here (menu is tap-toggled and
       stacks inline); suppress it so it can't overlap the stacked items. */
    .main-nav .nav-dropdown:hover::after,
    .main-nav .nav-dropdown:focus-within::after {
        display: none;
    }

    .nav-dropdown-menu a {
        color: #d1fae5;
    }

    .nav-dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    /* Caret becomes an open/close indicator on touch. */
    .nav-dropdown.open .nav-caret {
        transform: rotate(180deg);
    }

    .search-bar {
        justify-content: center;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        flex: 1;
        width: auto;
        max-width: none;
    }

    /* Basket: stack the table into rows so nothing overflows the card. */
    .basket-table thead {
        display: none;
    }

    .basket-table,
    .basket-table tbody,
    .basket-table tfoot,
    .basket-table tr,
    .basket-table td {
        display: block;
        width: 100%;
    }

    .basket-table tr {
        border: 1px solid #e4e7eb;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 1rem;
    }

    .basket-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        border: none;
        padding: 0.4rem 0;
    }

    /* Show the column name before each value. */
    .basket-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #52606d;
    }

    .basket-remove-cell {
        justify-content: flex-end;
    }

    .basket-remove-cell .link-btn {
        width: 100%;
        text-align: center;
    }

    /* Grand-total row (tfoot): hide the label + empty cells, show the total
       with its own label via ::before. */
    .basket-table tfoot td:first-child,
    .basket-table tfoot td:last-child {
        display: none;
    }

    .basket-total::before {
        content: 'Grand Total';
        font-weight: 600;
        color: #52606d;
    }
}

/* Account / orders */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid #e4e7eb;
    margin: 1rem 0;
}

.tabs .tab {
    padding: 0.6rem 1.1rem;
    color: #52606d;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.tabs .tab:hover {
    background: #eef1f4;
}

.tabs .tab.active {
    color: #008000;
    border-bottom-color: #008000;
}

.order-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.order-filter label {
    margin: 0;
    font-weight: 600;
}

.order-filter select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

.order-customer {
    display: block;
    color: #3e4c59;
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

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

/* Order list as a grid of compact cards (mirrors the product grid). */
.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.order-summary {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    color: #1f2933;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.order-summary:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.order-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.order-summary-date,
.order-summary-customer {
    color: #52606d;
    font-size: 0.9rem;
}

.order-summary-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e4e7eb;
}

.order-summary-total {
    font-weight: 700;
    color: #008000;
}

.order-summary-view {
    color: #008000;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ---- Order export: selection toolbar + per-card checkbox ---- */
.export-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f5f7fa;
    border: 1px solid #e4e7eb;
    border-radius: 8px;
}

.export-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;              /* cancel the global `form label` block margins */
    font-weight: 600;
    white-space: nowrap;    /* keep "Select all on this page" on one line */
    cursor: pointer;
}

/* The global `form input` rule forces width:100% + padding + border, which
   turns these checkboxes into full-width boxes. Reset them to real checkboxes. */
.export-select-all input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    flex: none;
}

.export-count {
    color: #52606d;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Push the Export button to the far right of the toolbar. */
.export-bar .btn {
    margin-top: 0;
    margin-left: auto;
}

.export-bar .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #52606d;
}

.order-select-wrap {
    position: relative;
    display: flex;
}

.order-select-wrap > .order-summary {
    flex: 1;
}

.order-select-cb {
    position: absolute;
    top: 1.15rem;
    left: 1.1rem;
    width: 1.15rem;
    height: 1.15rem;
    /* Undo the global `form input` box styling so this renders as a checkbox. */
    margin: 0;
    padding: 0;
    border: none;
    z-index: 2;
    cursor: pointer;
}

/* Reserve room so the checkbox never sits on top of the order number. */
.order-select-wrap .order-summary-top {
    padding-left: 1.75rem;
}

/* Highlight a selected card (progressive enhancement; cosmetic only). */
.order-select-wrap:has(.order-select-cb:checked) > .order-summary {
    box-shadow: 0 0 0 2px #008000;
}

/* Order edit form */
.form-notice {
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #e7f6ec;
    border: 1px solid #b7e4c7;
    border-radius: 6px;
    color: #1b6b3a;
}

/* Color-coded status radios (reuse the order-status badge palette). */
.status-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.status-fieldset legend {
    padding: 0;
    font-weight: 600;
}

.status-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.status-option {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

/* Visually hide the native radio but keep it focusable/accessible. */
.status-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}

/* Highlight the selected option. */
.status-option:has(input:checked) {
    opacity: 1;
    border-color: currentColor;
}

.status-option:hover {
    opacity: 0.85;
}

.status-option:has(input:focus-visible) {
    outline: 2px solid #1f2933;
    outline-offset: 2px;
}

/* Same palette as the .order-status badges. */
.status-option.status-1 { background: #fef3c7; color: #92600a; }
.status-option.status-2 { background: #dbeafe; color: #1e40af; }
.status-option.status-3 { background: #d1fae5; color: #065f46; }
.status-option.status-4 { background: #fde2e1; color: #a12622; }

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.order-date {
    display: block;
    color: #52606d;
    font-size: 0.9rem;
}

.order-status {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #e4e7eb;
    color: #3e4c59;
}

.order-status.status-1 { background: #fef3c7; color: #92600a; } /* Pending */
.order-status.status-2 { background: #dbeafe; color: #1e40af; } /* Confirmed */
.order-status.status-3 { background: #d1fae5; color: #065f46; } /* Delivered */
.order-status.status-4 { background: #fde2e1; color: #a12622; } /* Cancelled */

.order-items {
    width: 100%;
    border-collapse: collapse;
}

.order-items th,
.order-items td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e4e7eb;
}

.order-items th {
    color: #52606d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-totals {
    margin-top: 0.75rem;
    text-align: right;
}

.order-grand-total {
    font-weight: 700;
    color: #008000;
}

.order-note {
    margin-top: 0.5rem;
    color: #52606d;
}

@media (max-width: 600px) {
    /* Stack the order-items table into rows on small screens. */
    .order-items thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .order-items,
    .order-items tbody,
    .order-items tr,
    .order-items td {
        display: block;
        width: 100%;
    }

    .order-items tr {
        margin-bottom: 0.75rem;
        border-bottom: 2px solid #e4e7eb;
    }

    .order-items td {
        border: none;
        display: flex;
        justify-content: space-between;
        padding: 0.3rem 0;
    }

    .order-items td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #52606d;
    }
}

/* ============ Admin: product management ============ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted {
    color: #52606d;
    font-size: 0.9rem;
}

/* Toolbar above the products table: heading left, action right. */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-toolbar h2 {
    margin: 0;
}

/* Product search bar sits just below the toolbar; keep the vertical gap tight. */
.product-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 1rem;
}

.product-search input[type="search"] {
    flex: 1 1 16rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

/* The base button/.btn rule adds margin-top: 1rem, which would push these
   controls out of line with the input. Reset it so the row sits level. */
.product-search button,
.product-search .btn {
    margin-top: 0;
}

/* Products list table (reuses the visual language of .order-items). */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e4e7eb;
    vertical-align: middle;
}

.admin-table thead th {
    color: #52606d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f5f7fa;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table-actions {
    text-align: right;
    white-space: nowrap;
}

.btn-small {
    margin-top: 0;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

/* Status pills in the products table. */
.pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

.pill-on      { background: #d1fae5; color: #065f46; }
.pill-off     { background: #e4e7eb; color: #52606d; }
.pill-special { background: #fef3c7; color: #92600a; margin-left: 0.25rem; }

/* Product editor form. */
.product-edit select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd2d9;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
}

/* Checkboxes must not stretch to full width like text inputs. */
.product-edit .checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.product-edit .checkbox-row input {
    width: auto;
    margin: 0;
}

.product-edit-image {
    margin: 0.5rem 0;
}

.product-edit-image img {
    max-width: 220px;
    max-height: 220px;
    border: 1px solid #e4e7eb;
    border-radius: 8px;
}

.product-edit-actions {
    margin-bottom: 1.5rem;
}

/* Delete sits apart from the save form, visually de-emphasised. */
.product-delete {
    border-top: 1px solid #e4e7eb;
    padding-top: 1rem;
}

.btn-danger,
.product-delete button {
    background: #a12622;
}

.btn-danger:hover,
.product-delete button:hover {
    background: #841e1b;
}

@media (max-width: 600px) {
    /* Stack the products table into rows on small screens. */
    .admin-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        border-bottom: 2px solid #e4e7eb;
    }

    .admin-table td {
        border: none;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.4rem 0.75rem;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #52606d;
    }

    .admin-table-actions {
        text-align: left;
    }
}
