/* apps/ai_robot/static/ai_robot/css/robot_widget.css */
/* ============================================================
   تصميم زر ونافذة "مساعدك الذكي" — يعتمد على متغيرات CSS العامة
   للمشروع (--text-*, --border, --secondary) للنصوص/الحدود المحايدة،
   بالإضافة لمتغيرات هوية خاصة بالروبوت (--ai-robot-*) مبنية على
   ألوان العلامة الحقيقية للمنصة:
     • البرتقالي #ff6b00 — نفس اللون الفعلي المستعمل لحالة "active"
       في شريط التنقل الرئيسي (templates/partials/css/navbar.css)،
       ونفس لون عربة التسوّق في شخصية الروبوت الرسمية (profil_robot.png).
     • الأخضر الزمردي #059669 — نفس --success المستعمل فعلاً في
       apps/products/static/my_product/css/product_detail.css لكل
       حالات "متوفر/نجاح" على نفس الصفحة، ويطابق لون عيني الروبوت
       وفقاعة الحوار في نفس الصورة الرسمية.
   [SCOPE-SAFE]: كل متغيرات --ai-robot-* جديدة بالكامل بأسماء فريدة —
   لا نُعيد تعريف --primary/--success العامّين (تجنّباً لأي أثر جانبي
   غير مقصود على بقية عناصر الصفحة التي تعتمد عليهما).
   ============================================================ */

:root {
    --ai-robot-primary:        #ff6b00;
    --ai-robot-primary-dark:   #ea580c;
    --ai-robot-primary-light:  #fff1e6;
    --ai-robot-accent:         #059669;
    --ai-robot-accent-dark:    #047857;
    --ai-robot-accent-light:   #ecfdf5;
}

/* ── زر فتح المساعد — شريط كامل العرض تحت أزرار التواصل ── */
.ai-robot-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    margin-top: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    border: none;
    font-size: 0.92rem;
    font-weight: 800;
    font-family: inherit;
    direction: rtl;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--ai-robot-primary) 0%, var(--ai-robot-primary-dark) 100%);
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.32);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    animation: aiRobotBtnIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-robot-open-btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45); }
.ai-robot-open-btn:active { transform: scale(0.97); }
.ai-robot-open-btn-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: block;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}
@keyframes aiRobotBtnIn {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── z-index أعلى من nav.main-navbar (9999) — بدونه، الشريط السفلي
   الثابت للجوال يعلو فوق أسفل النافذة (صف الإدخال) ويعترض النقر
   عليه. لا نلمس .modal-ovrfrm العام (يُستخدم في نوافذ أخرى بالموقع)،
   فقط نرفع z-index لهذه النافذة تحديداً. طبقة تعتيم + ضبابية خفيفة
   خاصة بهذه النافذة فقط (نفس أسلوب ضبابية شريط التنقل نفسه). ── */
.ai-robot-overlay {
    z-index: 10000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ── حاوية النافذة ── */
.ai-robot-cont {
    display: flex;
    flex-direction: column;
    max-width: 480px;
    width: 92vw;
    height: min(640px, 85vh);
    padding: 0;
    text-align: initial;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
    animation: aiRobotModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes aiRobotModalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── الرأس ── */
.ai-robot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex: 0 0 auto;
    background: linear-gradient(135deg, var(--ai-robot-primary-light) 0%, #fff 65%);
}
.ai-robot-header-info {
    display: flex;
    align-items: center;
    gap: 11px;
}
.ai-robot-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--ai-robot-primary), var(--ai-robot-primary-dark));
    box-shadow: 0 3px 10px rgba(255, 107, 0, 0.35);
    flex-shrink: 0;
}
.ai-robot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #fff;
}
.ai-robot-avatar::after {
    /* نقطة "متصل" حيّة — تفصيلة تفاعلية بسيطة تُشعر العميل بأن
       المساعد جاهز الآن، بلون النجاح المطابق لعينَي الشخصية الرسمية. */
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ai-robot-accent);
    border: 2px solid #fff;
}
.ai-robot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary, #111827);
}
.ai-robot-subtitle {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
}

