/* =========================================================
   MENU PAGE ONLY
   Mobile-first card design
   ========================================================= */

:root {
    --mp-orange: #e07b39;
    --mp-card: #f3f3f3;
    --mp-ink: #111;
    --mp-muted: #8a8a8a;
}


/* =========================================================
   صفحه و هدر
   ========================================================= */

body:has(.mp) {
    background: #fff;
    font-family: "Vazirmatn", sans-serif;
}

body:has(.mp) header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

body:has(.mp) .nav {
    min-height: 0;
    padding: 12px 12px 10px;
    background: transparent;
    border-bottom: 0;
}

/* یک ردیف: سه دکمه‌ی هم‌اندازه + دایره‌ی کوچک صفحه اصلی
   (ترتیب همان ترتیب base.html است) */
body:has(.mp) .nav-actions {
    width: 100%;
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow: visible;
    direction: rtl;
}

/* دایره‌ی کوچک صفحه اصلی: اولین مورد (سمت راست)، بدون نوشته */
body:has(.mp) .nav-actions .home-circle {
    order: -1;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    margin: 0;
    border: 1.5px solid var(--mp-ink);
    background: #fff;
    display: block;
    transform: none;
}

body:has(.mp) .nav-actions .home-circle::before,
body:has(.mp) .nav-actions .home-circle::after {
    content: none;
}

body:has(.mp) .nav-actions .home-circle:hover,
body:has(.mp) .nav-actions .home-circle:active {
    background: var(--mp-ink);
    transform: none;
}

/* سه دکمه: هم‌اندازه، هم‌رنگ، آیکن بالا و متن پایین */
body:has(.mp) .nav-actions .customer-btn,
body:has(.mp) .nav-actions .job-btn,
body:has(.mp) .nav-actions .cart-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    padding: 4px 3px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid var(--mp-ink);
    border-radius: 14px;
    background: #fff;
    color: var(--mp-ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

body:has(.mp) .nav-actions .customer-btn { order: 1; }
body:has(.mp) .nav-actions .job-btn      { order: 2; }
body:has(.mp) .nav-actions .cart-btn     { order: 3; }

body:has(.mp) .nav-actions .nav-icon {
    order: 0;
    width: auto;
    height: 16px;
    min-width: 0;
    flex: 0 0 auto;
    font-size: 15px;
}

body:has(.mp) .nav-actions .nav-text {
    order: 1;
    font-size: 11px;
    white-space: normal;
    text-wrap: balance;
}

body:has(.mp) .nav-actions .customer-btn:active,
body:has(.mp) .nav-actions .job-btn:active,
body:has(.mp) .nav-actions .cart-btn:active {
    background: #f1f1f1;
}

/* شمارنده‌ی سفارشات روی گوشه‌ی دکمه */
body:has(.mp) .nav-actions .cart-count {
    position: absolute;
    top: -7px;
    left: -5px;
    min-width: 19px;
    height: 19px;
    border: 2px solid #fff;
    background: var(--mp-orange);
}

@media (min-width: 480px) {
    body:has(.mp) .nav-actions .nav-text {
        font-size: 12.5px;
        white-space: nowrap;
    }
}

/* فوتر در صفحه منو لازم نیست */

body:has(.mp) footer {
    display: none;
}

body:has(.mp) #cartNotification {
    bottom: 96px;
}


/* =========================================================
   لیست و کارت‌های محصولات
   ========================================================= */

.mp {
    padding-bottom: 110px;
}

.mp-list {
    max-width: 560px;
    margin: 0 auto;
    padding: 6px 14px 0;
}

.mp-section {
    scroll-margin-top: 80px;
}

.mp-section-title {
    margin: 18px 6px 10px;

    font-size: 15px;
    font-weight: 800;

    color: var(--mp-ink);
}


/* کارت محصول */

.mp-card {
    margin-bottom: 12px;
    padding: 14px 14px 12px;

    border-radius: 18px;

    background: var(--mp-card);
}

