/* Restaurant POS — واجهة الزبون */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.rpos-customer-app {
    margin: 0;
    font-family: "Tajawal", sans-serif;
    background: var(--page);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 120px;
}

.hero {
    position: relative;
    background: linear-gradient(165deg, var(--navy-deep) 0%, var(--navy) 100%);
    color: var(--surface);
    padding: 1rem 1rem 2rem;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: radial-gradient(circle at 20% 30%, var(--gold) 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-decor--tl,
.hero-decor--tr {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 50%;
    pointer-events: none;
}
.hero-decor--tl {
    top: -40px;
    left: -40px;
}
.hero-decor--tr {
    bottom: -30px;
    right: -30px;
}

.hero-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.qr-box {
    width: 56px;
    height: 56px;
    padding: 4px;
    background: var(--surface);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.qr-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.install-btn {
    display: none;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-soft);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.install-btn.show {
    display: inline-flex;
}

.hero-inner {
    text-align: center;
}

.hero-logo img {
    max-height: 72px;
    border-radius: 12px;
}

.hero-table {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.9rem;
}

.hero-kicker {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

.hero-title {
    margin: 0.35rem 0 0;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    font-weight: 800;
}

.categories-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--page);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

.categories-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

.categories {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.cat-btn {
    flex-shrink: 0;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
}

.cat-btn.is-active {
    background: var(--navy);
    color: var(--gold-soft);
    border-color: var(--navy);
}

.shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 0.75rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1100px) {
    .menu-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.product-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.product-img-wrap {
    aspect-ratio: 4/3;
    background: var(--page);
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.product-body {
    padding: 0.65rem 0.75rem;
    flex: 1;
}

.product-body h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

.product-desc {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-row {
    margin-top: 0.5rem;
    font-weight: 800;
    color: var(--gold);
}

.currency {
    font-size: 0.8rem;
    font-weight: 600;
}

.product-actions {
    padding: 0 0.75rem 0.75rem;
}

.add-btn {
    width: 100%;
    padding: 0.5rem;
    border-radius: 10px;
    border: none;
    background: var(--navy);
    color: var(--gold-soft);
    font-weight: 800;
    cursor: pointer;
}

.qty-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-weight: 800;
}

.qty-val {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
}

.cart-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.cart-bar__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cart-meta__title {
    font-weight: 800;
    display: block;
}

.cart-meta__sub {
    font-size: 0.85rem;
    color: var(--muted);
}

.cart-total-line {
    font-weight: 700;
}

.total-num {
    color: var(--gold);
    font-size: 1.15rem;
}

.order-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

.order-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qr-modal,
.order-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 1rem;
}

.qr-modal.show,
.order-modal.show {
    display: flex;
}

.qr-modal-content,
.order-modal-content {
    background: var(--surface);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem;
    text-align: center;
}

.order-modal-content {
    text-align: right;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-head h3 {
    margin: 0;
}

.close-btn {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.order-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.order-type-btn {
    padding: 0.65rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--page);
    cursor: pointer;
    font-weight: 700;
}

.order-type-btn.active {
    border-color: var(--navy);
    background: #f0f4f8;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.35rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.cart-qty-mini button {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.total-box {
    margin: 1rem 0;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--page);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-box .value {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--gold);
}

.pay-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fefce8;
    border-radius: 10px;
    font-size: 0.9rem;
}

.pay-info .num {
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    word-break: break-all;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.form-textarea {
    min-height: 4.5rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}

.rpos-delivery-wrap {
    margin-bottom: 0.35rem;
}

.rpos-field-label {
    display: block;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

.submit-final {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    border: none;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.alert-box {
    max-width: 480px;
    margin: 3rem auto;
    padding: 2rem;
    text-align: center;
}

.btn-back {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    background: var(--navy);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
}
