/* ═══════════════════════════════════════════════════════════
   Foodia Electronic Menu — Main Stylesheet
   CSS Variables are injected by Razor views per company
   ═══════════════════════════════════════════════════════════ */

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

:root {
    --primary:    #FF6B35;
    --secondary:  #2C3E50;
    --accent:     #FFC107;
    --bg:         #F8F9FA;
    --text:       #212529;
    --card-bg:    #FFFFFF;
    --font:       'Cairo', sans-serif;
    --radius:     12px;
    --shadow:     0 2px 12px rgba(0,0,0,.10);
    --transition: .2s ease;
    --header-h:   70px;
    --catbar-h:   54px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ─── HEADER ─────────────────────────────────────────────── */
.menu-header, .branch-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.menu-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    min-height: var(--header-h);
}

.menu-logo, .branch-logo {
    height: 48px;
    width: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    padding: 2px;
}

.menu-title, .branch-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.menu-branch-name {
    font-size: .85rem;
    opacity: .85;
    margin-top: 2px;
}

.menu-header-text { flex: 1; }

.lang-btn {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}
.lang-btn:hover { background: rgba(255,255,255,.35); }

.menu-banner img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
}

/* ─── BRANCH PAGE ─────────────────────────────────────────── */
.branch-page { min-height: 100vh; }

.branch-header {
    text-align: center;
    padding: 32px 16px 24px;
    position: relative;
}
.branch-header .branch-logo {
    height: 72px;
    width: 72px;
    margin-bottom: 12px;
}
.branch-subtitle {
    opacity: .8;
    margin: 6px 0 16px;
    font-size: .95rem;
}
.branch-header .lang-btn { margin: 0 auto; }

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 24px 16px 40px;
    max-width: 960px;
    margin: 0 auto;
}

.branch-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.branch-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.branch-card-icon { font-size: 2.5rem; }

.branch-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.branch-card-address, .branch-card-phone {
    font-size: .85rem;
    opacity: .75;
}

.branch-card-btn {
    margin-top: 8px;
    background: var(--primary);
    color: #fff;
    padding: 8px 22px;
    border-radius: 20px;
    font-size: .9rem;
    font-weight: 600;
}

/* ─── CATEGORY BAR ────────────────────────────────────────── */
.cat-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--secondary);
    overflow-x: auto;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}
.cat-btn:hover { background: rgba(255,255,255,.25); }
.cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #212529;
    font-weight: 700;
}

/* ─── MAIN ────────────────────────────────────────────────── */
.menu-main {
    padding: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.menu-section { margin-bottom: 32px; }
.menu-section.hidden { display: none; }

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    padding: 6px 0 12px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 14px;
}

/* ─── ITEMS GRID ──────────────────────────────────────────── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

@media (min-width: 600px)  { .items-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (min-width: 900px)  { .items-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

/* ─── ITEM CARD ───────────────────────────────────────────── */
.item-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

