* {
    box-sizing: border-box;
}

:root {
    /* Reference palette (Next.js + Tailwind globals.css) converted to plain CSS.
       Green primary #16a34a, warm amber accent, oklch neutrals. */
    --primary: #16a34a;
    --primary-foreground: #ffffff;
    --primary-dark: #15803d;
    --primary-darker: #166534;
    --accent: oklch(0.76 0.16 75);
    --accent-foreground: oklch(0.26 0.03 75);
    --accent-dark: #b45309;

    --background: oklch(0.99 0.005 130);
    --foreground: oklch(0.22 0.02 150);
    --card: #ffffff;
    --card-foreground: var(--foreground);
    --secondary: oklch(0.96 0.02 140);
    --secondary-foreground: oklch(0.32 0.04 150);
    --muted-bg: oklch(0.96 0.01 140);
    --muted-foreground: oklch(0.5 0.02 150);

    /* Back-compat aliases mapped onto the reference tokens */
    --gray-50: var(--background);
    --gray-100: oklch(0.96 0.01 140);
    --gray-200: oklch(0.92 0.01 140);
    --gray-300: oklch(0.86 0.01 140);
    --gray-500: var(--muted-foreground);
    --gray-700: var(--secondary-foreground);
    --gray-900: var(--foreground);
    --ink: var(--foreground);
    --muted: var(--muted-foreground);
    --line: oklch(0.91 0.01 140);
    --soft: var(--secondary);
    --panel: #ffffff;
    --danger: oklch(0.58 0.22 27);
    --warning: #b45309;
    --success: #15803d;

    /* one soft shadow scale */
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 14px 34px rgba(16, 24, 40, 0.12);

    /* radius scale: matches Tailwind --radius:0.75rem ramp */
    --radius-sm: 8px;
    --radius: 12px;       /* rounded-xl */
    --radius-2xl: 22px;   /* rounded-2xl (cards) */
    --radius-3xl: 26px;   /* rounded-3xl (hero) */
    --radius-pill: 999px;
    --base-font-size: 16px;

    /* motion tokens — one shared timing language */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 140ms;
    --dur: 200ms;
    --dur-slow: 300ms;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

html {
    font-size: var(--base-font-size);
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: clip;
    background: var(--background);
    color: var(--foreground);
    font-family: "Nunito Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .admin-logo, .font-heading {
    font-family: "Nunito", "Nunito Sans", "Segoe UI", system-ui, Arial, sans-serif;
    letter-spacing: -0.01em;
}

body.admin-body,
body.login-body {
    background: var(--gray-100);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:disabled,
.disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

label {
    display: grid;
    gap: 8px;
    color: #26382d;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1.5px solid color-mix(in srgb, var(--foreground) 15%, var(--line));
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    padding: 12px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
    outline-offset: 2px;
}

textarea {
    resize: vertical;
}

main {
    min-height: 60vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--background) 90%, transparent);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 64px;
    height: auto;
    padding: 10px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    grid-column: 2;
    grid-row: 1;
}

.brand,
.admin-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.brand .brand-mark {
    flex-shrink: 0;
}

/* Language toggle — glass track + sliding green pill */
.lang-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    width: 112px;
    padding: 4px;
    border-radius: var(--radius-pill);
    direction: ltr; /* keep EN | عربي order on RTL pages */
    background: color-mix(in srgb, var(--card) 58%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    border: 1px solid color-mix(in srgb, var(--foreground) 11%, transparent);
    box-shadow:
        0 4px 16px rgba(16, 24, 40, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
    isolation: isolate;
}

.lang-switch-glide {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    right: auto;
    width: calc(50% - 4px);
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, #fff) 0%, var(--primary) 100%);
    box-shadow:
        0 2px 10px color-mix(in srgb, var(--primary) 42%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: left 280ms cubic-bezier(0.34, 1.45, 0.64, 1), right 280ms cubic-bezier(0.34, 1.45, 0.64, 1);
    z-index: 0;
    pointer-events: none;
}

.lang-switch--ar .lang-switch-glide {
    left: auto;
    right: 4px;
}

.lang-switch-seg {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 0;
    padding: 0 2px;
    border-radius: var(--radius-pill);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 220ms ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.lang-switch-seg .lang-switch-text {
    display: block;
    line-height: 1.1;
    pointer-events: none;
}

.lang-switch-seg-ar .lang-switch-text {
    font-family: 'Noto Sans Arabic', 'Nunito Sans', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.lang-switch-seg.is-active {
    color: var(--primary-foreground);
}

.lang-switch-seg:not(.is-active):hover {
    color: var(--primary);
}

.admin-bar-right .lang-switch {
    width: 104px;
}

.admin-bar-right .lang-switch-seg {
    min-height: 30px;
    font-size: 0.68rem;
}

.admin-bar-right .lang-switch-seg-ar .lang-switch-text {
    font-size: 0.74rem;
}

.login-lang-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-lang-wrap .lang-switch {
    width: 118px;
}

.login-lang-wrap .lang-switch-seg {
    min-height: 36px;
}

.brand-mark,
.category-initial {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 800;
}

.brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--foreground);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    /* Store name is often English even on Arabic UI — keep it readable */
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

.brand-accent {
    color: var(--primary);
}

/* Header cart pill */
.header-cart-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 9px 16px;
    background: var(--secondary);
    color: var(--secondary-foreground);
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease;
}

.header-cart-button:hover {
    background: var(--primary);
    color: var(--primary-foreground);
}

.header-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-foreground);
    padding: 0 6px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--background);
}

/* The badge must actually hide when the cart is empty — an explicit display
   rule otherwise overrides the [hidden] attribute set by JS. */
.header-cart-count[hidden] {
    display: none;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: var(--panel);
    color: var(--gray-700);
    font-weight: 700;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.link-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 560px) {
    .header-cart-label { display: none; }
    .header-cart-button { padding: 9px 12px; }
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 16px auto 0;
}

.hero-card {
    position: relative;
    display: flex;
    min-height: clamp(360px, 52vw, 520px);
    overflow: hidden;
    border-radius: var(--radius-3xl);
    background: #122119;
    isolation: isolate;
    box-shadow: var(--shadow-lg);
}

/* Inner highlight ring for premium depth. */
.hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.hero-image,
.hero-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    object-fit: cover;
    z-index: -1;
    transform: scale(1.02);
    animation: hero-zoom 22s var(--ease-out) forwards;
}

/* Slow ken-burns zoom (auto-disabled by the global reduced-motion rule). */
@keyframes hero-zoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.1); }
}