/* ── جسم المحادثة (قابل للتمرير) ── */
.ai-robot-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--secondary, #f9fafb);
    scrollbar-width: thin;
    scrollbar-color: var(--ai-robot-primary-light) transparent;
}
.ai-robot-body::-webkit-scrollbar { width: 6px; }
.ai-robot-body::-webkit-scrollbar-thumb { background: #ffd9b8; border-radius: 10px; }

/* ── فقاعات الرسائل ── */
.ai-robot-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: aiRobotMsgIn 0.22s ease both;
}
@keyframes aiRobotMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-robot-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--ai-robot-primary), var(--ai-robot-primary-dark));
    color: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.22);
}
.ai-robot-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--text-primary, #111827);
    border: 1px solid var(--border, #e5e7eb);
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.ai-robot-msg.system {
    align-self: center;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 0.78rem;
    text-align: center;
    max-width: 100%;
}
.ai-robot-msg.error {
    align-self: flex-start;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-bottom-right-radius: 4px;
}

/* ── مؤشّر "يكتب..." ── */
.ai-robot-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.ai-robot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-robot-primary);
    opacity: 0.75;
    animation: aiRobotBounce 1.2s infinite ease-in-out;
}
.ai-robot-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-robot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiRobotBounce {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.45; }
    30%           { transform: translateY(-4px); opacity: 1;   }
}

/* ── [ORDER-NOW-CTA] اقتراح "اطلبه الآن" بعد نجاح "أضف للسلة" — بارز
   بلون العلامة، ليدفع العميل لإتمام الشراء مباشرة بلا فقد الزخم. ── */
.ai-robot-order-now-cta {
    align-self: flex-start;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--ai-robot-primary), var(--ai-robot-primary-dark));
    box-shadow: 0 3px 10px rgba(255, 107, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    animation: aiRobotMsgIn 0.22s ease both;
}
.ai-robot-order-now-cta:hover  { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255, 107, 0, 0.4); }
.ai-robot-order-now-cta:active { transform: scale(0.97); }
.ai-robot-order-now-cta:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── اقتراح "ترك رسالة للبائع" داخل فقاعة الرد ── */
.ai-robot-leave-msg-cta {
    align-self: flex-start;
    background: #fff;
    border: 1.5px dashed var(--ai-robot-primary);
    color: var(--ai-robot-primary-dark);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.ai-robot-leave-msg-cta:hover { background: var(--ai-robot-primary-light); transform: translateY(-1px); }

/* ── صندوق "ترك رسالة للبائع" ── */
.ai-robot-leave-msg {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: #fffbeb;
}
.ai-robot-leave-msg .msg-seller-textarea {
    margin-bottom: 8px;
}
.ai-robot-leave-msg-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── شريط الأسئلة المقترحة (قبل/أثناء الكتابة) ── */
.ai-robot-suggestions-bar {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border-top: 1px solid var(--border, #e5e7eb);
    background: #fff;
    scrollbar-width: thin;
}
.ai-robot-suggestion-chip {
    flex-shrink: 0;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border, #e5e7eb);
    background: var(--secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.78rem;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ai-robot-suggestion-chip:hover {
    background: var(--ai-robot-primary-light);
    border-color: var(--ai-robot-primary);
    color: var(--ai-robot-primary-dark);
    transform: translateY(-1px);
}

/* ── اقتراحات متابعة داخل تدفّق المحادثة (بعد كل جواب) ── */
.ai-robot-followups {
    align-self: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -2px;
}
.ai-robot-followup-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
    color: var(--ai-robot-primary-dark);
    font-size: 0.76rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.ai-robot-followup-chip:hover { background: var(--ai-robot-primary-light); }

/* ── [CART-ACTION] منتقي "أضف للسلة" — أزرار اختيار صريحة، لا نص حر ── */
.ai-robot-cart-picker {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    animation: aiRobotMsgIn 0.22s ease both;
}

/* ── رأس المنتقي: صورة المنتج + اسمه — متجاوب (min-width:0 يسمح للاسم
   بالانكماش/القطع بدل دفع الصورة خارج الحاوية على الشاشات الضيقة) ── */
.ai-robot-cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.ai-robot-cart-header-img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--secondary, #f3f4f6);
}
.ai-robot-cart-header-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--ai-robot-primary-light);
}
.ai-robot-cart-header-name {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── [FIX-QTY-STEPPER] عدّاد الكمية (+/−) — في منتقي السلة ومعالج الطلب ── */
.ai-robot-qty-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ai-robot-qty-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary, #6b7280);
}
.ai-robot-qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-robot-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border, #e5e7eb);
    background: var(--secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ai-robot-qty-btn:hover:not(:disabled) {
    border-color: var(--ai-robot-primary);
    color: var(--ai-robot-primary);
}
.ai-robot-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-robot-qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary, #111827);
}

/* [FIX-GROUPS-SPACING]: container (ai-robot-attribute-groups) هو الأب
   الفعلي لكل .ai-robot-cart-group (لون/مقاس...) — كان بلا أي تنسيق
   خاص به، فلا يستفيد من الـ gap العمودي لأب .ai-robot-cart-picker
   (المُطبَّق فقط على أبنائه المباشرين)؛ عند منتج بخاصيتين معاً كانتا
   تلتصقان بصرياً بلا فاصل واضح. */
.ai-robot-attribute-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-robot-cart-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 6px;
}
.ai-robot-cart-group-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.ai-robot-cart-option {
    padding: 8px 15px;
    border-radius: 999px;
    border: 1.5px solid var(--border, #e5e7eb);
    background: var(--secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    min-height: 38px;
}
.ai-robot-cart-option:hover { border-color: var(--ai-robot-primary); transform: translateY(-1px); }
.ai-robot-cart-option.selected {
    background: var(--ai-robot-primary);
    border-color: var(--ai-robot-primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}
/* [SELLER-DELIVERY-ZONE]: نفس ألوان .ai-robot-msg.error أعلاه بالحرف —
   البائع ضبط جدوله (SellerDeliveryZone) لكن لم يُفعّل ولاية العميل. */
.ai-robot-delivery-blocked-badge {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}
.ai-robot-cart-qty-note {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}
.ai-robot-cart-confirm-btn {
    padding: 11px 14px;
    border-radius: 12px;
    border: none;
    font-size: 0.87rem;
    font-weight: 800;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--ai-robot-primary), var(--ai-robot-primary-dark));
    box-shadow: 0 3px 10px rgba(255, 107, 0, 0.28);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    min-height: 44px;
}
.ai-robot-cart-confirm-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ai-robot-cart-confirm-btn:disabled {
    opacity: 0.45;
    box-shadow: none;
    cursor: not-allowed;
}

/* ── [ORDER-INTENT] معالج "اطلبه الآن" — معلومات شخصية + دفع ── */
.ai-robot-order-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8rem;
    border-bottom: 1px dashed var(--border, #e5e7eb);
}
.ai-robot-order-summary-row:last-of-type { border-bottom: none; }
.ai-robot-order-summary-label {
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
    flex-shrink: 0;
}

.ai-robot-order-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
}
.ai-robot-order-field-label {
    display: block;
}
.ai-robot-order-input {
    padding: 11px 13px;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 10px;
    /* [FIX-IOS-ZOOM]: نفس سبب .ai-robot-input — يشمل أيضاً <select>
       الولاية (نفس الصنف)، الذي يُعاني من نفس مشكلة التكبير القسري. */
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary, #111827);
    background: #fff;
    direction: rtl;
    min-height: 44px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-robot-order-input:focus {
    outline: none;
    border-color: var(--ai-robot-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}
.ai-robot-order-field-error {
    font-size: 0.72rem;
    color: #b91c1c;
    font-weight: 700;
}

.ai-robot-order-edit-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--ai-robot-primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
}
.ai-robot-order-edit-btn:hover { text-decoration: underline; }

.ai-robot-order-price-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--secondary, #f9fafb);
}
.ai-robot-order-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    padding: 2px 0;
}
.ai-robot-order-price-row-total {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ai-robot-primary-dark);
    padding-top: 7px;
    margin-top: 4px;
    border-top: 1px dashed var(--border, #e5e7eb);
}