.item-img-wrap {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-img { width: 100%; height: 100%; object-fit: cover; }
.item-img-placeholder { font-size: 2.5rem; opacity: .4; }

.item-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-name {
    font-size: .97rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.item-desc {
    font-size: .78rem;
    opacity: .65;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.item-badge {
    font-size: .72rem;
    background: var(--accent);
    color: #212529;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.modal-overlay.open { display: flex; }

@media (min-width: 640px) {
    .modal-overlay { align-items: center; padding: 16px; }
}

.modal-box {
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 20px 16px 28px;
    animation: slideUp .25s ease;
}
@media (min-width: 640px) {
    .modal-box { border-radius: var(--radius); }
}

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

.modal-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 14px;
    background: rgba(0,0,0,.08);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,.18); }

.modal-img-wrap {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-img { width: 100%; height: 100%; object-fit: cover; }
.modal-img-ph { font-size: 4rem; opacity: .3; }

.modal-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.modal-desc { font-size: .9rem; opacity: .7; margin-bottom: 12px; line-height: 1.5; }
.modal-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }

.modal-section-title {
    font-size: .95rem;
    font-weight: 700;
    margin: 14px 0 8px;
    color: var(--secondary);
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.size-list, .extra-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.size-item, .extra-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: .9rem;
    background: var(--bg);
}

.size-price, .extra-price {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.must-badge {
    font-size: .7rem;
    background: #e74c3c;
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    margin-inline-start: 6px;
}

/* ─── CART FAB ────────────────────────────────────────────── */
.cart-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 150;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(37,211,102,.45);
    transition: transform var(--transition), box-shadow var(--transition);
}
.cart-fab:hover { transform: scale(1.05); }

.cart-badge {
    background: #e74c3c;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─── CART PANEL ──────────────────────────────────────────── */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 155;
}
.cart-overlay.open { display: block; }

.cart-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(380px, 100vw);
    background: #fff;
    z-index: 160;
    transform: translateX(110%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.cart-panel.open { transform: translateX(0); }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--secondary);
    color: #fff;
    flex-shrink: 0;
}
.cart-header h3 { font-size: 1.1rem; font-weight: 700; }
.cart-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-body { flex: 1; overflow-y: auto; padding: 12px; }
.cart-empty { text-align: center; opacity: .5; margin-top: 40px; font-size: .95rem; }

.cart-item-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .95rem; font-weight: 700; word-break: break-word; }
.cart-item-extras { font-size: .8rem; color: #888; margin-top: 2px; }
.cart-item-note { font-size: .8rem; color: #666; margin-top: 2px; }
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 4px 10px;
}
.cart-qty-ctrl button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 2px;
    font-weight: 700;
    color: var(--primary);
}
.cart-qty-ctrl span {
    font-size: .9rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cart-item-price { font-size: .9rem; font-weight: 700; color: var(--primary); }
.remove-btn { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .5; padding: 0; }
.remove-btn:hover { opacity: 1; }

.cart-footer {
    padding: 14px 16px;
    border-top: 2px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
    flex-direction: column;
    gap: 10px;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.whatsapp-btn {
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}
.whatsapp-btn:hover { background: #1da854; }
.clear-cart-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px;
    font-family: var(--font);
    font-size: .9rem;
    cursor: pointer;
    color: #999;
    width: 100%;
    transition: var(--transition);
}
.clear-cart-btn:hover { border-color: #e74c3c; color: #e74c3c; }

/* ─── INTERACTIVE MODAL ───────────────────────────────────── */
.size-options, .extra-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.size-option, .extra-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.size-option:has(input:checked),
.extra-option:has(input:checked) {
    border-color: var(--primary);
    background: #f0f4ff;
}
.size-option input,
.extra-option input { accent-color: var(--primary); flex-shrink: 0; }

.option-name { flex: 1; font-size: .92rem; }
.option-price { font-size: .88rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.max-note { font-size: .75rem; font-weight: 400; opacity: .6; margin-inline-start: 4px; }

.qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 4px;
}
.qty-label { font-weight: 600; font-size: .95rem; }
.qty-control { display: flex; align-items: center; gap: 12px; }
.qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}
.qty-btn:hover { opacity: .85; }
.qty-display { font-size: 1.1rem; font-weight: 700; min-width: 30px; text-align: center; }

.item-note-input {
    width: 100%;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: var(--font);
    font-size: .9rem;
    resize: none;
    margin-top: 12px;
    transition: border-color var(--transition);
}
.item-note-input:focus { border-color: var(--primary); outline: none; }

.add-to-cart-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: opacity var(--transition);
}
.add-to-cart-btn:hover { opacity: .9; }

/* ─── ORDER DETAILS MODAL ─────────────────────────────────── */
.order-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 210;
}
.order-overlay.open { display: block; }

.order-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 220;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transform: translateY(105%);
    transition: transform .3s ease;
}
.order-modal.open { transform: translateY(0); pointer-events: auto; }