.hero-overlay {
    z-index: -1;
    background:
        radial-gradient(120% 120% at 0% 50%, rgba(0, 0, 0, 0.5), transparent 60%),
        linear-gradient(90deg, rgba(8, 18, 12, 0.82) 0%, rgba(8, 18, 12, 0.5) 42%, rgba(8, 18, 12, 0.12) 100%);
}

/* Mirror the overlay so the dark side follows the right-aligned Arabic text. */
[dir="rtl"] .hero-overlay {
    background:
        radial-gradient(120% 120% at 100% 50%, rgba(0, 0, 0, 0.5), transparent 60%),
        linear-gradient(270deg, rgba(8, 18, 12, 0.82) 0%, rgba(8, 18, 12, 0.5) 42%, rgba(8, 18, 12, 0.12) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: clamp(28px, 5vw, 56px) clamp(24px, 5vw, 48px);
    color: #fff;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.hero-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    animation: hero-pulse 2.4s ease-out infinite;
}

@keyframes hero-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #b9f3cf;
}

.hero h1,
.section-heading h1,
.section-heading h2,
.success-card h1,
.detail-copy h1,
.admin-topbar h1,
.admin-card h2,
.login-card h1 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: 0;
}

.hero h1 {
    max-width: 32rem;
    margin: 0;
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.015em;
    font-size: clamp(2rem, 5.2vw, 3.4rem);
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.32);
}

.hero p:not(.eyebrow),
.hero .hero-sub {
    max-width: 27rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.98rem, 2vw, 1.08rem);
    line-height: 1.6;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-pill);
    padding: 14px 28px;
    font-weight: 800;
    font-size: 0.95rem;
    transition: transform 200ms var(--ease-out), background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.hero-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--primary-foreground);
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35);
}

/* Arrow that nudges on hover (mirrored for RTL). */
.hero-btn-primary::after {
    content: "\2192";
    font-size: 1.05em;
    line-height: 1;
    transition: transform 200ms var(--ease-out);
}

[dir="rtl"] .hero-btn-primary::after {
    content: "\2190";
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(22, 163, 74, 0.45);
}

.hero-btn-primary:hover::after {
    transform: translateX(3px);
}

[dir="rtl"] .hero-btn-primary:hover::after {
    transform: translateX(-3px);
}

.hero-btn-primary:active {
    transform: translateY(0);
}

.hero-btn-ghost {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.hero-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-2px);
}

@media (max-width: 560px) {
    .hero-cta { width: 100%; }
    .hero-btn { flex: 1 1 auto; }
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 11px 20px;
    font-weight: 800;
    transition: opacity var(--dur) var(--ease-out), background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.primary-button:hover {
    opacity: 0.9;
}

.primary-button:active {
    transform: scale(0.98);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    transition: background 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.ghost-button:active,
.hero-btn-ghost:active,
.icon-button:active,
.link-button:active {
    transform: scale(0.98);
}

.whatsapp-button {
    gap: 9px;
    background: #25d366;
}

.whatsapp-button:hover {
    background: #1ebe5a;
}

.optional-tag {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85em;
}

.primary-button.full {
    width: 100%;
}

.primary-button.is-loading {
    opacity: 0.78;
}

.primary-button.small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.section-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto;
}

.section-heading,
.admin-card-heading,
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2 {
    font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.muted {
    color: var(--muted);
}

/* ── Sticky storefront toolbar: search + sort + category pills ── */
.storefront {
    padding-bottom: 40px;
}

.shop-toolbar {
    position: sticky;
    top: 64px;
    z-index: 30;
    margin: 0 0 20px;
    padding: 12px 0;
    background: color-mix(in srgb, var(--background) 92%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.shop-toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-field {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.search-field .search-icon {
    position: absolute;
    left: 16px;
    color: var(--muted-foreground);
    pointer-events: none;
}

.search-field input[type="search"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--panel);
    padding: 0 44px;
    font-size: 0.95rem;
    color: var(--foreground);
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.search-field input[type="search"]::-webkit-search-cancel-button { display: none; }

.search-field input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.search-clear {
    position: absolute;
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: var(--muted-bg);
    color: var(--secondary-foreground);
    cursor: pointer;
}

.search-clear:hover { background: var(--gray-200); }

.sort-field {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.sort-field .sort-icon {
    position: absolute;
    left: 14px;
    color: var(--muted-foreground);
    pointer-events: none;
}

.sort-field select {
    height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--panel);
    padding: 0 34px 0 38px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--foreground);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.sort-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.sort-field .sort-caret {
    position: absolute;
    right: 12px;
    color: var(--muted-foreground);
    pointer-events: none;
}

/* Category pills */
.category-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-bottom: 2px;
}

.category-chip {
    flex: 0 0 auto;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.category-chip:hover {
    background: color-mix(in srgb, var(--secondary) 70%, var(--background));
}

.category-chip.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.category-chip:active {
    transform: scale(0.96);
}

@media (max-width: 560px) {
    .sort-field select { max-width: 42vw; font-size: 0.82rem; }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--card);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.product-card:hover,
.product-card:focus-within {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-card.is-unavailable .product-image-link img {
    opacity: 0.7;
}

.product-image-link {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--muted-bg);
}

.product-image-link img,
.detail-image img,
.cart-item img,
.table-thumb,
.form-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-link img {
    transition: transform var(--dur-slow) var(--ease-out);
}

.product-card:hover .product-image-link img {
    transform: scale(1.05);
}

.product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.product-card h3 {
    margin: 0;
    color: var(--foreground);
    font-family: "Nunito Sans", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.product-card h3 a { color: inherit; }

.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.price-row strong {
    color: var(--foreground);
    font-family: "Nunito", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
}

.price-row.large strong {
    font-size: 2rem;
}

.price-row del {
    color: var(--muted-foreground);
    font-size: 0.78rem;
}

/* Card add-to-cart button + inline stepper (reference behaviour) */
.card-actions {
    margin-top: 4px;
}

.card-add {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 800;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.card-add:hover { opacity: 0.92; }
.card-add:active { transform: scale(0.97); }

.card-add:disabled {
    background: var(--muted-bg);
    color: var(--muted-foreground);
    cursor: not-allowed;
    opacity: 1;
}

.card-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin: 0 auto;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: var(--secondary);
}

.card-stepper button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--secondary-foreground);
    transition: background 150ms ease, color 150ms ease;
}

.card-stepper button:last-child {
    background: var(--primary);
    color: var(--primary-foreground);
}

.card-stepper button:first-child:hover { background: var(--panel); }
.card-stepper button:last-child:hover { opacity: 0.9; }
.card-stepper button:active { transform: scale(0.9); }

.card-stepper span {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
}

/* Generic stepper (product detail page / cart) */
.qty-stepper {
    display: grid;
    grid-template-columns: 36px minmax(42px, 1fr) 36px;
    align-items: center;
    min-height: 44px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.qty-stepper button {
    width: 36px;
    height: 44px;
    border: 0;
    background: var(--muted-bg);
    color: var(--gray-700);
    font-size: 1.08rem;
    font-weight: 900;
    transition: background 150ms ease, color 150ms ease;
}

.qty-stepper button:hover {
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    color: var(--primary-dark);
}

.qty-stepper input {
    min-height: 44px;
    border: 0;
    border-radius: 0;
    padding: 0 4px;
    text-align: center;
    box-shadow: none;
    appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.item-note-input {
    padding: 10px 11px;
}

.product-actions {
    display: grid;
    grid-template-columns: minmax(112px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.add-button {
    min-width: 82px;
    white-space: nowrap;
}

/* Out-of-stock "Ask on WhatsApp" CTA on the product page. */
.add-button.wa-ask {
    gap: 8px;
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.32);
}

.add-button.wa-ask:hover {
    background: #1ebe5b;
}

.add-button.wa-ask svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.stock-badge,
.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-in-stock,
.status-completed,
.status-confirmed,
.status-seen,
.mini-badge.green {
    background: #edf2ee;
    color: #51625a;
}

.status-low-stock,
.status-pending,
.status-preparing,
.status-out-for-delivery {
    background: #fff1ca;
    color: #7b4b00;
}

.status-out-of-stock,
.status-cancelled {
    background: #f2e6e4;
    color: #9a1f16;
}

.status-new {
    background: #dceaff;
    color: #124b91;
}

.mini-badge {
    background: #e7f0ff;
    color: #164c8a;
    margin-right: 4px;
}

.muted-badge {
    background: #edf0ee;
    color: #607068;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 64px 18px;
    text-align: center;
}

.empty-state.small {
    padding: 32px 16px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--muted-foreground);
    margin-bottom: 2px;
}

.empty-state h3 {
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    color: var(--muted);
}

.product-detail-shell {
    margin-top: 28px;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
    gap: clamp(18px, 3vw, 32px);
    align-items: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: clamp(14px, 3vw, 26px);
    box-shadow: var(--shadow);
}

.detail-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: 460px;
    align-self: start;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #edf5ef, #fff5d8);
}

.detail-copy {
    display: grid;
    gap: 14px;
    align-content: start;
}

.detail-copy h1 {
    font-size: clamp(1.5rem, 3.2vw, 2.1rem);
    line-height: 1.15;
    margin: 0;
}

.detail-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 360px;
}

.detail-controls select[data-unit-option] {
    flex: 1 1 130px;
    min-height: 44px;
}

.detail-controls .qty-stepper {
    flex: 1 1 150px;
}

.detail-copy .item-note-input {
    width: 100%;
}

.detail-copy .add-button {
    width: 100%;
}

.cart-layout,
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.cart-panel,
.summary-panel,
.checkout-form,
.success-card,
.admin-card,
.login-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 14px 32px rgba(22, 40, 29, 0.07);
}

.cart-panel,
.summary-panel,
.checkout-form,
.success-card {
    padding: 18px;
}

.cart-item {
    display: flex;
    gap: 12px;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--card);
    padding: 12px;
}

.cart-item + .cart-item { margin-top: 12px; }

.cart-item img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--muted-bg);
}

