/* ===============================================================
   RetailSuite — global stylesheet
   Brighter palette, soft shadows, fully responsive (desktop / tablet / mobile)
   =============================================================== */

:root {
    /* Brighter palette */
    --color-primary:        #6366f1;            /* indigo-500 */
    --color-primary-dark:   #4f46e5;            /* indigo-600 */
    --color-primary-soft:   #eef2ff;            /* indigo-50  */
    --color-accent:         #ec4899;            /* pink-500   */
    --color-success:        #10b981;            /* emerald-500 */
    --color-warning:        #f59e0b;            /* amber-500  */
    --color-danger:         #ef4444;            /* red-500    */

    --color-bg:             #f7f7fb;            /* light lavender-grey */
    --color-surface:        #ffffff;
    --color-border:         #e5e7eb;
    --color-border-soft:    #f1f5f9;
    --color-text:           #111827;
    --color-text-muted:     #6b7280;
    --color-text-faint:     #9ca3af;

    /* Sidebar — bright indigo gradient instead of dark slate */
    --sidebar-bg:           linear-gradient(180deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    --sidebar-fg:           rgba(255,255,255,.78);
    --sidebar-fg-active:    #ffffff;
    --sidebar-hover-bg:     rgba(255,255,255,.12);
    --sidebar-active-bg:    rgba(255,255,255,.22);

    /* Surfaces / shadows */
    --shadow-sm:            0 1px 2px rgba(17,24,39,.04);
    --shadow:               0 2px 6px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
    --shadow-lg:            0 8px 24px rgba(17,24,39,.12);

    --radius-sm:            6px;
    --radius:               10px;
    --radius-lg:            14px;

    --sidebar-width:        232px;
    --header-height:        58px;

    /* Storefront-specific */
    --shop-bottom-nav-height: 60px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary-dark); }

/* ===============================================================
   Admin layout
   =============================================================== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    padding: 20px 16px;
    overflow-y: auto;
    transition: transform .25s ease;
}

.sidebar h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .3px;
    margin: 0 0 24px;
    padding: 0 6px;
}

.sidebar a, .sidebar a:visited {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 3px;
    transition: background .15s, color .15s;
}

.sidebar a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-fg-active);
}

.sidebar a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-fg-active);
    font-weight: 600;
}

.sidebar hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,.18);
    margin: 12px 0;
}

/* Sidebar overlay for mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    z-index: 90;
}

/* ----- Main column ----- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;       /* allow flex children to shrink for tables */
}

.header {
    background: #fff;
    padding: 12px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-burger {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 6px;
    color: var(--color-text);
    font-size: 22px;
    line-height: 1;
}

.content {
    padding: 24px;
}

.footer {
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-faint);
    background: #fff;
}

/* ===============================================================
   Cards / surfaces
   =============================================================== */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--color-border-soft);
    box-shadow: var(--shadow);
}

/* ===============================================================
   Tables — scroll horizontally on small screens
   =============================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    background: #fafafd;
}

.table td {
    padding: 12px 10px;
    border-top: 1px solid var(--color-border-soft);
    font-size: 14px;
}

.table tr:hover td { background: #fafafd; }

/* Wrap tables on small screens so they scroll horizontally instead of breaking layout. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===============================================================
   Inputs
   =============================================================== */
