:root {
    --primary: #f25c05;
    --primary-hover: #d94f02;
    --primary-soft: #fef0e7;
    --primary-ring: rgba(242, 92, 5, .18);
    --bg: #fbf8f5;
    --surface: #ffffff;
    --surface-2: #f6f1ec;
    --text: #1d1f22;
    --muted: #6f7783;
    --border: #ece4dc;
    --danger: #d92d20;
    --danger-soft: #fdecea;
    --success: #12805c;
    --success-soft: #e6f5ef;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 9px;
    --sh-sm: 0 1px 2px rgba(28, 20, 12, .05), 0 4px 12px rgba(28, 20, 12, .04);
    --sh-md: 0 8px 28px rgba(28, 20, 12, .10);
    --sh-lg: 0 24px 60px rgba(28, 20, 12, .18);
    --ease: cubic-bezier(.22, .61, .36, 1);
    --nav-h: 68px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --primary: #ff7a2f;
    --primary-hover: #ff8f4d;
    --primary-soft: #3a2113;
    --primary-ring: rgba(255, 122, 47, .22);
    --bg: #121316;
    --surface: #1b1d21;
    --surface-2: #24272c;
    --text: #f2f0ee;
    --muted: #9aa2ad;
    --border: #2e3238;
    --danger: #ff6b5e;
    --danger-soft: #3a1d1a;
    --success: #4ade9f;
    --success-soft: #14312a;
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-md: 0 8px 28px rgba(0, 0, 0, .45);
    --sh-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: var(--bg);
    color: var(--text);
}

::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 50%, transparent);
    border-radius: 99px;
    border: 4px solid var(--bg);
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    border: 4px solid var(--bg);
    background-clip: padding-box;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    width: 100vw;
    overflow-x: hidden;
}

html[dir="rtl"] body {
    font-family: var(--font-ar, 'Noto Naskh Arabic'), 'Segoe UI', system-ui, sans-serif;
}

body.locked {
    overflow: hidden;
}

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

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

button {
    background: none;
    border: none;
    cursor: pointer;
}

svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sprite {
    display: none;
}

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

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

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

.skip-link {
    position: fixed;
    top: -60px;
    left: 12px;
    z-index: 3000;
    background: var(--primary);
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-weight: 600;
    transition: top .2s;
}

.skip-link:focus {
    top: 0;
}