.mp-card.is-unavailable {
    opacity: .55;
}


/* قسمت بالای کارت */

.mp-card-top {
    display: flex;
    align-items: center;
    gap: 12px;

    cursor: pointer;
}


/* عکس محصول */

.mp-thumb {
    flex: 0 0 74px;

    width: 74px;
    height: 74px;

    border-radius: 12px;
    overflow: hidden;

    background: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
}

.mp-thumb img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}


/* اطلاعات محصول */

.mp-info {
    flex: 1;
    min-width: 0;
}

.mp-info h3 {
    margin: 0 0 4px;

    font-size: 16px;
    font-weight: 800;

    color: var(--mp-ink);
}

.mp-info p {
    margin: 0;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;

    color: var(--mp-muted);
}


/* امتیاز */

.mp-rating {
    display: inline-block;

    margin-top: 4px;

    font-size: 11px;
    font-weight: 700;

    color: var(--mp-orange);
}


/* =========================================================
   پایین کارت
   ========================================================= */

.mp-card-bottom {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;

    gap: 10px;
    margin-top: 12px;
}


/* قیمت */

.mp-price {
    flex: 1;

    padding: 12px 14px;

    border-radius: 12px;

    background: #fafafa;

    color: var(--mp-ink);

    font-size: 14px;
    font-weight: 600;

    text-align: right;
}


/* کنترل تعداد */

.mp-stepper {
    display: flex;
    align-items: center;

    gap: 10px;

    direction: rtl;
}

.mp-stepper button {
    width: 44px;
    height: 44px;

    border: 0;
    border-radius: 50%;

    background: #fff;
    color: var(--mp-ink);

    font-family: inherit;
    font-size: 24px;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);

    transition: transform .12s ease;
}

.mp-stepper button:active {
    transform: scale(.92);
}

.mp-stepper span {
    min-width: 20px;

    text-align: center;

    font-size: 17px;
    font-weight: 600;
}


/* دکمه انتخاب قهوه */

.mp-coffee-btn {
    padding: 12px 22px;

    border: 1px solid var(--mp-orange);
    border-radius: 22px;

    background: #fff;
    color: var(--mp-ink);

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
    white-space: nowrap;
}

.mp-coffee-btn:active {
    background: #fff3ea;
}


/* ناموجود */

.mp-soldout {
    padding: 10px 16px;

    border-radius: 22px;

    background: #e4e4e4;
    color: #777;

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   لینک‌های اضافی
   ========================================================= */

.mp-extra-links {
    display: flex;
    justify-content: center;

    gap: 18px;

    margin: 26px 0 8px;
}

.mp-extra-links a,
.mp-extra-links button {
    padding: 0;

    border: 0;

    background: none;
    color: var(--mp-muted);

    font-family: inherit;
    font-size: 12px;

    text-decoration: none;

    cursor: pointer;
}


/* =========================================================
   نوار شناور پایین
   ۵ گزینه کاملاً مساوی
   ========================================================= */

.mp-dock {
    position: fixed;

    right: 50%;
    bottom: 10px;

    transform: translateX(50%);

    z-index: 60;

    display: grid;

    /* هر ۵ گزینه دقیقاً عرض مساوی */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);

    align-items: stretch;

    width: calc(100% - 16px);
    max-width: 560px;

    padding: 5px;

    gap: 2px;

    border-radius: 28px;

    background: #fff;

    box-shadow: 0 4px 22px rgba(0, 0, 0, .16);

    direction: rtl;

    /* جلوگیری از اسکرول */
    overflow: hidden;
}


/* هر گزینه */

.mp-dock button {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px 1px;

    border: 0;
    border-radius: 22px;

    background: transparent;
    color: var(--mp-ink);

    font-family: inherit;

    /* بزرگ‌تر از قبل */
    font-size: 11px;
    font-weight: 600;

    line-height: 1.2;

    white-space: nowrap;

    text-align: center;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        transform .12s ease;
}


