/* ============================================================
   Moshina Mobile Bottom Floating Navbar & Modal Styles
   ============================================================ */

/* Hide on Desktop by default */
.moshina-mobile-bottom-nav,
.moshina-account-modal-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* Prevent body content overlap */
    body.has-moshina-bottom-nav {
        padding-bottom: 75px !important;
    }

    /* Floating Bottom Navbar Container */
    .moshina-mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: #ffffff;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.08);
        z-index: 99999;
        direction: rtl;
        align-items: center;
        justify-content: space-around;
        border-top: 1px solid #f0f0f4;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .moshina-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
        position: relative;
        height: 100%;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .moshina-nav-item svg {
        width: 22px;
        height: 22px;
        stroke: #64748b;
        fill: none;
        transition: stroke 0.2s ease, transform 0.2s ease;
        margin-bottom: 3px;
    }

    /* Hover & Active Nav Item */
    .moshina-nav-item:hover,
    .moshina-nav-item:hover .moshina-nav-label,
    span.moshina-nav-label:hover {
        color: var(--moshina-accent-color, #C07D36) !important;
    }

    .moshina-nav-item:hover svg {
        stroke: var(--moshina-accent-color, #C07D36) !important;
    }

    /* Active Nav Item */
    .moshina-nav-item.active {
        color: var(--moshina-accent-color, #C07D36);
    }

    .moshina-nav-item.active svg {
        stroke: var(--moshina-accent-color, #C07D36);
    }

    .moshina-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 4px;
        width: 16px;
        height: 3px;
        background: var(--moshina-accent-color, #C07D36);
        border-radius: 4px;
    }

    /* Center Floating Action Button (FAB Cart) */
    .moshina-nav-item.moshina-nav-cart {
        position: relative;
        overflow: visible;
    }

    .moshina-fab-cart-circle {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: var(--moshina-accent-color, #C07D36);
        position: absolute;
        top: -22px;
        left: 50%;
        transform: translateX(-50%);
        border: 4px solid #ffffff;
        box-shadow: 0 6px 18px rgba(121, 154, 52, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .moshina-nav-cart:hover .moshina-fab-cart-circle,
    .moshina-nav-cart:active .moshina-fab-cart-circle {
        transform: translateX(-50%) scale(1.06);
    }

    .moshina-fab-cart-circle svg {
        width: 24px;
        height: 24px;
        stroke: #ffffff !important;
        fill: none;
        margin-bottom: 0;
    }

    .moshina-nav-cart .moshina-nav-label {
        margin-top: 32px;
        color: var(--moshina-accent-color, #C07D36);
        font-weight: 800;
    }

    /* Cart Count Badge */
    .moshina-cart-badge {
        position: absolute;
        top: -2px;
        right: -2px;
        background: #ef4444;
        color: #ffffff;
        font-size: 10px;
        font-weight: 800;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffffff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    }

    /* Modal Popup Overlay */
    .moshina-account-modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999999;
        align-items: flex-end;
        justify-content: center;
        padding: 0;
        animation: moshinaFadeIn 0.25s ease forwards;
    }

    .moshina-account-modal-overlay.active {
        display: flex !important;
    }

    .moshina-account-modal-container {
        width: 100%;
        max-width: 440px;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 28px 28px 0 0;
        background: #ffffff;
        position: relative;
        animation: moshinaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }

    .moshina-modal-close-btn {
        position: absolute;
        top: 14px;
        left: 14px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f1f5f9;
        border: none;
        color: #64748b;
        font-size: 18px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: background 0.2s ease;
    }

    .moshina-modal-close-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }
}

@keyframes moshinaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes moshinaSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============================================================
   Moshina Mobile-App Styled Account Widget (RTL Mobile Screen)
   ============================================================ */

.moshina-account-widget-card {
    max-width: 390px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 32px;
    padding: 24px 20px 28px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0,0,0,0.02);
    box-sizing: border-box;
    font-family: inherit;
    direction: rtl;
    text-align: right;
    position: relative;
    border: 1px solid #eef0f4;
    overflow: hidden;
}

/* Mobile Screen Top Speaker Notch Accent */
.moshina-mobile-notch {
    width: 60px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 0 auto 18px auto;
}

/* Header Logo (Logged Out) */
.moshina-account-header {
    text-align: center;
    margin-bottom: 20px;
}

.moshina-account-logo-badge {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px auto;
    border-radius: 50%;
    border: 3px solid #C07D36;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(121, 154, 52, 0.15);
    overflow: hidden;
}

.moshina-account-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.moshina-account-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
    text-align: center;
}

.moshina-account-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Tabs Switcher (Logged Out) */
.moshina-account-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 30px;
    margin-bottom: 20px;
    gap: 4px;
}

.moshina-account-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.moshina-account-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Phone Input Form */
.moshina-account-form-group {
    margin-bottom: 16px;
}

.moshina-account-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.moshina-phone-input-wrapper {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.moshina-phone-input-wrapper:focus-within {
    border-color: #C07D36;
    box-shadow: 0 0 0 3px rgba(121, 154, 52, 0.15);
    background: #ffffff;
}

.moshina-country-code {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    user-select: none;
    white-space: nowrap;
}

.moshina-flag-icon {
    font-size: 18px;
    line-height: 1;
}

.moshina-phone-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    direction: ltr;
    text-align: right;
    letter-spacing: 0.5px;
}

.moshina-phone-input::placeholder {
    color: #94a3b8;
    letter-spacing: normal;
    font-weight: 500;
}

/* Primary Submit Button */
.moshina-account-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 16px;
    background: #C07D36;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(121, 154, 52, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.moshina-account-submit-btn:hover {
    background: #68872b;
    box-shadow: 0 6px 18px rgba(121, 154, 52, 0.35);
}

.moshina-account-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Divider */
.moshina-account-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.moshina-account-divider::before,
.moshina-account-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.moshina-account-divider span {
    padding: 0 10px;
}

/* Google Button */
.moshina-google-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.moshina-google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.moshina-google-icon {
    width: 18px;
    height: 18px;
}

/* Feedback Messages */
.moshina-account-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.5;
    display: none;
}