.announcement {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: .55rem 1rem;
    font-size: .88rem;
    font-weight: 500;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: .7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.search-bar {
    flex: 1;
    max-width: 520px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-glyph {
    position: absolute;
    inset-inline-start: .9rem;
    font-size: 1.15rem;
    color: var(--muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: .68rem 2.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: .94rem;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.search-bar input::-webkit-search-cancel-button {
    display: none;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.search-clear {
    position: absolute;
    inset-inline-end: .55rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--border);
}

.search-clear[hidden] {
    display: none;
}

.search-clear:hover {
    color: var(--text);
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-inline-start: auto;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    color: var(--text);
    position: relative;
    transition: background .18s, color .18s;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--primary);
}

.icon-btn:active {
    transform: scale(.94);
}

.mobile-search-btn {
    display: none;
}

.badge {
    position: absolute;
    top: 3px;
    inset-inline-end: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    border: 2px solid var(--surface);
    transition: transform .22s var(--ease);
}

.badge.bump {
    transform: scale(1.32);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem calc(var(--nav-h) + 2rem);
}

.hero {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: var(--sh-md);
    background: var(--surface-2);
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .75rem 1.4rem;
    border-radius: var(--r-md);
    font-size: .94rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .18s, color .18s, border-color .18s, transform .12s;
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

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

.section-header h2 {
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -.015em;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.result-count {
    font-size: .84rem;
    color: var(--muted);
}

.select {
    padding: .5rem 2.1rem .5rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background-color: var(--surface);
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f7783' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
}

html[dir="rtl"] .select {
    padding: .5rem .85rem .5rem 2.1rem;
    background-position: left .6rem center;
}

.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.categories-section {
    margin-bottom: 2.25rem;
}

.categories {
    display: flex;
    gap: .6rem;
    overflow-x: auto;
    padding-bottom: .35rem;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.categories::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    padding: .55rem 1rem .55rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    scroll-snap-align: start;
    transition: background .18s, border-color .18s, color .18s, transform .12s;
}

.chip svg {
    font-size: 1.15rem;
    color: var(--muted);
    transition: color .18s;
}

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

.chip:hover svg {
    color: var(--primary);
}

.chip:active {
    transform: scale(.96);
}

.chip[aria-selected="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chip[aria-selected="true"] svg {
    color: #fff;
}

.product-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    contain: layout paint style;
    transition: border-color .18s, box-shadow .18s, transform .18s var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
    border-color: transparent;
}

.card-media {
    position: relative;
    aspect-ratio: 1;
    background: var(--surface-2);
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}

.card-media img.ph {
    object-fit: contain;
    padding: 22%;
    opacity: .85;
}

.card:hover .card-media img.ph {
    transform: none;
}

.card:hover .card-media img {
    transform: scale(1.05);
}

.card.out .card-media img {
    filter: grayscale(1);
    opacity: .55;
}

.card-open {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 0;
    cursor: pointer;
}

.tag {
    position: absolute;
    top: .55rem;
    inset-inline-start: .55rem;
    z-index: 2;
    padding: .2rem .5rem;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: var(--primary);
    color: #fff;
}

.tag.sale {
    background: var(--danger);
}

.tag.new {
    background: #2563eb;
}

.tag.popular {
    background: #7c3aed;
}

.tag.local {
    background: var(--success);
}

.out-pill {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    padding: .38rem .8rem;
    border-radius: 999px;
    background: rgba(20, 14, 10, .82);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.card-body {
    padding: .8rem .85rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
}

.card-name {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.card-unit {
    font-size: .78rem;
    color: var(--muted);
}

.card-stock {
    font-size: .74rem;
    font-weight: 600;
    color: #b45309;
    margin-top: .1rem;
}

[data-theme="dark"] .card-stock {
    color: #fbbf24;
}

.card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding-top: .6rem;
}

.price-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.price-old {
    font-size: .76rem;
    color: var(--muted);
    text-decoration: line-through;
}

.price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
}

.price.sale {
    color: var(--danger);
}

.price.lg {
    font-size: 1.3rem;
}

.add-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: var(--primary-soft);
    color: var(--primary);
    transition: background .16s, color .16s, transform .12s;
}

.add-btn:hover {
    background: var(--primary);
    color: #fff;
}

.add-btn:active {
    transform: scale(.9);
}

.add-btn:disabled {
    background: var(--surface-2);
    color: var(--muted);
    cursor: not-allowed;
}

.stepper {
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    background: var(--primary-soft);
    border-radius: 10px;
    padding: 2px;
}

.stepper button {
    width: 30px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: var(--primary);
    transition: background .14s;
}

.stepper button:hover {
    background: var(--surface);
}

.stepper button:active {
    transform: scale(.9);
}

.stepper span {
    min-width: 22px;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary);
}

.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: 3.5rem 1rem;
    text-align: center;
}

.state.compact {
    padding: 2.5rem 1rem;
}

.state[hidden] {
    display: none;
}

.state-icon {
    font-size: 2.4rem;
    color: var(--muted);
    opacity: .55;
    margin-bottom: .35rem;
}

.state h3 {
    font-size: 1.08rem;
    font-weight: 700;
}

.state p {
    color: var(--muted);
    font-size: .92rem;
    max-width: 34ch;
}

.state .btn {
    margin-top: .7rem;
}

.grid-skeleton {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    width: 100%;
}

.grid-skeleton::before,
.grid-skeleton::after {
    content: '';
}

.grid-skeleton>*,
.grid-skeleton::before,
.grid-skeleton::after {
    aspect-ratio: .78;
    border-radius: var(--r-md);
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
    background-size: 240% 100%;
    animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
    to {
        background-position: -240% 0;
    }
}

.footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-brand {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: .35rem;
}

.footer-line {
    font-size: .88rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.footer-line:empty {
    display: none;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: flex-start;
}

.footer-phone:hover {
    color: var(--primary);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

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

.bottom-nav {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 14, 10, .55);
    opacity: 0;
    transition: opacity .2s var(--ease);
}

.modal[hidden] {
    display: none;
}

.modal.open {
    opacity: 1;
}

.modal-card {
    width: 100%;
    max-width: 460px;
    max-height: min(88vh, 780px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    overflow: hidden;
    transform: translateY(14px) scale(.99);
    transition: transform .24s var(--ease);
}

.modal.open .modal-card {
    transform: none;
}

.modal-card.narrow {
    max-width: 380px;
}

.modal-card.wide {
    max-width: 560px;
}

.cart-card {
    max-width: 480px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-head h2 {
    font-size: 1.12rem;
    font-weight: 700;
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    color: var(--muted);
    transition: background .16s, color .16s;
}

.modal-close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.modal-body {
    padding: 1.3rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body.no-pad {
    padding: 0;
    gap: 0;
}

.modal-body.center {
    align-items: center;
    text-align: center;
    gap: .7rem;
    padding: 2rem 1.5rem;
}

.modal-foot {
    padding: 1.1rem 1.3rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

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

.row+.row {
    padding-top: .2rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
}

.stack>span {
    font-weight: 600;
    font-size: .92rem;
}

.muted {
    color: var(--muted);
    font-size: .9rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.field>span {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    padding: .68rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: .94rem;
    resize: vertical;
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.field input[aria-invalid="true"] {
    border-color: var(--danger);
}

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

.input-icon svg {
    position: absolute;
    inset-inline-start: .75rem;
    color: var(--muted);
    font-size: 1.05rem;
    pointer-events: none;
}

.input-icon input {
    padding-inline-start: 2.4rem;
}

.readonly-field {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .68rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: .9rem;
    font-weight: 500;
}

.readonly-field svg {
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1.05rem;
}

.address-picker {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    text-align: start;
    padding: .68rem .85rem;
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: .9rem;
    font-weight: 500;
    transition: border-color .16s, color .16s;
}

.address-picker:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.address-picker svg {
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1.05rem;
}

.field-error {
    padding: .6rem .8rem;
    border-radius: var(--r-sm);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: .86rem;
    font-weight: 600;
}

.field-error[hidden] {
    display: none;
}

.summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem .9rem;
    border-radius: var(--r-sm);
    background: var(--success-soft);
    color: var(--success);
    font-size: .88rem;
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--border);
    transition: background .22s;
    pointer-events: none;
}

.track::before {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .22s var(--ease);
}

.switch input:checked+.track {
    background: var(--primary);
}

.switch input:checked+.track::before {
    transform: translateX(20px);
}

html[dir="rtl"] .switch input:checked+.track::before {
    transform: translateX(-20px);
}

.switch input:focus-visible+.track {
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.cart-body {
    gap: .7rem;
}

.cart-line {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cart-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--surface-2);
}

.cart-thumb.ph,
.pm-media.ph {
    object-fit: contain;
    padding: 10px;
}

.pm-media.ph {
    padding: 3rem;
}

.cart-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.cart-name {
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.3;
}

.cart-meta {
    font-size: .78rem;
    color: var(--muted);
}

.cart-line-total {
    font-size: .9rem;
    font-weight: 700;
    min-width: 68px;
    text-align: end;
}

.totals {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.totals>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .9rem;
}

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

.totals dd {
    font-weight: 600;
}

.total-row {
    padding-top: .45rem;
    border-top: 1px solid var(--border);
    font-size: 1.02rem;
}

.total-row dt {
    color: var(--text);
    font-weight: 700;
}

.total-row dd {
    font-weight: 800;
    color: var(--primary);
}

.cart-hint {
    font-size: .84rem;
    color: var(--muted);
    text-align: center;
}

.cart-hint.warn {
    color: var(--danger);
    font-weight: 600;
}

.pm-media {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: var(--r-md);
    background: var(--surface-2);
}

.pm-name {
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.25;
}

.pm-desc {
    font-size: .92rem;
    color: var(--muted);
}

.pm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.map-wrap {
    position: relative;
    height: 280px;
    background: var(--surface-2);
    overflow: hidden;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 0;
}

.map-locate {
    position: absolute;
    bottom: .75rem;
    inset-inline-end: .75rem;
    z-index: 500;
    padding: .45rem .8rem;
    font-size: .82rem;
    box-shadow: var(--sh-sm);
}

.map-form {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.success-mark {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    background: var(--success-soft);
    color: var(--success);
    margin-bottom: .3rem;
}

.order-code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: .5rem 1rem;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.toast {
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 150%);
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .8rem 1.3rem;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: .9rem;
    font-weight: 600;
    box-shadow: var(--sh-md);
    transition: transform .32s var(--ease);
    max-width: calc(100vw - 2rem);
}

.toast[hidden] {
    display: none;
}

.toast.show {
    transform: translate(-50%, 0);
}

.toast svg {
    flex-shrink: 0;
    font-size: 1.15rem;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

/* Orders Tracking Modal */
.orders-body { padding: 1rem 1.2rem; }
.orders-lookup {
    margin-bottom: 1.5rem;
    max-width: 100%;
}
.orders-lookup input {
    padding-inline-end: 4.5rem;
}
.orders-lookup button {
    position: absolute;
    inset-inline-end: .4rem;
    padding: .35rem .8rem;
    border-radius: 99px;
    min-height: 28px;
    height: auto;
    font-size: .85rem;
}
.orders-list { display: flex; flex-direction: column; gap: 1rem; }
.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1.25rem;
    box-shadow: var(--sh-sm);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
}
.order-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
}
.order-code-badge {
    display: inline-block;
    padding: .25rem .6rem;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    font-size: .85rem;
    border-radius: var(--r-sm);
    margin-bottom: .4rem;
}
.order-date { font-size: .85rem; color: var(--muted); }
.order-total { font-weight: 800; font-size: 1.15rem; color: var(--text); }

.progress-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 1rem 0;
    margin-bottom: 1rem;
}
.progress-stepper::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--surface-2);
    z-index: 1;
}
.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 25%;
}
.step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 2px solid var(--surface);
    transition: background .2s, transform .2s;
}
.step-label {
    font-size: .75rem;
    color: var(--muted);
    font-weight: 500;
    text-align: center;
    transition: color .2s;
}
.step.active .step-dot { background: var(--primary); }
.step.active .step-label { color: var(--text); font-weight: 600; }
.step.current .step-dot { transform: scale(1.3); box-shadow: 0 0 0 3px var(--primary-ring); }
.step.current .step-label { color: var(--primary); }