.cart-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.cart-item h3 {
    margin: 0;
    font-family: "Nunito Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.cart-remove {
    flex-shrink: 0;
    border: 0;
    background: none;
    color: var(--muted-foreground);
    padding: 2px;
    cursor: pointer;
    transition: color 150ms ease;
}

.cart-remove:hover { color: var(--danger); }

.cart-item-note {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.cart-item-main select {
    min-height: 38px;
    width: auto;
    align-self: flex-start;
    padding: 0 30px 0 12px;
    font-size: 0.85rem;
}

.cart-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.cart-item-foot strong {
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    color: var(--foreground);
}

/* Pill stepper used in cart rows */
.cart-pill-stepper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--secondary);
}

.cart-pill-stepper button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--secondary-foreground);
    cursor: pointer;
    transition: background 150ms ease, opacity 150ms ease;
}

.cart-pill-stepper button:last-child {
    background: var(--primary);
    color: var(--primary-foreground);
}

.cart-pill-stepper button:first-child:hover { background: var(--panel); }
.cart-pill-stepper button:last-child:hover { opacity: 0.9; }

.cart-pill-stepper input {
    width: 32px;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: center;
    font-weight: 800;
    box-shadow: none;
    appearance: textfield;
    color: var(--foreground);
}

.cart-pill-stepper input::-webkit-outer-spin-button,
.cart-pill-stepper input::-webkit-inner-spin-button { margin: 0; appearance: none; }

.row-actions button,
.quick-status button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--gray-700);
    padding: 8px 10px;
    font-weight: 800;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.row-actions button:hover,
.quick-status button:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.danger-button {
    border-color: #f2b8b2;
    background: #fff6f4;
    color: var(--danger);
}

.danger-button:hover {
    border-color: var(--danger);
    background: #ffe3df;
    color: var(--danger);
}