.input {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.input:disabled { background: #f3f4f6; color: var(--color-text-muted); }

select.input { height: 38px; }

/* ===============================================================
   Buttons
   =============================================================== */
.btn {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform .1s ease, background .15s, border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn:active { transform: translateY(1px); }

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(99,102,241,.32);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #4338ca 100%);
    box-shadow: 0 4px 12px rgba(99,102,241,.40);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover { background: #dc2626; }

/* ===============================================================
   Login / signup
   =============================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 360px;
    padding: 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    margin: 0 0 6px;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 26px;
}

.subtitle { font-size: 14px; color: var(--color-text-muted); margin-bottom: 22px; }

.full { width: 100%; margin-bottom: 12px; }

/* ===============================================================
   Modal
   =============================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 16px;
    overflow-y: auto;
}

.modal {
    background: #fff;
    padding: 22px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* ===============================================================
   Toast
   =============================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-text);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    font-size: 14px;
    max-width: calc(100vw - 48px);
}

/* ===============================================================
   Spinner
   =============================================================== */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 12px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===============================================================
   Stat cards
   =============================================================== */
.stat-card  { text-align: center; padding: 22px; }
.stat-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 8px;
              text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--color-text); }
.stat-sub   { font-size: 12px; color: var(--color-text-faint); margin-top: 4px; }
.stat-warning .stat-value { color: var(--color-danger); }
.stat-warning             { border-color: #fecaca; background: #fff7f7; }

/* ===============================================================
   Status badges
   =============================================================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.badge-grey  { background: #f3f4f6; color: #374151; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #047857; }
.badge-red   { background: #fee2e2; color: #b91c1c; }
.badge-amber { background: #fef3c7; color: #a16207; }

/* ===============================================================
   Storefront — .cart-link is still used (CustomerLayout's top nav Cart
   link); everything else that used to live under this header has been
   superseded by the "clean commerce theme" block further down and was
   removed to avoid two competing definitions of the same classes.
   =============================================================== */
.cart-link { position: relative; }

/* ===============================================================
   Quantity stepper — shared -/+ control. Storefront no longer uses this
   (Cart/Product Detail switched to plain number inputs); POS.razor still
   does, so the rule stays.
   =============================================================== */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.qty-stepper button {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.qty-stepper button:hover:not(:disabled) { background: var(--color-primary-soft); }
.qty-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper .qty-value {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    user-select: none;
}

/* ===============================================================
   Skeleton loading — shown in place of the product grid while it loads,
   instead of a single generic spinner.
   =============================================================== */
.skeleton-card {
    background: #fff;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.skeleton-shimmer {
    background: linear-gradient(90deg, #eef0f4 25%, #f6f7fa 37%, #eef0f4 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.skeleton-card .skeleton-img   { width: 100%; aspect-ratio: 1 / 1; }
.skeleton-card .skeleton-line  { height: 12px; border-radius: 6px; margin: 10px 12px; }
.skeleton-card .skeleton-line.short { width: 50%; }
.skeleton-card .skeleton-btn   { height: 34px; border-radius: var(--radius-sm); margin: 10px 12px 12px; }

/* Generic two-column info grid (order recipient/payment details, wallet stats). */
.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ===============================================================
   Responsive — tablet + mobile
   =============================================================== */

/* Tablet (<= 1024px) — slightly tighter spacing */
@media (max-width: 1024px) {
    .content { padding: 18px; }
    :root { --sidebar-width: 200px; }
}

/* Mobile (<= 768px) — sidebar becomes a slide-out drawer */
@media (max-width: 768px) {
    body { font-size: 14px; }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        width: min(260px, 80vw);
    }

    .sidebar.open       { transform: translateX(0); }
    .sidebar-backdrop.open { display: block; }

    .header-burger { display: inline-flex; }

    .content { padding: 14px; }

    .card { padding: 14px; border-radius: var(--radius); }

    /* Tables collapse to horizontal scroll if not wrapped — but wrapped is preferred */
    .table { font-size: 13px; }
    .table th, .table td { padding: 8px 6px; }

    /* Recipient/payment/wallet-stat grids collapse to one column */
    .two-col-grid { grid-template-columns: 1fr; }

    /* Modal full-width on phone */
    .modal { max-width: 100%; padding: 18px; border-radius: var(--radius); }
    .modal-overlay { padding: 8px; }

    .footer { padding: 12px 16px; }
}

/* Small phones (<= 380px) */
@media (max-width: 380px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-value { font-size: 24px; }
}

/* ===============================================================
   Storefront redesign — clean commerce theme
   =============================================================== */
.shop-layout {
    --shop-ink: #111827;
    --shop-muted: #64748b;
    --shop-line: #e5e7eb;
    --shop-soft: #f8fafc;
    --shop-cta: #111827;
    --shop-cta-hover: #0f172a;
    min-height: 100vh;
    background: #f8fafc;
    color: var(--shop-ink);
    padding-bottom: 0;
}

.shop-header {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
    min-height: 60px;
    background: rgba(255,255,255,.94);
    color: var(--shop-ink);
    border-bottom: 1px solid rgba(226,232,240,.95);
    box-shadow: 0 1px 0 rgba(15,23,42,.04);
    backdrop-filter: blur(14px);
    padding: 0 24px;
}

.shop-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1180px;
    min-height: 64px;
    margin: auto;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.shop-brand {
    color: var(--shop-ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0;
}

.shop-brand:hover { color: var(--shop-ink); }

.shop-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: #111827;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.shop-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.shop-nav a {
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.shop-nav a:hover,
.shop-nav a.active {
    background: #f1f5f9;
    color: var(--shop-ink);
}

.wallet-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wallet-balance,
.cart-badge {
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
}

.cart-badge {
    background: #111827;
    color: #fff;
    margin-left: 4px;
}

.shop-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.shop-footer {
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.shop-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 1fr 1fr;
    gap: 24px;
}

.shop-footer-brand strong {
    display: block;
    font-size: 16px;
    color: #111827;
    margin-bottom: 6px;
}

.shop-footer-brand p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    max-width: 320px;
}

.shop-footer-col h5 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
}

.shop-footer-col a {
    display: block;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
}

.shop-footer-col a:hover { color: #111827; }

.shop-footer-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shop-footer-payments span {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.shop-footer-bottom {
    border-top: 1px solid #f1f5f9;
    padding: 14px 20px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

.shop-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
}

.shop-eyebrow {
    margin: 0 0 6px;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
}

.shop-hero h1,
.cart-page-head h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.05;
    letter-spacing: 0;
}

.shop-hero p {
    max-width: 560px;
    margin: 10px 0 0;
    color: #64748b;
    line-height: 1.55;
}

.shop-hero-search {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

.shop-search-input {
    width: 100%;
    min-height: 46px;
    border-radius: 9px;
    margin: 0;
}

.category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 16px;
    margin-bottom: 6px;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar { display: none; }

.category-chip {
    flex: 0 0 auto;
    min-height: 38px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.category-chip span {
    color: #94a3b8;
    font-size: 12px;
}

.category-chip.selected {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.category-chip.selected span { color: rgba(255,255,255,.72); }

/* ===============================================================
   Section 1 — curated per-category rows, and the "All products" section
   heading that follows it.
   =============================================================== */
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 22px; color: #111827; letter-spacing: 0; }

.category-rows-section { margin-bottom: 32px; }

.category-row { margin-bottom: 22px; }

.category-row-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.category-row-head h3 {
    margin: 0;
    font-size: 16px;
    color: #111827;
}

.category-row-view-all {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.category-row-view-all:hover { text-decoration: underline; }

.category-row-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-row-scroll::-webkit-scrollbar { display: none; }

.row-card {
    flex: 0 0 150px;
    width: 150px;
    cursor: pointer;
}

.row-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 11px;
}

.row-card-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.row-card-price {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.explore-categories-btn {
    display: block;
    margin: 4px auto 0;
}

.shop-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.toolbar-filter-btn {
    display: none; /* mobile-only — desktop's sidebar is always visible */
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.toolbar-sort {
    width: auto;
    min-width: 0;
    margin-left: auto;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.view-toggle {
    display: flex;
    gap: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    background: #fff;
    margin-left: auto;
}

.view-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.view-toggle button.active {
    background: #111827;
    color: #fff;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* A plain flex row let the (short, left-aligned) info block eat all the
   left-over width, leaving a wide dead gap before the price/button — a
   proper row of aligned columns (image | info | price | action) reads as
   a list instead of loosely scattered pieces. */
.product-list-item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .2s;
}

.product-list-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

.product-list-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
    aspect-ratio: 1 / 1;
    font-size: 11px;
}

.product-list-info { min-width: 0; }
.product-list-info .product-name { -webkit-line-clamp: 1; min-height: 0; margin-bottom: 3px; }

.product-list-price {
    white-space: nowrap;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.product-list-actions .btn { white-space: nowrap; font-size: 12px; font-weight: 800; padding: 8px 14px; }

.shop-home-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.shop-sidebar {
    width: auto;
    /* Desktop: stays in view while the product grid scrolls, instead of
       scrolling away with the page. --shop-header-height is measured in
       app.js (the sticky header's height varies by content/viewport). */
    position: sticky;
    top: calc(var(--shop-header-height, 70px) + 16px);
    max-height: calc(100vh - var(--shop-header-height, 70px) - 32px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: none;
    padding: 16px;
}

.shop-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.shop-filter-title h4 {
    margin: 0;
    font-size: 15px;
}

.link-button {
    border: 0;
    background: transparent;
    color: #2563eb;
    padding: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 2px;
    font-size: 13px;
    color: #334155;
}

.cat-row:hover { background: #f8fafc; }
.cat-row.selected { background: #f1f5f9; color: #111827; font-weight: 800; }
.cat-twisty { width: 14px; display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 11px; }

.facet-title {
    margin: 14px 0 7px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: .07em;
}

.facet-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 5px 0;
    cursor: pointer;
    color: #334155;
}

.facet-line:hover { color: #111827; }

.price-filter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
}

.price-filter-row .input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
}

.price-filter-row span {
    color: #94a3b8;
    font-size: 12px;
}

.filter-apply,
.filter-clear {
    width: 100%;
    margin-top: 8px;
    font-size: 12px;
}

.shop-sidebar-utility { margin-top: 14px; }

.shop-product-section {
    min-width: 0;
}

.shop-grid-header {
    margin-bottom: 14px;
}

.shop-grid-header h2 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    letter-spacing: 0;
}

.shop-grid-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.product-card {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, border-color .15s;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 28px rgba(15,23,42,.08);
}

.product-img,
.product-img-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    background: #f1f5f9;
}

.product-img {
    object-fit: cover;
    display: block;
}

.product-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #94a3b8;
}

.product-info {
    padding: 12px;
}

.product-brand {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 800;
    margin-bottom: 4px;
}

.product-name {
    font-size: 14px;
    font-weight: 750;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    min-height: 34px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    margin-top: 9px;
}

.product-stock {
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}

.product-stock.low { color: #b45309; }
.product-stock.out { color: #b91c1c; }

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 8px;
    margin-top: 10px;
}

.product-actions .btn {
    /* Cards only ever render one action button (Add to cart, or View
       options as a fallback) — span both grid tracks so it isn't left
       squeezed into just the first ~43% of the row. */
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 38px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.shop-layout .btn-primary {
    background: var(--shop-cta);
    border-color: var(--shop-cta);
    box-shadow: none;
}

.shop-layout .btn-primary:hover {
    background: var(--shop-cta-hover);
    border-color: var(--shop-cta-hover);
    box-shadow: none;
}

.shop-bottom-nav {
    display: none;
}

/* Icon-only mobile header (hamburger / search / centered mark / account /
   cart) — hidden on desktop, where the text .shop-header-inner nav is used
   instead. Base rules keep the drawer fully inert at any width until the
   mobile media query below turns it on, so a resize from mobile (drawer
   open) to desktop can't leave it stuck open. */
.shop-header-mobile { display: none; }

.shop-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--shop-ink);
    background: transparent;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.shop-icon-btn:hover { background: #f1f5f9; }

.shop-brand-mobile {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    color: var(--shop-ink);
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
}

.shop-brand-mobile span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.shop-drawer-backdrop { display: none; }
.shop-drawer { display: none; }

.cart-page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.cart-page-head h2 {
    font-size: clamp(26px, 4vw, 38px);
}

.cart-table-card {
    overflow-x: auto;
}

.cart-mobile-list {
    display: none;
}

.cart-summary-bar {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.cart-summary-bar span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.cart-summary-bar strong {
    display: block;
    color: #111827;
    font-size: 24px;
    margin-top: 2px;
}

.cart-summary-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .shop-layout {
        padding-bottom: 72px;
    }

    .shop-header {
        padding: 0 10px;
    }

    /* Text header (brand + nav) is replaced by the icon-only mobile header
       below — showing both would duplicate the brand and waste vertical
       space on a small screen. */
    .shop-header-inner {
        display: none;
    }

    .shop-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 58px;
        gap: 2px;
    }

    .shop-drawer-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.45);
        z-index: 300;
    }

    .shop-drawer {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: fixed;
        top: 0;
        bottom: 0;
        left: -300px;
        width: min(280px, 82vw);
        max-width: 82vw;
        background: #fff;
        z-index: 310;
        padding: 16px;
        box-shadow: 0 8px 24px rgba(17,24,39,.12);
        overflow-y: auto;
        transition: left .25s ease;
    }

    .shop-drawer.open { left: 0; }

    .shop-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 800;
        color: var(--shop-ink);
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e2e8f0;
    }

    .shop-drawer a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 8px;
        border-radius: 8px;
        color: #334155;
        text-decoration: none;
        font-weight: 600;
        font-size: 15px;
    }

    .shop-drawer a:hover,
    .shop-drawer a.active {
        background: #f1f5f9;
        color: var(--shop-ink);
    }

    .shop-main {
        padding: 16px 12px 28px;
    }

    .shop-footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 16px 16px;
    }

    .shop-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 12px;
    }

    .shop-hero h1 {
        font-size: 30px;
    }

    .shop-hero p {
        font-size: 14px;
    }

    .shop-hero-search {
        position: sticky;
        top: 66px;
        z-index: 80;
        padding: 6px;
        border-radius: 11px;
    }

    .category-strip {
        margin-left: -12px;
        margin-right: -12px;
        padding: 2px 12px 14px;
    }

    .shop-home-layout {
        display: block;
    }

    .toolbar-filter-btn {
        display: inline-flex;
    }

    /* Collapsed by default on mobile — opened via the "Filter" toolbar
       button (see .toolbar-filter-btn) instead of always taking up space
       above the product list. */
    .shop-sidebar {
        display: none;
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        margin-bottom: 14px;
        border-radius: 12px;
    }

    .shop-sidebar.open {
        display: block;
    }

    .shop-sidebar .cat-row,
    .shop-sidebar-utility {
        display: none;
    }

    .shop-filter-title {
        margin-bottom: 0;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 13px;
        min-height: 34px;
    }

    .product-desc {
        display: none;
    }

    .product-actions {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .product-actions .btn {
        min-height: 36px;
    }

    .product-list-item {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        grid-template-areas:
            "img info price"
            "actions actions actions";
        row-gap: 8px;
    }

    .product-list-img   { grid-area: img; width: 64px; height: 64px; }
    .product-list-info  { grid-area: info; }
    .product-list-price { grid-area: price; }
    .product-list-actions { grid-area: actions; }

    .product-list-actions .btn {
        width: 100%;
    }

    .shop-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 220;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255,255,255,.96);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -8px 22px rgba(15,23,42,.08);
        backdrop-filter: blur(14px);
    }

    .shop-bottom-nav a {
        position: relative;
        color: #64748b;
        text-decoration: none;
        font-size: 12px;
        font-weight: 800;
        min-height: 42px;
        border-radius: 10px;
        display: grid;
        place-items: center;
    }

    .shop-bottom-nav a.active {
        background: #111827;
        color: #fff;
    }

    .shop-bottom-nav strong {
        position: absolute;
        top: 2px;
        right: 14px;
        min-width: 18px;
        height: 18px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: #ef4444;
        color: #fff;
        font-size: 10px;
    }

    .cart-page-head {
        align-items: start;
        flex-direction: column;
    }

    .cart-table-card {
        display: none;
    }

    .cart-mobile-list {
        display: grid;
        gap: 10px;
    }

    .cart-mobile-item {
        position: relative;
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px;
    }

    .cart-mobile-item img,
    .cart-mobile-empty {
        width: 88px;
        height: 110px;
        object-fit: cover;
        border-radius: 9px;
        background: #f1f5f9;
        color: #94a3b8;
        font-size: 11px;
        display: grid;
        place-items: center;
    }

    .cart-mobile-info h3 {
        margin: 0;
        font-size: 14px;
        line-height: 1.25;
        color: #111827;
    }

    .cart-mobile-info p {
        margin: 3px 0 6px;
        color: #64748b;
        font-size: 12px;
    }

    .cart-mobile-info strong {
        color: #111827;
        font-size: 14px;
    }

    .cart-mobile-actions {
        display: flex;
        gap: 6px;
        margin-top: 9px;
    }

    .cart-mobile-actions .input {
        width: 64px;
        min-height: 38px;
        margin: 0;
    }

    .cart-mobile-actions .btn {
        padding: 7px 9px;
        font-size: 12px;
    }

    .cart-line-total {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
        color: #111827;
        font-size: 13px;
        font-weight: 800;
        text-align: right;
    }

    .cart-summary-bar {
        position: sticky;
        bottom: 72px;
        z-index: 40;
        padding: 12px;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(15,23,42,.14);
    }

    .cart-summary-bar strong {
        font-size: 18px;
    }

    .cart-summary-actions {
        flex-shrink: 0;
    }

    .cart-summary-actions .btn {
        min-height: 40px;
        padding: 8px 10px;
    }
}

.checkout-shell {
    max-width: 680px;
    margin: 0 auto;
}

.checkout-page-head,
.cart-page-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.checkout-page-head h2 {
    margin: 2px 0 0;
    color: #111827;
}

.checkout-section {
    border-color: #e2e8f0;
    box-shadow: none;
}

.checkout-section h4 {
    color: #111827;
    font-size: 15px;
}

.checkout-credit {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

.checkout-totals {
    border: 2px solid #111827;
}

.checkout-confirmation {
    max-width: 500px;
    margin: 12px auto 0;
    padding: 38px 26px !important;
    text-align: center;
    border-color: #d1fae5;
}

.checkout-confirmation-mark {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.checkout-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.checkout-option:has(input:checked) {
    border-color: #111827;
    background: #f8fafc;
}

.checkout-option input {
    width: 17px;
    height: 17px;
    accent-color: #111827;
}

@media (max-width: 640px) {
    .checkout-page-head {
        align-items: flex-start;
    }

    .checkout-page-head .btn {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .checkout-section {
        padding: 14px !important;
    }

    .checkout-confirmation {
        margin-top: 4px;
    }

    .checkout-confirmation > div:last-child {
        flex-direction: column;
    }

    .checkout-confirmation > div:last-child .btn {
        width: 100%;
    }
}

/* ===============================================================
   Print receipt styles
   =============================================================== */
@media print {
    body > * { display: none !important; }
    #receipt-printable { display: block !important; }
}