.order-cancelled-note {
    background: var(--warn-soft);
    color: var(--warn);
    padding: .85rem;
    border-radius: var(--r-sm);
    font-size: .9rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1rem;
}
.order-cancelled-note a { color: var(--warn); font-weight: 700; text-decoration: underline; display: inline-block; margin-top: .3rem; }

.order-items-preview {
    font-size: .88rem;
    color: var(--text);
    background: var(--surface-2);
    padding: .85rem;
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.order-item-row {
    display: flex;
    gap: .5rem;
}
.order-item-row .qty { font-weight: 700; color: var(--primary); min-width: 24px; }
.order-item-row .name { flex: 1; }

.live-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--primary-ring); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px transparent; }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 860px) {
    .search-bar {
        display: none;
    }

    .search-bar.mobile-open {
        display: flex;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        max-width: none;
        padding: .7rem 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--sh-sm);
    }

    .search-bar.mobile-open .search-glyph {
        inset-inline-start: 1.75rem;
    }

    .search-bar.mobile-open .search-clear {
        inset-inline-end: 1.6rem;
    }

    .mobile-search-btn {
        display: grid;
    }

    .nav-container {
        position: relative;
        padding: .6rem 1rem;
        gap: .5rem;
    }

    .logo-text {
        font-size: 1.08rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.1rem 1rem calc(var(--nav-h) + 1.5rem);
    }

    .hero {
        border-radius: var(--r-md);
        margin-bottom: 1.75rem;
    }

    .product-grid,
    .grid-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: .75rem;
    }

    .card-body {
        padding: .65rem .7rem .7rem;
    }

    .card-name {
        font-size: .88rem;
    }

    .price {
        font-size: .98rem;
    }

    .section-header h2 {
        font-size: 1.14rem;
    }

    .footer {
        margin-bottom: var(--nav-h);
    }

    .footer-inner {
        padding: 1.5rem 1rem;
    }

    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        height: var(--nav-h);
        padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .18rem;
        font-size: .68rem;
        font-weight: 600;
        color: var(--muted);
        position: relative;
        transition: color .16s;
    }

    .nav-item svg {
        font-size: 1.35rem;
    }

    .nav-item.active {
        color: var(--primary);
    }

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

    .nav-item .badge {
        top: 6px;
        inset-inline-end: calc(50% - 22px);
        border-color: var(--surface);
    }

    .modal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-card,
    .modal-card.narrow,
    .modal-card.wide,
    .cart-card {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        transform: translateY(100%);
    }

    .modal.open .modal-card {
        transform: none;
    }

    .modal-body {
        padding-bottom: calc(1.3rem + env(safe-area-inset-bottom));
    }

    .modal-foot {
        padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(var(--nav-h) + 1rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}