.cart-unit {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 0 12px;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.summary-panel {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 14px;
}

.summary-panel h2 {
    margin: 0;
}

.summary-row,
.checkout-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.summary-row.total {
    color: var(--primary-dark);
    font-size: 1.18rem;
}

.checkout-form,
.admin-form,
.login-card {
    display: grid;
    gap: 16px;
}

.field-error {
    color: var(--danger);
    font-size: 0.875rem;
    font-weight: 700;
}

/* Phone field with a fixed, non-editable country-code prefix. */
.phone-field {
    display: flex;
    align-items: stretch;
    direction: ltr;
}

.phone-field .phone-cc {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1.5px solid color-mix(in srgb, var(--foreground) 15%, var(--line));
    border-inline-end: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    background: color-mix(in srgb, var(--foreground) 6%, var(--panel));
    color: var(--ink);
    font-weight: 700;
    white-space: nowrap;
}

.phone-field input {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.checkout-summary {
    position: sticky;
    top: 88px;
}

.success-shell {
    display: grid;
    place-items: center;
    min-height: 68vh;
}

.success-card {
    width: min(620px, 100%);
}

.success-card > p {
    color: var(--muted);
}

.order-status-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fbf9;
    padding: 12px;
}

.order-status-panel p {
    margin: 4px 0;
}

.order-summary-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.summary-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.summary-item small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.centered {
    justify-self: center;
    text-align: center;
}

.button-group {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.alert {
    width: min(1180px, calc(100% - 32px));
    margin: 16px auto;
    border-radius: var(--radius);
    padding: 12px 14px;
    font-weight: 700;
}

.alert-success {
    background: #e4f8ec;
    color: #14633b;
}

.alert-error {
    background: #ffe3df;
    color: #94241b;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(12px);
    border-radius: var(--radius);
    background: #17201a;
    color: #fff;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.toast button {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 5px 9px;
    font-size: 0.82rem;
    font-weight: 800;
}

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

/* ── Mobile bottom navigation (compact frosted-green floating dock) ── */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(420px, calc(100% - 24px));
    z-index: 60;
    display: none;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    gap: 2px;
    padding: 5px 6px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--primary) 14%, color-mix(in srgb, var(--card) 72%, transparent));
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    backdrop-filter: blur(26px) saturate(190%);
    border: 1px solid color-mix(in srgb, #ffffff 50%, transparent);
    box-shadow:
        0 12px 34px rgba(16, 24, 40, 0.16),
        0 3px 10px rgba(16, 24, 40, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bottom-nav-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 5px 2px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: color-mix(in srgb, var(--foreground) 55%, transparent);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: color 220ms var(--ease-out), background-color 280ms var(--ease-out), transform 200ms var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform 320ms var(--ease-spring);
}

/* Active state — green capsule + lifted icon. */
.bottom-nav-item.active {
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary) 22%, transparent);
}

.bottom-nav-item.active svg {
    transform: translateY(-1px) scale(1.1);
}

.bottom-nav-item:active {
    transform: scale(0.93);
}

@media (hover: hover) {
    .bottom-nav-item:not(.active):hover {
        color: var(--primary);
        background: color-mix(in srgb, var(--primary) 10%, transparent);
    }
}

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(10, 18, 13, 0.42);
    opacity: 0;
    transition: opacity 180ms ease;
}

.cart-drawer-open .cart-drawer-overlay {
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 75;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    width: min(448px, 100%);
    height: 100vh;
    height: 100dvh;
    transform: translateX(104%);
    border-left: 1px solid var(--line);
    background: #fff;
    box-shadow: -24px 0 50px rgba(17, 31, 22, 0.18);
    transition: transform 180ms ease;
}

.cart-drawer-open {
    overflow: hidden;
}

.cart-drawer-open .cart-drawer {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.cart-drawer-header h2 {
    margin: 0;
}

.cart-drawer-header .icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--foreground);
    transition: background 150ms ease;
}

.cart-drawer-header .icon-button:hover {
    background: var(--secondary);
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--gray-700);
    font-size: 1.4rem;
    font-weight: 700;
    transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.cart-drawer-items {
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px;
}

.cart-drawer .empty-state {
    margin: 18px;
}

.compact-cart-item {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
    padding: 12px 0;
}

.compact-cart-item img {
    width: 72px;
    height: 72px;
}

.compact-cart-item .cart-item-controls {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 136px;
    min-width: 0;
}

.compact-cart-item .cart-item-controls strong {
    align-self: center;
}

.compact-cart-item .cart-item-controls button[data-cart-remove] {
    justify-self: end;
}

.cart-note-label {
    padding: 0 18px 14px;
}

.cart-drawer-totals {
    padding: 0 18px 12px;
}

.cart-drawer-actions {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.site-footer {
    margin-top: 52px;
    border-top: 1px solid var(--line);
    background: var(--card);
}

.site-footer-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    padding: 40px 0;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-brand .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.footer-brand strong {
    font-family: "Nunito", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--foreground);
}

.footer-desc {
    max-width: 22rem;
    margin: 0 auto;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--muted-foreground);
}

.footer-top {
    width: 100%;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 32px;
    align-items: start;
    text-align: center;
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.footer-col-brand {
    gap: 14px;
}

.footer-col h4 {
    margin: 0;
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--foreground);
}

.footer-col-head {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-family: "Nunito", sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--foreground);
    cursor: default;
}

.footer-col-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    width: 100%;
}

.footer-chevron {
    display: none;
    flex-shrink: 0;
    transition: transform 200ms ease;
    color: var(--muted-foreground);
}

.footer-nav,
.footer-info,
.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.footer-nav a {
    color: var(--muted-foreground);
    transition: color 150ms ease;
}

.footer-nav a:hover {
    color: var(--primary-dark);
}

.footer-contact li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.footer-contact svg {
    flex-shrink: 0;
    color: var(--primary);
}

.footer-contact a {
    color: var(--muted-foreground);
    transition: color 150ms ease;
}

.footer-contact a:hover {
    color: var(--primary-dark);
}

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-social a {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--gray-700);
    background: var(--card);
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.footer-social a:hover {
    color: var(--primary-foreground);
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.footer-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.footer-links a:not(.owner-login-link) {
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.footer-credit {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted-foreground);
    letter-spacing: 0.01em;
}

.footer-credit strong {
    color: var(--primary-dark);
    font-weight: 800;
}

.admin-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    text-align: center;
}

.admin-footer p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted-foreground);
}

.admin-body {
    max-width: 100%;
    overflow-x: clip;
}

html,
body.admin-body,
.admin-menu,
.notif-list,
.table-wrap {
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body.admin-body::-webkit-scrollbar,
.admin-menu::-webkit-scrollbar,
.notif-list::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ── Admin top bar + hamburger dropdown menu ── */
.admin-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.admin-bar-inner {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 64px;
    height: auto;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.admin-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    grid-column: 1;
}

.admin-bar .admin-logo {
    margin: 0;
    font-size: 1.1rem;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
    min-width: 0;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

.admin-menu-toggle {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.admin-menu-toggle:hover,
.admin-menu-toggle[aria-expanded="true"] {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--secondary);
}

.admin-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    grid-column: 2;
    direction: ltr;
}

/* Notification sound switch in the admin top bar */
.sound-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--gray-700);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    direction: ltr; /* ON always slides thumb right */
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.sound-switch:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
}

.sound-switch-ico {
    display: inline-flex;
    color: var(--gray-500);
    transition: color 160ms ease;
}