/* دسته انتخاب‌شده */

.mp-dock button.active {
    background: var(--mp-orange);
    color: #fff;

    font-weight: 700;
}


/* حالت لمس */

.mp-dock button:active {
    transform: scale(.96);
}


/* =========================================================
   موبایل خیلی کوچک
   ========================================================= */

@media (max-width: 380px) {

    .mp-dock {
        width: calc(100% - 10px);

        bottom: 8px;

        padding: 4px;

        gap: 1px;
    }

    .mp-dock button {
        padding: 9px 0;

        font-size: 10px;
    }
}
/* =========================================================
   پنجره انتخاب قهوه - نسخه کوچک موبایل
========================================================= */

@media (max-width: 600px) {

    #coffeeModal {
        padding: 12px;
        align-items: center;
        overflow: hidden;
    }

    #coffeeModal .coffee-modal {
        width: min(92vw, 360px);
        max-height: calc(100vh - 24px);
        padding: 18px 16px 16px;
        border-radius: 20px;
        overflow: hidden;
    }

    #coffeeModal .coffee-modal-icon {
        width: 42px;
        height: 42px;
        margin: 0 auto 7px;
        font-size: 22px;
    }

    #coffeeModal .coffee-modal h3 {
        margin: 0 0 4px;
        font-size: 17px;
        line-height: 1.4;
    }

    #coffeeModal .coffee-modal-subtitle {
        margin: 0 0 12px;
        font-size: 11px;
        line-height: 1.5;
    }

    #coffeeModal .coffee-options {
        gap: 7px;
    }

    #coffeeModal .coffee-option {
        min-height: 52px;
        padding: 8px 10px;
        border-radius: 13px;
        gap: 9px;
    }

    #coffeeModal .coffee-option-icon {
        font-size: 20px;
    }

    #coffeeModal .coffee-option strong {
        font-size: 12px;
    }

    #coffeeModal .coffee-option small {
        font-size: 9px;
        margin-top: 2px;
    }

    #coffeeModal .coffee-quantity-title {
        margin: 11px 0 5px;
        font-size: 11px;
    }

    #coffeeModal .coffee-stepper {
        gap: 8px;
        margin-bottom: 10px;
    }

    #coffeeModal .coffee-stepper button {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    #coffeeModal .coffee-stepper span {
        min-width: 22px;
        font-size: 14px;
    }

    #coffeeModal .coffee-add-btn {
        width: 100%;
        min-height: 42px;
        padding: 9px 14px;
        border-radius: 13px;
        font-size: 12px;
    }

    #coffeeModal .modal-close-x {
        top: 9px;
        left: 9px;
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

}


/* =========================================================
   پنجره‌های «باشگاه مشتریان» و «همکاری با ما»
   (فقط در صفحه منو) — کوچک‌تر و ظریف‌تر، با کمترین اسکرول
   ========================================================= */

body:has(.mp) .customer-modal-overlay,
body:has(.mp) #jobsModal {
    padding: 12px;
}

body:has(.mp) .customer-modal,
body:has(.mp) #jobsModal .modal-box {
    width: min(380px, 100%);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 18px 18px 16px;
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
}

/* عنوان‌ها */
body:has(.mp) .customer-modal h3,
body:has(.mp) #jobsModal .modal-box h3 {
    margin: 0 0 6px;
    font-size: 21px;
    line-height: 1.4;
}

body:has(.mp) .customer-modal-subtitle {
    margin-bottom: 12px;
    font-size: 11.5px;
    line-height: 1.8;
}

/* فیلدها */
body:has(.mp) .customer-modal label,
body:has(.mp) #jobsModal .job-form-group label {
    margin-bottom: 5px;
    font-size: 11.5px;
    font-weight: 600;
}

body:has(.mp) .customer-modal input,
body:has(.mp) #jobsModal .job-form-group input,
body:has(.mp) #jobsModal .job-form-group select,
body:has(.mp) #jobsModal .job-form-group textarea {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
}