.order-modal-inner {
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: min(480px, 100vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px 36px;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.order-modal-header h3 { font-size: 1.15rem; font-weight: 700; }
.order-modal-header button {
    background: rgba(0,0,0,.08);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-label {
    font-size: .9rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 16px 0 8px;
    display: block;
}

.order-type-btns,
.payment-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.order-type-btn,
.payment-btn {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    background: #fff;
    text-align: center;
    transition: var(--transition);
    color: var(--text);
}
.order-type-btn:hover,
.payment-btn:hover { border-color: var(--primary); }
.order-type-btn.selected,
.payment-btn.selected {
    border-color: var(--primary);
    background: #f0f4ff;
    color: var(--primary);
}

.order-input {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: var(--font);
    font-size: .95rem;
    transition: border-color var(--transition);
    background: #fafafa;
    color: var(--text);
}
.order-input:focus { border-color: var(--primary); outline: none; background: #fff; }
.order-note { resize: none; }

.submit-order-btn {
    width: 100%;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background var(--transition);
}
.submit-order-btn:hover { background: #1da854; }

/* ─── TOAST ───────────────────────────────────────────────── */
.cart-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(0,0,0,.82);
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-family: var(--font);
    font-size: .9rem;
    z-index: 350;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    white-space: nowrap;
}
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── EXTRA QTY MODE (GroupType = 1) ─────────────────────── */
.extra-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    transition: border-color var(--transition), background var(--transition);
}
.extra-qty-row.active {
    border-color: var(--primary);
    background: #f0f4ff;
}

.extra-qty-label {
    flex: 1;
    min-width: 0;
}
.extra-qty-label .option-name { display: block; }
.extra-qty-label .option-price { display: block; font-size: .82rem; }

.extra-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 4px 10px;
    flex-shrink: 0;
}
.extra-qty-btn {
    background: none;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: opacity var(--transition);
}
.extra-qty-btn:disabled { opacity: .3; cursor: default; }
.extra-qty-val {
    font-size: .9rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* ─── MUST-SELECT HIGHLIGHT ───────────────────────────────── */
@keyframes mustShake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.must-highlight {
    color: #e74c3c !important;
    animation: mustShake .4s ease;
}

/* ─── DISABLED CHECKBOX STYLING ───────────────────────────── */
.extra-option:has(input:disabled:not(:checked)) {
    opacity: .45;
    cursor: not-allowed;
}
.extra-option input[type="checkbox"]:disabled { cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════
   STYLE: cards — Category tile grid + items screen
   ═══════════════════════════════════════════════════════════ */

.cat-cards-screen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 16px;
    max-width: 1100px;
    margin: 0 auto;
}
@media (min-width: 600px) { .cat-cards-screen { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (min-width: 900px) { .cat-cards-screen { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }

.cat-card-tile {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
    background: var(--secondary);
    transition: transform var(--transition), box-shadow var(--transition);
}
.cat-card-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.20);
}

.cat-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cat-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: .5;
}

.cat-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
    padding: 28px 12px 12px;
    color: #fff;
}
.cat-card-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}
.cat-card-count {
    display: block;
    font-size: .8rem;
    opacity: .8;
    margin-top: 3px;
}

.cat-back-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--secondary);
    position: sticky;
    top: var(--header-h);
    z-index: 89;
}
.cat-back-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}
.cat-back-btn:hover { background: rgba(255,255,255,.3); }
.cat-back-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-items-group { display: none; }

/* ═══════════════════════════════════════════════════════════
   STYLE: sidebar — Sticky category column + scrollable items
   ═══════════════════════════════════════════════════════════ */

.sidebar-layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
}
[dir="rtl"] .sidebar-layout { flex-direction: row-reverse; }

.sidebar-nav {
    width: 180px;
    flex-shrink: 0;
    background: var(--secondary);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-cat-btn {
    display: block;
    width: 100%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 500;
    text-align: start;
    line-height: 1.3;
    transition: var(--transition);
}
.sidebar-cat-btn:hover { background: rgba(255,255,255,.22); }
.sidebar-cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #212529;
    font-weight: 700;
}

.sidebar-content { flex: 1; min-width: 0; }

@media (max-width: 599px) {
    .sidebar-layout { flex-direction: column; }
    [dir="rtl"] .sidebar-layout { flex-direction: column; }
    .sidebar-nav {
        width: 100%;
        height: auto;
        position: sticky;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 12px;
    }
    .sidebar-cat-btn {
        flex-shrink: 0;
        width: auto;
        white-space: nowrap;
        border-radius: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════
   STYLE: compact — Horizontal list rows with small thumbnails
   ═══════════════════════════════════════════════════════════ */

.compact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px 12px;
    cursor: pointer;
    min-height: 72px;
    transition: transform var(--transition), box-shadow var(--transition);
}
.compact-item:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.13);
}
[dir="rtl"] .compact-item:hover { transform: translateX(2px); }

.compact-img {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.compact-img-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    opacity: .5;
}

.compact-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.compact-name {
    font-size: .97rem;
    font-weight: 700;
    line-height: 1.3;
}
.compact-desc {
    font-size: .78rem;
    opacity: .6;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.compact-price {
    font-size: .97rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