.sound-switch-ico .ico-sound-on { display: none; }
.sound-switch-ico .ico-sound-off { display: inline-block; }

.sound-switch-label { letter-spacing: 0.01em; }

/* Track + sliding thumb (position-based — works in all languages) */
.sound-switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--gray-300);
    transition: background 160ms ease;
    flex: none;
    direction: ltr;
    unicode-bidi: isolate;
}

.sound-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.35);
    transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate3d(0, 0, 0);
}

/* ON state — transform inside LTR track (same physical slide in EN and AR) */
.sound-switch.is-on,
html.admin-sound-on .sound-switch[data-sound-toggle] {
    color: var(--primary-dark);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, var(--card));
}

.sound-switch.is-on .sound-switch-ico,
html.admin-sound-on .sound-switch[data-sound-toggle] .sound-switch-ico { color: var(--primary); }
.sound-switch.is-on .sound-switch-ico .ico-sound-on,
html.admin-sound-on .sound-switch[data-sound-toggle] .sound-switch-ico .ico-sound-on { display: inline-block; }
.sound-switch.is-on .sound-switch-ico .ico-sound-off,
html.admin-sound-on .sound-switch[data-sound-toggle] .sound-switch-ico .ico-sound-off { display: none; }
.sound-switch.is-on .sound-switch-track,
html.admin-sound-on .sound-switch[data-sound-toggle] .sound-switch-track { background: var(--primary); }
.sound-switch.is-on .sound-switch-thumb,
html.admin-sound-on .sound-switch[data-sound-toggle] .sound-switch-thumb {
    transform: translate3d(16px, 0, 0);
}

[dir="rtl"] .sound-switch,
[dir="rtl"] .sound-switch-track {
    direction: ltr;
}

.admin-bar-store {
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .sound-switch .sound-switch-label { display: none; }
    .sound-switch { padding: 0 8px; gap: 6px; }
}

/* Row actions (orders table) + trash link */
.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.row-actions .inline-delete { margin: 0; }

.icon-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--gray-500);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-delete-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.trash-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--gray-700);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.trash-link:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.trash-link .pill-count {
    background: #ef4444;
    color: #fff;
}

.admin-menu {
    position: absolute;
    top: 64px;
    left: max(16px, calc((100% - 1180px) / 2));
    z-index: 60;
    width: min(264px, calc(100% - 32px));
    display: grid;
    gap: 4px;
    padding: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.18s ease both;
}

.admin-menu a,
.admin-menu-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    color: var(--gray-700);
    font-weight: 700;
}

.admin-menu-form {
    margin: 0;
}

.admin-menu-action {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.admin-menu a:hover,
.admin-menu-action:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.admin-menu a.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.admin-pending-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #2d2200;
    padding: 0 7px;
    font-size: 0.78rem;
}

.admin-main {
    width: min(1180px, calc(100% - 32px));
    min-width: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 0 40px;
}

.admin-topbar a {
    color: var(--primary-dark);
    font-weight: 800;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-stats article {
    min-width: 0;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

@media (max-width: 1279px) {
    .admin-stats {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .admin-stats article {
        grid-column: span 3;
    }

    .admin-stats article:nth-child(n + 5) {
        grid-column: span 4;
    }
}

.admin-stats article:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* colored stat tiles (replaces inline styles on the dashboard) */
.admin-stats article.stat-warning {
    background: #fff5e6;
    border-color: #f2b84b;
}

.admin-stats article.stat-warning strong {
    color: #a05a00;
}

.admin-stats article.stat-success {
    background: #e6f4ec;
    border-color: #b7dfca;
}

.admin-stats article.stat-success strong {
    color: #157347;
}

.admin-stats span {
    display: block;
    color: var(--muted);
}

.admin-stats strong {
    display: block;
    margin-top: 8px;
    color: var(--primary-dark);
    font-size: clamp(1.28rem, 1.45vw, 1.8rem);
    white-space: nowrap;
}

.admin-card {
    min-width: 0;
    max-width: 100%;
    padding: 18px;
    margin-bottom: 18px;
}

.admin-card.narrow,
.login-card {
    width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.admin-filters {
    display: grid;
    grid-template-columns: 220px 1fr auto auto;
    gap: 12px;
    align-items: end;
}

/* ── Orders Toolbar ── */
.orders-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.status-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.status-pill:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.status-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.status-pill.active .pill-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.status-pill-pending.active {
    background: #a05a00;
    border-color: #a05a00;
}

.status-pill-confirmed.active {
    background: var(--success);
    border-color: var(--success);
}

.status-pill-cancelled.active {
    background: var(--danger);
    border-color: var(--danger);
}

.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-700);
}

.orders-search {
    flex-shrink: 0;
    width: min(260px, 100%);
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap svg {
    position: absolute;
    left: 12px;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
}

.search-input-wrap input {
    padding-left: 36px;
    padding-right: 36px;
    min-height: 40px;
    font-size: 0.9rem;
    border-radius: 999px;
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.search-input-wrap input:focus {
    background: #fff;
    border-color: var(--primary);
}

.search-input-wrap .search-clear {
    position: absolute;
    right: 12px;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1;
    padding: 2px 4px;
}

.search-input-wrap .search-clear:hover { color: var(--danger); }

/* ── Orders Table ── */
.order-code-link {
    font-weight: 700;
    color: var(--primary-dark);
    display: block;
    font-size: 0.88rem;
}

.order-date {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
    margin-top: 2px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #a05a00;
}

.status-badge.status-confirmed {
    background: #e6f4ec;
    color: var(--success);
}

.status-badge.status-cancelled {
    background: #fce9e9;
    color: var(--danger);
}

.confirm-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.15s;
    white-space: nowrap;
}

.confirm-btn { transition: background 0.15s ease, transform var(--dur-fast) var(--ease-out); }
.confirm-btn:hover { background: var(--primary-dark); }
.confirm-btn:active, .view-btn:active { transform: scale(0.97); }

.view-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.15s;
}

.view-btn:hover { background: var(--gray-200); }

.table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.pagination a {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--gray-700);
    font-weight: 800;
}

.pagination a.active,
.pagination a:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    color: #415248;
    font-size: 0.84rem;
    text-transform: uppercase;
}

.admin-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-table tr:hover td {
    background: #f8fbf9;
}