body:has(.mp) #jobsModal .job-form-group {
    margin-bottom: 9px;
}

body:has(.mp) #jobsModal .job-form-group textarea {
    min-height: 60px;
    height: 60px;
}

/* دکمه‌ها */
body:has(.mp) .customer-primary-btn,
body:has(.mp) #jobsModal .job-submit-btn {
    padding: 10px;
    font-size: 13px;
}

body:has(.mp) .customer-primary-btn { margin-top: 10px; }

body:has(.mp) .customer-close-btn,
body:has(.mp) .customer-logout,
body:has(.mp) #jobsModal .modal-close {
    margin-top: 8px;
    padding: 8px;
    font-size: 12.5px;
}

body:has(.mp) .customer-message,
body:has(.mp) #jobsModal .job-message {
    margin-top: 8px;
    font-size: 11.5px;
    line-height: 1.7;
}

/* پروفایل باشگاه */
body:has(.mp) .customer-welcome {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.8;
}

body:has(.mp) .customer-stats {
    gap: 8px;
    margin-bottom: 10px;
}

body:has(.mp) .customer-stat {
    padding: 10px 8px;
    border-radius: 12px;
}

body:has(.mp) .customer-stat-label { margin-bottom: 3px; font-size: 10.5px; }
body:has(.mp) .customer-stat-value { font-size: 17px; }

body:has(.mp) .customer-tier {
    padding: 10px;
    border-radius: 12px;
}

body:has(.mp) .customer-tier span { margin-bottom: 2px; font-size: 10.5px; }
body:has(.mp) .customer-tier strong { font-size: 15px; }

body:has(.mp) .customer-orders { margin-top: 12px; }
body:has(.mp) .customer-orders h4 { margin-bottom: 6px; font-size: 13px; }
body:has(.mp) .customer-order-item { padding: 8px 0; font-size: 11.5px; }


/* دکمه برگشت به صفحه اصلی (فلش داخل دایره) */
body:has(.mp) .nav-actions .home-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    color: var(--mp-ink);
    text-decoration: none;
}

body:has(.mp) .nav-actions .home-circle svg {
    display: block;
    width: 18px;
    height: 18px;
}

body:has(.mp) .nav-actions .home-circle:hover,
body:has(.mp) .nav-actions .home-circle:active {
    color: #fff;
}

/* ته صفحه فضای خالی بماند تا دسته‌های آخر هم بتوانند به بالا برسند */
.mp-list {
    padding-bottom: 55vh;
}


/* =========================================================
   کارت‌های فشرده‌تر و ظریف‌تر — جای آیتم بیشتر در هر صفحه
   ========================================================= */
.mp-list { padding: 4px 12px 0; }
.mp-section-title { margin: 12px 6px 7px; font-size: 13.5px; }

.mp-card {
    margin-bottom: 7px;
    padding: 8px 10px 8px;
    border-radius: 14px;
}

.mp-card-top { gap: 9px; }

.mp-thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 9px;
    font-size: 20px;
}

.mp-info h3 { margin: 0 0 1px; font-size: 13px; font-weight: 700; }
.mp-info p { font-size: 10.5px; font-weight: 500; line-height: 1.5; }
.mp-rating { margin-top: 1px; font-size: 10px; }

.mp-card-bottom { gap: 8px; margin-top: 6px; }

.mp-price {
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 500;
}

.mp-stepper { gap: 7px; }
.mp-stepper button {
    width: 28px;
    height: 28px;
    font-size: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.mp-stepper span { min-width: 14px; font-size: 13px; font-weight: 600; }

.mp-coffee-btn { padding: 6px 14px; border-radius: 16px; font-size: 11px; }
.mp-soldout { padding: 6px 12px; border-radius: 16px; font-size: 10.5px; }

/* پیام «به سفارش اضافه شد»: کوچک و درست بالای نوار پایین */
body:has(.mp) #cartNotification {
    bottom: 62px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