/* ── بطاقة تأكيد الطلب الناجح — بلون النجاح المطابق لهوية الشخصية ── */
.ai-robot-order-success {
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary, #111827);
    background: var(--ai-robot-accent-light);
    border-color: rgba(5, 150, 105, 0.25);
}
.ai-robot-order-track-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--ai-robot-accent), var(--ai-robot-accent-dark));
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

/* ── [BOOKING-INTENT] معالج "احجز" — تقويم شهري مصغّر + فواصل + دفع ── */
.ai-robot-cal-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border, #e5e7eb);
}
.ai-robot-cal-section:first-of-type { padding-top: 0; border-top: none; }

.ai-robot-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ai-robot-cal-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}
.ai-robot-cal-nav {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border, #e5e7eb);
    background: #fff;
    color: var(--text-primary, #111827);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ai-robot-cal-nav:hover:not(:disabled) { border-color: var(--ai-robot-primary); }
.ai-robot-cal-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.ai-robot-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.ai-robot-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: var(--secondary, #f9fafb);
    color: var(--text-primary, #111827);
    font-size: 0.76rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.ai-robot-cal-day--empty { visibility: hidden; cursor: default; }
.ai-robot-cal-day--today { border-color: var(--ai-robot-primary); }
.ai-robot-cal-day--selected {
    border-color: var(--ai-robot-primary) !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.25);
    font-weight: 800;
}
/* [STATUS-COLOR-PARITY]: نفس الألوان الحرفية المستعملة فعلياً في تقويم
   صفحة الخدمة الحقيقية (offer_detail.css: .bk-cal-day--*) — اتساق بصري
   تام بين الودجت والصفحة، لا اختراع لوني موازٍ. */
.ai-robot-cal-day--available { background: #dcfce7; color: #15803d; }
.ai-robot-cal-day--good      { background: #fef9c3; color: #a16207; }
.ai-robot-cal-day--limited   { background: #ffedd5; color: #c2410c; }
.ai-robot-cal-day--unavailable { background: #fee2e2; color: #b91c1c; }
.ai-robot-cal-day--past { background: transparent; color: var(--text-secondary, #6b7280); opacity: 0.4; cursor: not-allowed; }
.ai-robot-cal-day:disabled { cursor: not-allowed; }

.ai-robot-cal-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
}

.ai-robot-cal-slot--full { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }

/* ── صف الإدخال ── */
.ai-robot-input-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: #fff;
}
.ai-robot-input {
    flex: 1;
    padding: 11px 15px;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 999px;
    /* [FIX-IOS-ZOOM]: أي input بخط أصغر من 16px يجعل Safari/iOS يُكبّر
       الصفحة تلقائياً بالكامل عند التركيز عليه (سلوك متصفح ثابت، لا
       علاقة له بعرض الشاشة) — تجربة مربكة ومزعجة على الجوال. 16px هو
       الحد الأدنى الآمن لتعطيل هذا التكبير القسري نهائياً. */
    font-size: 1rem;
    font-family: inherit;
    direction: rtl;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-robot-input:focus { border-color: var(--ai-robot-primary); box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1); }
.ai-robot-input:disabled { background: var(--secondary, #f3f4f6); cursor: not-allowed; }

.ai-robot-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ai-robot-primary), var(--ai-robot-primary-dark));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
    transition: filter 0.15s, transform 0.1s;
}
.ai-robot-send-btn:hover:not(:disabled)  { filter: brightness(1.06); }
.ai-robot-send-btn:active:not(:disabled) { transform: scale(0.93); }
.ai-robot-send-btn:disabled { opacity: 0.5; box-shadow: none; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   [MOBILE-POLISH] تجاوب حقيقي مخصَّص للجوال — لا مجرد "شاشة كاملة"،
   بل إعادة توزيع مسافات/أحجام لتبقى كل مساحة الشاشة الصغيرة مُستغَلة
   بذكاء (رأس أصغر، حشوات أضيق، فقاعات أعرض، مساحة لمس مريحة لكل عنصر
   تفاعلي)، بالإضافة لدعم أجهزة بحواف/نُتوءات (iPhone بشريط سفلي).
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .ai-robot-cont {
        height: 100vh;
        height: 100dvh; /* يراعي شريط عنوان المتصفح المتحرك في الجوال */
        max-height: 100vh;
        max-height: 100dvh;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }
    .ai-robot-overlay { padding: 0; }

    .ai-robot-header { padding: 12px 14px; }
    .ai-robot-avatar { width: 38px; height: 38px; }
    .ai-robot-header h3 { font-size: 0.95rem; }
    .ai-robot-subtitle { font-size: 0.72rem; }

    .ai-robot-body { padding: 12px; gap: 8px; }
    .ai-robot-msg { max-width: 88%; font-size: 0.86rem; }

    .ai-robot-suggestions-bar { padding: 7px 10px; }
    .ai-robot-suggestion-chip { padding: 8px 14px; font-size: 0.8rem; }
    .ai-robot-followup-chip   { padding: 7px 13px; font-size: 0.78rem; }

    .ai-robot-cart-picker { padding: 12px 14px; }
    .ai-robot-cart-option { padding: 9px 16px; min-height: 40px; }
    .ai-robot-cal-day { font-size: 0.7rem; }
    .ai-robot-cal-grid { gap: 3px; }

    /* [SAFE-AREA]: يمنع خفاء صف الإدخال/الأزرار الأخيرة خلف الشريط
       السفلي على iPhone بحافة سفلية (Home indicator) — بلا أي أثر
       على أجهزة بلا هذه الحافة (env() تُقيَّم صفراً هناك). */
    .ai-robot-input-row {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .ai-robot-leave-msg {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}