.table-thumb {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #edf5ef, #fff5d8);
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-actions a {
    color: var(--primary-dark);
    font-weight: 800;
}

.row-actions form {
    margin: 0;
}

.quick-status,
.status-form,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.quick-status button {
    color: var(--gray-700);
    padding: 8px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.order-detail-grid h3 {
    margin: 0 0 10px;
}

.order-detail-grid p {
    margin: 5px 0;
}

.admin-totals {
    display: grid;
    gap: 8px;
    width: min(340px, 100%);
    margin-left: auto;
    margin-top: 18px;
}

.admin-totals div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.admin-totals .total {
    color: var(--primary-dark);
    font-size: 1.16rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkbox-row {
    display: flex;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
}

.form-preview {
    width: 140px;
    height: 110px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.logo-preview {
    height: 70px;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
}

.skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
    animation: skeleton-sweep 1.2s ease-in-out infinite;
}

@keyframes skeleton-sweep {
    to {
        transform: translateX(100%);
    }
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.login-card {
    padding: 24px;
}

.login-card .alert {
    width: 100%;
    margin: 0;
}

@media (max-width: 1080px) {
    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (min-width: 821px) and (max-width: 1279px) {
    .admin-stats {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .admin-stats article {
        grid-column: span 3;
    }

    .admin-stats article:nth-child(n + 5) {
        grid-column: span 4;
    }
}

@media (max-width: 820px) {
    /* Bottom nav carries the install action on mobile; hide the header pill. */
    .header-install-button {
        display: none;
    }

    /* The standalone "View store" link is also in the hamburger menu; hide the
       duplicate here so the translated top bar isn't crowded. */
    .admin-bar-store {
        display: none;
    }

    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 24px;
        text-align: center;
    }

    .footer-col-brand {
        grid-column: 1 / -1;
    }

    .site-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .header-phone {
        display: none;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-overlay {
        background: linear-gradient(90deg, rgba(11, 31, 20, 0.88), rgba(11, 31, 20, 0.42));
    }

    .hero-cta {
        width: 100%;
    }

    .hero-btn {
        flex: 1 1 auto;
    }

    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-detail,
    .cart-layout,
    .checkout-layout,
    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .summary-panel,
    .checkout-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 78px 1fr;
    }

    .cart-item img {
        width: 78px;
        height: 78px;
    }

    .cart-item-controls {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 132px auto auto;
        min-width: 0;
    }

    .compact-cart-item .cart-item-controls {
        grid-template-columns: 1fr 132px;
    }

    .admin-table.orders-table .hide-sm {
        display: none;
    }

    .orders-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-search {
        width: 100%;
    }

    .admin-filters,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .bottom-nav {
        display: grid;
    }

    body {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 560px) {
    body {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    /* Hero on phone: stack the two CTAs full-width, one per line. */
    .hero-cta {
        flex-direction: column;
    }

    .hero-btn {
        flex: none;
        width: 100%;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-top .footer-col:not(.footer-col-brand) {
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--line);
        text-align: left;
    }

    .footer-col-brand {
        padding-bottom: 22px;
    }

    .footer-col:not(.footer-col-brand) .footer-col-head {
        width: 100%;
        justify-content: space-between;
        padding: 16px 2px;
        cursor: pointer;
    }

    .footer-col:not(.footer-col-brand) .footer-chevron {
        display: inline-block;
    }

    .footer-col:not(.footer-col-brand) .footer-col-body {
        align-items: flex-start;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 2px;
        transition: max-height 260ms ease, opacity 200ms ease, padding 260ms ease;
    }

    .footer-col:not(.footer-col-brand).open .footer-col-body {
        max-height: 340px;
        opacity: 1;
        padding-bottom: 18px;
    }

    .footer-col:not(.footer-col-brand).open .footer-chevron {
        transform: rotate(180deg);
    }

    .footer-col:not(.footer-col-brand) .footer-nav,
    .footer-col:not(.footer-col-brand) .footer-info,
    .footer-col:not(.footer-col-brand) .footer-contact {
        align-items: flex-start;
        width: 100%;
    }

    .section-shell,
    .admin-main {
        width: min(100% - 22px, 1180px);
    }

    .section-heading,
    .admin-card-heading,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-card h3,
    .product-card p {
        min-height: 0;
    }

    /* compact the card a touch so two fit comfortably on small phones */
    .product-info {
        gap: 6px;
        padding: 10px;
    }

    .product-card h3 {
        font-size: 0.84rem;
    }

    .price-row strong {
        font-size: 1.02rem;
    }

    .card-add {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .cart-controls {
        grid-template-columns: 1fr;
    }

    .product-actions {
        grid-template-columns: 1fr auto;
    }

    .cart-item-controls {
        grid-template-columns: 1fr 132px;
    }

    .cart-item-controls strong {
        align-self: center;
    }

    .cart-item-controls button[data-cart-remove] {
        justify-self: end;
    }

    .cart-drawer {
        width: 100%;
    }

    .toast {
        right: 12px;
        bottom: 84px;
        left: 12px;
        justify-content: space-between;
    }

    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-status {
        min-width: 220px;
    }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── PWA install affordances ── */
/* Desktop header "Install app" pill */
.header-install-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--line));
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--primary) 10%, var(--card));
    color: var(--primary-dark);
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.header-install-button:hover {
    background: color-mix(in srgb, var(--primary) 16%, var(--card));
    border-color: var(--primary);
}

/* Bottom-nav install item gets a subtle green tint so it stands out */
.bottom-nav-install {
    color: var(--primary);
}

/* iOS "Add to Home Screen" instructions sheet */
.pwa-sheet {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .pwa-sheet { align-items: center; }
}

.pwa-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 13, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.pwa-sheet-card {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100% - 24px));
    margin: 0 0 calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 22px 20px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--card);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@media (min-width: 768px) {
    .pwa-sheet-card { margin-bottom: 0; }
}

.pwa-sheet-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
}

.pwa-sheet-title {
    margin: 0 0 6px;
    font-family: "Nunito", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--foreground);
}

.pwa-sheet-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.pwa-sheet-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: none;
    color: var(--muted-foreground);
    display: inline-grid;
    place-items: center;
    padding: 4px;
    border-radius: 50%;
    transition: color 150ms ease, background-color 150ms ease;
}

.pwa-sheet-close:hover { color: var(--foreground); background: var(--gray-100); }

[dir="rtl"] .pwa-sheet-close {
    right: auto;
    left: 10px;
}

body.pwa-sheet-open {
    overflow: hidden;
}