.moshina-account-msg.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.moshina-account-msg.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Footer Terms */
.moshina-account-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

.moshina-account-footer a {
    color: #64748b;
    text-decoration: underline;
}

/* ============================================================
   LOGGED-IN MOBILE APP SCREEN STYLES
   ============================================================ */

.moshina-dash-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 14px;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.moshina-dash-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.moshina-dash-avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #C07D36;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(121, 154, 52, 0.25);
    border: 2px solid #ffffff;
    overflow: hidden;
}

.moshina-dash-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moshina-dash-status-dot {
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.moshina-dash-user-info {
    flex: 1;
    min-width: 0;
}

.moshina-dash-greeting {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.moshina-dash-phone {
    font-size: 11px;
    color: #64748b;
    direction: ltr;
    display: inline-block;
    font-weight: 600;
}

.moshina-dash-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-right: 4px;
}

/* Quick Metrics Stats Grid */
.moshina-dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.moshina-stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px 4px;
    text-align: center;
    transition: transform 0.2s ease;
}

.moshina-stat-card:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.moshina-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: #C07D36;
    line-height: 1.2;
    margin-bottom: 2px;
}

.moshina-stat-label {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
}

/* Mobile Segmented Nav Tabs */
.moshina-dash-nav-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 20px;
    margin-bottom: 16px;
    gap: 4px;
    border: none;
}

.moshina-dash-nav-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
}

.moshina-dash-nav-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Panel Hiding Rules (CRITICAL: Hide inactive panels) */
.moshina-dash-panel {
    display: none !important;
}

.moshina-dash-panel.active {
    display: block !important;
}

/* Order Cards (Scoped to account widget card to avoid overriding main my-orders widget) */
.moshina-account-widget-card .moshina-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.moshina-account-widget-card .moshina-order-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moshina-account-widget-card .moshina-order-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.moshina-account-widget-card .moshina-order-num {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.moshina-account-widget-card .moshina-order-meta {
    font-size: 10px;
    color: #64748b;
}

.moshina-account-widget-card .moshina-order-status-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-block;
}

.moshina-account-widget-card .moshina-order-status-badge.completed {
    background: #dcfce7;
    color: #15803d;
}

.moshina-account-widget-card .moshina-order-status-badge.processing,
.moshina-account-widget-card .moshina-order-status-badge.pending,
.moshina-account-widget-card .moshina-order-status-badge.on-hold {
    background: #fef3c7;
    color: #b45309;
}

.moshina-account-widget-card .moshina-order-status-badge.cancelled,
.moshina-account-widget-card .moshina-order-status-badge.refunded {
    background: #fee2e2;
    color: #b91c1c;
}

.moshina-account-widget-card .moshina-order-action-btn {
    font-size: 11px;
    font-weight: 700;
    color: #C07D36;
    text-decoration: none;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #C07D36;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.moshina-account-widget-card .moshina-order-action-btn:hover {
    background: #C07D36;
    color: #ffffff;
}

/* Empty State */
.moshina-empty-orders {
    text-align: center;
    padding: 20px 10px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.moshina-empty-orders-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.moshina-shop-now-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #C07D36;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
}

/* Info Cards */
.moshina-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    font-size: 12px;
    color: #334155;
    line-height: 1.6;
}

.moshina-info-box-header {
    font-weight: 800;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dash Footer Actions */
.moshina-dash-footer-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.moshina-dash-footer-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.moshina-dash-footer-btn.main {
    background: #799a34;
    color: #ffffff;
}

.moshina-dash-footer-btn.exit {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Spinner */
.moshina-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: moshina-spin 0.8s linear infinite;
}

@keyframes moshina-spin {
    to { transform: rotate(360deg); }
}

/* Register/Account fields — visible by default */
.moshina-register-only-fields,
.moshina-reg-fields-group {
    display: block;
    visibility: visible;
    opacity: 1;
}

.moshina-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.moshina-input-wrapper:focus-within {
    border-color: #C07D36;
    box-shadow: 0 0 0 3px rgba(192, 125, 54, 0.15);
    background: #ffffff;
}

.moshina-text-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    direction: rtl;
    text-align: right;
}

.moshina-text-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

/* ============================================================
   Order Cards — inside Account Widget Dashboard
   ============================================================ */
.moshina-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
    overflow-y: auto;
    padding-left: 2px;
}

.moshina-order-card {
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}

.moshina-order-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.moshina-order-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

/* داخل الكارت — الصف الأخير يحتوي status + عرض */
.moshina-order-card > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

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

.moshina-order-num {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.moshina-order-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Badges */
.moshina-order-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #475569;
}

.moshina-order-status-badge.processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.moshina-order-status-badge.completed {
    background: #dcfce7;
    color: #15803d;
}

.moshina-order-status-badge.pending,
.moshina-order-status-badge.pending-payment {
    background: #fef9c3;
    color: #854d0e;
}

.moshina-order-status-badge.cancelled,
.moshina-order-status-badge.refunded {
    background: #fee2e2;
    color: #b91c1c;
}

.moshina-order-status-badge.on-hold {
    background: #fff7ed;
    color: #c2410c;
}

/* View order button */
.moshina-order-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #C07D36;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.moshina-order-action-btn:hover {
    background: #a0652a;
    color: #ffffff;
    text-decoration: none;
}