@media print {
    .admin-bar,
    .admin-menu,
    .admin-topbar,
    .no-print,
    .alert {
        display: none !important;
    }

    .admin-body {
        display: block;
        background: #fff;
    }

    .admin-main {
        width: 100%;
        padding: 0;
    }

    .admin-card {
        border: 0;
        box-shadow: none;
    }
}

/* ── Announcement + store closed bars ── */
.announcement-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    border-bottom: 1px solid color-mix(in srgb, #fff 20%, transparent);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.announcement-bar span {
    max-width: min(100%, 960px);
    overflow-wrap: anywhere;
}

.store-closed-bar {
    padding: 9px 16px;
    background: #fdecea;
    color: #9a1f16;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid #f3c4be;
}

@media (max-width: 560px) {
    .announcement-bar {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 0.84rem;
    }
}

/* ── Footer owner-login link ── */
.owner-login-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.82rem;
    opacity: 0.75;
}

.owner-login-link:hover {
    color: var(--primary-dark);
    opacity: 1;
}

/* ── Product marketing badges ── */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    z-index: 1;
}

.product-badge {
    border-radius: var(--radius-pill);
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.4;
}

.badge-offer { background: var(--accent); color: var(--accent-foreground); }
.badge-low   { background: color-mix(in srgb, var(--foreground) 80%, transparent); color: var(--background); font-weight: 700; }
.badge-out   { background: var(--danger); color: #fff; font-weight: 700; }
/* legacy aliases */
.badge-best  { background: var(--primary); color: #fff; }
.badge-new   { background: #dceaff; color: #124b91; }

.empty-illustration {
    width: 120px;
    height: auto;
    margin-bottom: 4px;
    opacity: 0.9;
}

/* ── Checkout notice + minimum order ── */
.checkout-notice {
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    background: #f5fbf7;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.checkout-notice strong { color: var(--primary-dark); }
.checkout-notice p { margin: 6px 0 0; color: var(--gray-700); }

.min-order-note {
    margin: 0;
    color: var(--warning);
    font-size: 0.88rem;
    font-weight: 700;
}

/* ── Admin notification bell ── */
.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notif {
    position: relative;
}

.notif-bell {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.notif-dropdown-head strong { font-size: 0.95rem; }

.notif-dropdown-head a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}

.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--gray-50); }

.notif-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.notif-item-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.notif-empty {
    margin: 0;
    padding: 22px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.notif-bell:hover { border-color: var(--primary); color: var(--primary-dark); }

.notif-bell.has-pending {
    border-color: var(--accent);
    color: var(--warning);
    background: #fff8ec;
}

.notif-bell-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.notif-bell.ring svg {
    transform-origin: top center;
    animation: bell-ring 0.7s ease;
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(16deg); }
    40% { transform: rotate(-14deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-6deg); }
}

.admin-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9998;
    display: grid;
    gap: 2px;
    min-width: 250px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    background: #16261d;
    color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    transform: translateX(120%);
    transition: transform 250ms ease;
}

.admin-toast.show { transform: translateX(0); }
.admin-toast strong { font-size: 0.95rem; }
.admin-toast span { font-size: 0.82rem; color: #c9dccf; }

@media (max-width: 560px) {
    .admin-toast { right: 12px; left: 12px; min-width: 0; }
}

/* ── RTL (Arabic UI) ── */
[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', 'Nunito Sans', system-ui, sans-serif;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] .admin-topbar h1 {
    font-family: 'Noto Sans Arabic', 'Nunito', system-ui, sans-serif;
}

/* In RTL, CSS grid tracks mirror automatically: column 1 (brand/logo) sits on
   the right and column 2 (actions) on the left. Do NOT swap grid-column here —
   doing so double-flips the layout and pushes the title to the wrong side. */
[dir="rtl"] .brand-text {
    text-align: right;
}

[dir="rtl"] .admin-bar .admin-logo {
    text-align: right;
}

[dir="rtl"] .search-field .search-icon {
    left: auto;
    right: 14px;
}

[dir="rtl"] .search-field input {
    padding-left: 40px;
    padding-right: 40px;
}

[dir="rtl"] .search-field .search-clear {
    right: auto;
    left: 10px;
}

[dir="rtl"] .sort-field .sort-icon {
    left: auto;
    right: 12px;
}

[dir="rtl"] .sort-field select {
    padding-left: 32px;
    padding-right: 36px;
}

[dir="rtl"] .sort-field .sort-caret {
    right: auto;
    left: 10px;
}

[dir="rtl"] .cart-drawer {
    right: auto;
    left: 0;
    transform: translateX(-104%);
    border-left: none;
    border-right: 1px solid var(--line);
}

[dir="rtl"] .cart-drawer-open .cart-drawer {
    transform: translateX(0);
}

[dir="rtl"] .admin-toast {
    right: auto;
    left: 18px;
    border-left: none;
    border-right: 4px solid var(--accent);
    transform: translateX(-120%);
}

[dir="rtl"] .admin-toast.show {
    transform: translateX(0);
}

[dir="rtl"] .footer-chevron {
    transform: scaleX(-1);
}

[dir="rtl"] .footer-col.open .footer-chevron {
    transform: scaleX(-1) rotate(180deg);
}

@media (max-width: 520px) {
    .lang-switch {
        width: 96px;
    }

    .lang-switch-seg {
        min-height: 32px;
        font-size: 0.65rem;
    }

    .lang-switch-seg-ar .lang-switch-text {
        font-size: 0.7rem;
    }

    .header-cart-button {
        padding: 9px 11px;
    }

    .header-cart-label {
        display: none;
    }

    .admin-bar-store {
        display: none;
    }

    .admin-bar-right {
        gap: 8px;
    }

    .admin-bar-right .lang-switch {
        width: 92px;
    }
}

@media (max-width: 380px) {
    .brand-text {
        font-size: 1rem;
    }

    .lang-switch {
        width: 88px;
    }
}

/* ── Arabic (RTL) admin dropdown: open on the right, under the toggle ── */
[dir="rtl"] .admin-menu {
    left: auto;
    right: max(16px, calc((100% - 1180px) / 2));
}

/* ── Dashboard: pending alert + cards (replaces inline styles) ── */
.pending-alert .admin-card-heading {
    border-bottom: 2px solid #f2b84b;
    padding-bottom: 12px;
}

.pending-alert .admin-card-heading h2 {
    color: #a05a00;
}

.pending-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.pending-order-card {
    display: block;
    padding: 14px;
    background: #fffbf5;
    border: 1px solid #f2b84b;
    border-radius: var(--radius);
    text-decoration: none;
    transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.pending-order-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.pending-order-card .po-code {
    margin: 0 0 4px;
    font-weight: 700;
    color: #334238;
}

.pending-order-card .po-name {
    margin: 0 0 4px;
    font-size: 0.88rem;
    color: #66736b;
}

.pending-order-card .po-meta {
    margin: 0;
    font-size: 0.88rem;
    color: #334238;
}

.pending-order-card .po-cta {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f8a4c;
}

/* ── Responsive admin tables: stack into cards on small screens ── */
@media (max-width: 1200px) {
    .admin-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

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

    .admin-table tr {
        margin-bottom: 12px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow-sm);
    }

    .admin-table tr:hover td {
        background: transparent;
    }

    .admin-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border: 0;
        border-bottom: 1px solid var(--line);
        text-align: right;
    }

    .admin-table td:last-child {
        border-bottom: 0;
    }

    .admin-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #415248;
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        text-align: left;
    }

    /* cells without a label (image, actions) span full width */
    .admin-table td:not([data-label])::before,
    .admin-table td[data-label=""]::before {
        content: none;
    }

    .admin-table td.num {
        text-align: right;
    }

    /* action cell where the td itself holds the buttons: right-align, no label */
    .admin-table td.row-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-table td.row-actions::before {
        content: none;
    }

    [dir="rtl"] .admin-table td {
        text-align: left;
    }

    [dir="rtl"] .admin-table td::before {
        text-align: right;
    }
}

@media (max-width: 820px) {
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-stats article,
    .admin-stats article:nth-child(n + 5) {
        grid-column: span 1;
    }

    .admin-stats article:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-stats article,
    .admin-stats article:nth-child(n + 5),
    .admin-stats article:last-child:nth-child(odd) {
        grid-column: 1;
    }
}

/* Keep the medium-width dashboard deliberately balanced: four cards on the
   first row and three equal cards on the second. This final rule sits after
   the legacy auto-fit breakpoints so they cannot reintroduce a 6 + 1 layout. */
@media (min-width: 821px) and (max-width: 1279px) {
    .admin-stats {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .admin-stats article {
        grid-column: span 3;
    }

    .admin-stats article:nth-child(n + 5) {
        grid-column: span 4;
    }
}

/* ---- Binary QA 2026-10 ---- */
/* Closed cart drawer: no shadow leaking into the page edge, not focusable */
.cart-drawer {
    box-shadow: none;
    visibility: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, visibility 0s linear 180ms;
}
.cart-drawer-open .cart-drawer {
    box-shadow: -24px 0 50px rgba(17, 31, 22, 0.18);
    visibility: visible;
    transition: transform 180ms ease, box-shadow 180ms ease, visibility 0s;
}
[dir="rtl"] .cart-drawer-open .cart-drawer {
    box-shadow: 24px 0 50px rgba(17, 31, 22, 0.18);
}
/* The bottom nav carries "Install" on phones; the header pill was re-shown by a later rule. */
@media (max-width: 820px) {
    .header-install-button { display: none !important; }
}
/* Hero buttons side by side on phones, never stacked */
@media (max-width: 560px) {
    .hero-cta {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
    }
    .hero-btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
        white-space: nowrap;
    }
}

/* ── Binary QA 2026-10 (pass 2) ── */
/* No floating boxes: toolbar and order summaries scroll with the page */
.shop-toolbar {
    position: static;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding-top: 4px;
}
.summary-panel,
.checkout-summary {
    position: static;
}

/* Full store name on phones instead of "Hawa Mini Mar…" */
@media (max-width: 430px) {
    .brand { gap: 8px; }
    .brand-text { font-size: 1rem; letter-spacing: -0.02em; }
    .sort-field select { max-width: 34vw; padding: 0 28px 0 34px; }
    .search-field input[type="search"] { padding: 0 36px 0 40px; font-size: 0.9rem; }
}
@media (max-width: 370px) {
    .brand-text { font-size: 0.92rem; }
}

/* Product rows: 2 columns on phones, 4 from tablets up (no lonely last card) */
@media (min-width: 760px) {
    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 759px) {
    .product-grid,
    .product-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Order pages: buttons side by side, readable quantities */
.order-actions {
    display: flex;
    gap: 10px;
}
.order-actions > a {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}
.order-missing { text-align: center; }
.order-missing .order-actions { justify-content: center; margin-top: 18px; }
.order-missing .order-actions > a { flex: 0 1 auto; padding-inline: 28px; }
.qty-label {
    color: var(--muted-foreground, var(--muted));
    font-weight: 600;
    white-space: nowrap;
}
.summary-item .qty-label { margin-inline-start: 6px; }
.order-code-title span { display: block; font-size: 0.55em; color: var(--muted-foreground, var(--muted)); letter-spacing: 0; }
.order-code-title bdi { font-size: clamp(1.5rem, 6.4vw, 2.2rem); letter-spacing: -0.02em; white-space: nowrap; }
.order-status-panel { background: color-mix(in srgb, var(--primary) 6%, var(--panel)); }
@media (max-width: 420px) {
    .order-actions > a { font-size: 0.9rem; padding-inline: 10px; }
}

/* ── Admin polish (Binary QA 2026-10) ── */
.admin-logo-short { display: none; }
@media (max-width: 480px) {
    .admin-logo-full { display: none; }
    .admin-logo-short { display: inline; }
}

/* Confirm button: white label on green everywhere (table link colour was winning) */
.row-actions a.confirm-btn,
.confirm-btn,
.confirm-btn:hover { color: #fff; }

/* Edit and Delete look like a matching pair */
.row-actions a.edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary) 8%, var(--panel));
    color: var(--primary-dark);
    font-weight: 800;
}
.row-actions a.edit-button:hover { background: color-mix(in srgb, var(--primary) 14%, var(--panel)); }
.row-actions .danger-button { min-height: 36px; }

/* Forms: a clear way back instead of a repeated title */
.form-back-row { justify-content: flex-start; }
.back-link .back-arrow { margin-inline-start: -4px; }
[dir="rtl"] .back-link .back-arrow { transform: scaleX(-1); }

/* Dashboard numbers: two per row on phones, the odd one fills the row */
@media (max-width: 480px) {
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .admin-stats article,
    .admin-stats article:nth-child(n + 5) { grid-column: auto; padding: 14px; }
    .admin-stats article:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Stacked order items: hide empty note rows */
@media (max-width: 1200px) {
    .admin-table td.is-empty { display: none; }
}
